Skip to content

Commit

Permalink
Fix oom on stage smt (erigontech#585)
Browse files Browse the repository at this point in the history
* fix oom on stage smt

* update
  • Loading branch information
zjg555543 authored Jun 12, 2024
1 parent d3f8b7a commit 11191f5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
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 @@ -129,8 +129,6 @@ func SpawnZkIntermediateHashesStage(s *stagedsync.StageState, u stagedsync.Unwin
eridb := db2.NewEriDb(tx)
smt := smt.NewSMT(eridb)

eridb.OpenBatch(quit)

if cfg.zk.IncrementTreeAlways {
// increment only behaviour
log.Debug(fmt.Sprintf("[%s] IncrementTreeAlways true - incrementing tree", logPrefix), "previousRootHeight", s.BlockNumber, "calculatingRootHeight", to)
Expand Down Expand Up @@ -356,6 +354,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

0 comments on commit 11191f5

Please sign in to comment.