Skip to content
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

Fix oom on stage smt #18

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions xlayerconfig-mainnet.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ zkevm.address-ger-manager: "0x580bda1e7A0CFAe92Fa7F6c20A3794F169CE3CFb"

zkevm.l1-rollup-id: 3
zkevm.l1-first-block: 19218658
zkevm.l1-block-range: 100
zkevm.l1-query-delay: 6000
zkevm.l1-block-range: 2000
zkevm.l1-query-delay: 1000
zkevm.rpc-ratelimit: 250
zkevm.datastream-version: 2

Expand Down
4 changes: 2 additions & 2 deletions xlayerconfig-testnet.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ zkevm.address-ger-manager: "0x66E61bA00F58b857A9DD2C500F3aBc424A46BD20"

zkevm.l1-rollup-id: 1
zkevm.l1-first-block: 4648290
zkevm.l1-block-range: 100
zkevm.l1-query-delay: 6000
zkevm.l1-block-range: 2000
zkevm.l1-query-delay: 1000
zkevm.rpc-ratelimit: 250
zkevm.datastream-version: 2

Expand Down
5 changes: 3 additions & 2 deletions zk/stages/stage_interhashes.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ func SpawnZkIntermediateHashesStage(s *stagedsync.StageState, u stagedsync.Unwin
eridb := db2.NewEriDb(tx)
smt := smt.NewSMT(eridb)

eridb.OpenBatch(quit)

if s.BlockNumber == 0 || shouldRegenerate {
if root, err = regenerateIntermediateHashes(logPrefix, tx, eridb, smt); err != nil {
return trie.EmptyRoot, err
Expand Down Expand Up @@ -335,6 +333,9 @@ func zkIncrementIntermediateHashes(ctx context.Context, logPrefix string, s *sta
log.Info(fmt.Sprintf("[%s] Increment trie hashes started", logPrefix), "previousRootHeight", s.BlockNumber, "calculatingRootHeight", to)
defer log.Info(fmt.Sprintf("[%s] Increment ended", logPrefix))

quit := ctx.Done()
eridb.OpenBatch(quit)

ac, err := db.CursorDupSort(kv.AccountChangeSet)
if err != nil {
return trie.EmptyRoot, err
Expand Down