-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tudor/flakyness and perf fixes #1559
Conversation
} | ||
|
||
for _, rollup := range rollups { | ||
l1CompressionBlock, err := rc.storage.FetchBlock(rollup.Header.CompressionL1Head) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added some sanity checks here
@@ -35,8 +35,8 @@ func TestInMemoryMonteCarloSimulation(t *testing.T) { | |||
StartPort: integration.StartPortSimulationInMem, | |||
IsInMem: true, | |||
L1SetupData: ¶ms.L1SetupData{}, | |||
ReceiptTimeout: 30 * time.Second, | |||
StoppingDelay: 10 * time.Second, | |||
ReceiptTimeout: 5 * time.Second, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those timeouts were too long for the in-mem sim
@@ -374,14 +406,27 @@ func (rc *RollupCompression) executeAndSaveIncompleteBatches(calldataRollupHeade | |||
// check whether the batch is already stored in the database | |||
b, err := rc.storage.FetchBatchBySeqNo(incompleteBatch.seqNo.Uint64()) | |||
if err == nil { | |||
parentHash = b.Hash() | |||
// chain to a parent only if the batch is not a reorg | |||
if incompleteBatch.header == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the bug that was causing the flakyness
continue | ||
} | ||
if !errors.Is(err, errutil.ErrNotFound) { | ||
return err | ||
} | ||
|
||
switch { | ||
// this batch was re-orged | ||
case incompleteBatch.header != nil: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another rare flakyness issue, when the genesis itself was reorged
|
||
// a cache of the l1 blocks used by the current rollup, indexed by their height | ||
l1BlocksAtHeight := make(map[uint64]*types.Block) | ||
err = rc.calcL1AncestorsOfHeight(big.NewInt(int64(slices.Min(l1Heights))), rollupL1Block, l1BlocksAtHeight) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the performance fix to avoid traversing blocks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Why this change is needed