forked from erigontech/erigon
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
898 oldaccinputhash for lower forkids (#1161)
* parse sequenceBatches calldata * addec accInputHash calc function * save l1infoRoot and migration * correct etrog accInputHash calculation * save sequences data correctly * added pre etrog calculation * fix tests * fix tests * add a nil check * use prev batch accInputHash as old in proverInput endpoint * add etrog parsing and refactor * fix naming * fix test * fix tests pointer * fix tests
- Loading branch information
Showing
15 changed files
with
846 additions
and
120 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package migrations | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/gateway-fm/cdk-erigon-lib/common/datadir" | ||
"github.com/gateway-fm/cdk-erigon-lib/kv" | ||
"github.com/ledgerwatch/erigon/eth/stagedsync/stages" | ||
) | ||
|
||
var resetL1Sequences = Migration{ | ||
Name: "remove l1 sequences and stage_l1sync progress to download all l1 sequences anew", | ||
Up: func(db kv.RwDB, dirs datadir.Dirs, progress []byte, BeforeCommit Callback) (err error) { | ||
tx, err := db.BeginRw(context.Background()) | ||
if err != nil { | ||
return err | ||
} | ||
defer tx.Rollback() | ||
tx.ClearBucket(kv.L1SEQUENCES) | ||
|
||
// already checked | ||
if err := stages.SaveStageProgress(tx, stages.L1Syncer, 0); err != nil { | ||
return fmt.Errorf("failed to get highest checked block, %w", err) | ||
} | ||
|
||
// This migration is no-op, but it forces the migration mechanism to apply it and thus write the DB schema version info | ||
if err := BeforeCommit(tx, nil, true); err != nil { | ||
return err | ||
} | ||
return tx.Commit() | ||
}, | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.