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
ea10aafd
Unverified
Commit
ea10aafd
authored
Nov 28, 2022
by
mergify[bot]
Committed by
GitHub
Nov 28, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4051 from ethereum-optimism/sc/dtl-shutoff-block
feat(dtl): handle deposit shutoff
parents
43e87118
36bd8fbf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
orange-bananas-nail.md
.changeset/orange-bananas-nail.md
+5
-0
service.ts
...data-transport-layer/src/services/l1-ingestion/service.ts
+24
-2
No files found.
.changeset/orange-bananas-nail.md
0 → 100644
View file @
ea10aafd
---
'
@eth-optimism/data-transport-layer'
:
patch
---
Updates the DTL in preparation for shutoff during the Bedrock migration. So long, DTL!
packages/data-transport-layer/src/services/l1-ingestion/service.ts
View file @
ea10aafd
...
@@ -4,7 +4,7 @@ import { BaseService, Metrics } from '@eth-optimism/common-ts'
...
@@ -4,7 +4,7 @@ import { BaseService, Metrics } from '@eth-optimism/common-ts'
import
{
TypedEvent
}
from
'
@eth-optimism/contracts/dist/types/common
'
import
{
TypedEvent
}
from
'
@eth-optimism/contracts/dist/types/common
'
import
{
BaseProvider
,
StaticJsonRpcProvider
}
from
'
@ethersproject/providers
'
import
{
BaseProvider
,
StaticJsonRpcProvider
}
from
'
@ethersproject/providers
'
import
{
LevelUp
}
from
'
levelup
'
import
{
LevelUp
}
from
'
levelup
'
import
{
constants
}
from
'
ethers
'
import
{
BigNumber
,
constants
}
from
'
ethers
'
import
{
Gauge
,
Counter
}
from
'
prom-client
'
import
{
Gauge
,
Counter
}
from
'
prom-client
'
/* Imports: Internal */
/* Imports: Internal */
...
@@ -230,6 +230,28 @@ export class L1IngestionService extends BaseService<L1IngestionServiceOptions> {
...
@@ -230,6 +230,28 @@ export class L1IngestionService extends BaseService<L1IngestionServiceOptions> {
targetL1Block
,
targetL1Block
,
})
})
// We always try loading the deposit shutoff block in every loop! Less efficient but will
// guarantee that we don't miss the shutoff block being set and that we can automatically
// recover if the shutoff block is set and then unset.
const
depositShutoffBlock
=
BigNumber
.
from
(
await
this
.
state
.
contracts
.
Lib_AddressManager
.
getAddress
(
'
DTL_SHUTOFF_BLOCK
'
)
).
toNumber
()
// If the deposit shutoff block is set, then we should stop syncing deposits at that block.
let
depositTargetL1Block
=
targetL1Block
if
(
depositShutoffBlock
>
0
)
{
this
.
logger
.
info
(
`Deposit shutoff active`
,
{
targetL1Block
,
depositShutoffBlock
,
})
depositTargetL1Block
=
Math
.
min
(
depositTargetL1Block
,
depositShutoffBlock
)
}
// I prefer to do this in serial to avoid non-determinism. We could have a discussion about
// I prefer to do this in serial to avoid non-determinism. We could have a discussion about
// using Promise.all if necessary, but I don't see a good reason to do so unless parsing is
// using Promise.all if necessary, but I don't see a good reason to do so unless parsing is
// really, really slow for all event types.
// really, really slow for all event types.
...
@@ -237,7 +259,7 @@ export class L1IngestionService extends BaseService<L1IngestionServiceOptions> {
...
@@ -237,7 +259,7 @@ export class L1IngestionService extends BaseService<L1IngestionServiceOptions> {
'
CanonicalTransactionChain
'
,
'
CanonicalTransactionChain
'
,
'
TransactionEnqueued
'
,
'
TransactionEnqueued
'
,
highestSyncedL1Block
,
highestSyncedL1Block
,
t
argetL1Block
,
depositT
argetL1Block
,
handleEventsTransactionEnqueued
handleEventsTransactionEnqueued
)
)
...
...
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