Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
b1a2b985
Commit
b1a2b985
authored
Apr 03, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: delete hh tasks
parent
0c515ad5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
182 deletions
+0
-182
index.ts
packages/contracts-bedrock/tasks/index.ts
+0
-2
wait-for-final-batch.ts
packages/contracts-bedrock/tasks/wait-for-final-batch.ts
+0
-78
wait-for-final-deposit.ts
packages/contracts-bedrock/tasks/wait-for-final-deposit.ts
+0
-102
No files found.
packages/contracts-bedrock/tasks/index.ts
View file @
b1a2b985
...
...
@@ -8,6 +8,4 @@ import './solidity'
import
'
./accounts
'
import
'
./check-l2
'
import
'
./update-dynamic-oracle-config
'
import
'
./wait-for-final-batch
'
import
'
./wait-for-final-deposit
'
import
'
./generate-deploy-config
'
packages/contracts-bedrock/tasks/wait-for-final-batch.ts
deleted
100644 → 0
View file @
0c515ad5
import
{
task
,
types
}
from
'
hardhat/config
'
import
'
@nomiclabs/hardhat-ethers
'
import
'
hardhat-deploy
'
import
{
HardhatRuntimeEnvironment
}
from
'
hardhat/types
'
import
{
Contract
}
from
'
ethers
'
import
{
sleep
}
from
'
@eth-optimism/core-utils
'
task
(
'
wait-for-final-batch
'
,
'
Waits for the final batch to be submitted
'
)
.
addParam
(
'
l1RpcUrl
'
,
'
L1 RPC URL remote node
'
,
'
http://127.0.0.1:8545
'
,
types
.
string
)
.
addParam
(
'
l2RpcUrl
'
,
'
L2 RPC URL remote node
'
,
'
http://127.0.0.1:9545
'
,
types
.
string
)
.
setAction
(
async
(
args
,
hre
:
HardhatRuntimeEnvironment
)
=>
{
const
l1Provider
=
new
hre
.
ethers
.
providers
.
StaticJsonRpcProvider
(
args
.
l1RpcUrl
)
const
l2Provider
=
new
hre
.
ethers
.
providers
.
StaticJsonRpcProvider
(
args
.
l2RpcUrl
)
const
Deployment__CanonicalTransactionChain
=
await
hre
.
deployments
.
get
(
'
CanonicalTransactionChain
'
)
const
CanonicalTransactionChain
=
new
hre
.
ethers
.
Contract
(
Deployment__CanonicalTransactionChain
.
address
,
Deployment__CanonicalTransactionChain
.
abi
,
l1Provider
)
const
Deployment__StateCommitmentChain
=
await
hre
.
deployments
.
get
(
'
StateCommitmentChain
'
)
const
StateCommitmentChain
=
new
hre
.
ethers
.
Contract
(
Deployment__StateCommitmentChain
.
address
,
Deployment__StateCommitmentChain
.
abi
,
l1Provider
)
const
wait
=
async
(
contract
:
Contract
)
=>
{
let
height
=
await
l2Provider
.
getBlockNumber
()
let
totalElements
=
await
contract
.
getTotalElements
()
console
.
log
(
` - height:
${
height
}
`
)
console
.
log
(
` - totalElements:
${
totalElements
}
`
)
while
(
totalElements
.
toNumber
()
!==
height
)
{
console
.
log
(
'
Total elements does not match
'
)
console
.
log
(
` - height:
${
height
}
`
)
console
.
log
(
` - totalElements:
${
totalElements
}
`
)
console
.
log
(
`Waiting for
${
height
-
totalElements
}
elements to be submitted`
)
totalElements
=
await
contract
.
getTotalElements
()
height
=
await
l2Provider
.
getBlockNumber
()
await
sleep
(
5
*
1000
)
}
}
console
.
log
(
'
Waiting for the CanonicalTransactionChain...
'
)
await
wait
(
CanonicalTransactionChain
)
console
.
log
(
'
All transaction batches have been submitted
'
)
console
.
log
()
console
.
log
(
'
Waiting for the StateCommitmentChain...
'
)
await
wait
(
StateCommitmentChain
)
console
.
log
(
'
All state root batches have been submitted
'
)
console
.
log
()
console
.
log
(
'
All batches have been submitted
'
)
})
packages/contracts-bedrock/tasks/wait-for-final-deposit.ts
deleted
100644 → 0
View file @
0c515ad5
import
{
task
,
types
}
from
'
hardhat/config
'
import
'
@nomiclabs/hardhat-ethers
'
import
'
hardhat-deploy
'
import
{
HardhatRuntimeEnvironment
}
from
'
hardhat/types
'
import
{
BigNumber
}
from
'
ethers
'
import
{
sleep
,
toRpcHexString
}
from
'
@eth-optimism/core-utils
'
task
(
'
wait-for-final-deposit
'
,
'
Waits for the final deposit to be ingested
'
)
.
addParam
(
'
l1RpcUrl
'
,
'
L1 RPC URL remote node
'
,
'
http://127.0.0.1:8545
'
,
types
.
string
)
.
addParam
(
'
l2RpcUrl
'
,
'
L2 RPC URL remote node
'
,
'
http://127.0.0.1:9545
'
,
types
.
string
)
.
setAction
(
async
(
args
,
hre
:
HardhatRuntimeEnvironment
)
=>
{
const
l1Provider
=
new
hre
.
ethers
.
providers
.
StaticJsonRpcProvider
(
args
.
l1RpcUrl
)
const
l2Provider
=
new
hre
.
ethers
.
providers
.
StaticJsonRpcProvider
(
args
.
l2RpcUrl
)
// Handle legacy deployments
let
Deployment__AddressManager
=
await
hre
.
deployments
.
getOrNull
(
'
Lib_AddressManager
'
)
if
(
!
Deployment__AddressManager
)
{
Deployment__AddressManager
=
await
hre
.
deployments
.
get
(
'
AddressManager
'
)
}
const
AddressManager
=
new
hre
.
ethers
.
Contract
(
Deployment__AddressManager
.
address
,
Deployment__AddressManager
.
abi
,
l1Provider
)
const
Deployment__CanonicalTransactionChain
=
await
hre
.
deployments
.
get
(
'
CanonicalTransactionChain
'
)
const
CanonicalTransactionChain
=
new
hre
.
ethers
.
Contract
(
Deployment__CanonicalTransactionChain
.
address
,
Deployment__CanonicalTransactionChain
.
abi
,
l1Provider
)
// Wait for DTL_SHUTOFF_BLOCK block to be set in the AddressManager
let
dtlShutoffBlock
=
BigNumber
.
from
(
0
)
while
(
true
)
{
console
.
log
(
'
Waiting for DTL shutoff block to be set...
'
)
const
val
=
await
AddressManager
.
getAddress
(
'
DTL_SHUTOFF_BLOCK
'
)
dtlShutoffBlock
=
BigNumber
.
from
(
val
)
if
(
!
dtlShutoffBlock
.
eq
(
0
))
{
break
}
await
sleep
(
3000
)
}
console
.
log
(
`DTL shutoff block
${
dtlShutoffBlock
.
toString
()}
`
)
let
pending
=
await
CanonicalTransactionChain
.
getNumPendingQueueElements
()
console
.
log
(
`
${
pending
}
deposits must be batch submitted`
)
// Now query the number of queue elements in the CTC
const
queueLength
=
await
CanonicalTransactionChain
.
getQueueLength
()
console
.
log
(
`Total number of deposits:
${
queueLength
}
`
)
console
.
log
(
'
Searching backwards for final deposit
'
)
let
height
=
await
l2Provider
.
getBlockNumber
()
while
(
true
)
{
console
.
log
(
`Trying block
${
height
}
`
)
const
hex
=
toRpcHexString
(
height
)
const
b
=
await
l2Provider
.
send
(
'
eth_getBlockByNumber
'
,
[
hex
,
true
])
const
tx
=
b
.
transactions
[
0
]
if
(
tx
===
undefined
)
{
throw
new
Error
(
`unable to fetch transaction`
)
}
if
(
tx
.
queueOrigin
===
'
l1
'
)
{
const
queueIndex
=
BigNumber
.
from
(
tx
.
queueIndex
).
toNumber
()
if
(
queueIndex
===
queueLength
-
1
)
{
break
}
if
(
queueIndex
<
queueLength
)
{
throw
new
Error
(
`Missed the final deposit. queueIndex
${
queueIndex
}
, queueLength
${
queueLength
}
`
)
}
}
height
--
}
console
.
log
(
'
Final deposit has been ingested by l2geth
'
)
pending
=
await
CanonicalTransactionChain
.
getNumPendingQueueElements
()
console
.
log
(
`
${
pending
}
deposits must be batch submitted`
)
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment