mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-23 12:07:17 +00:00
make_history_check_optional (#1467)
This commit is contained in:
parent
f351eea439
commit
bf04a6e73d
@ -195,7 +195,7 @@ func syncBySmallSteps(db ethdb.Database, ctx context.Context) error {
|
||||
if err := st.Run(db, tx); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := checkChanges(expectedAccountChanges, tx, expectedStorageChanges, execAtBlock); err != nil {
|
||||
if err := checkChanges(expectedAccountChanges, tx, expectedStorageChanges, execAtBlock, sm.History); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -226,7 +226,7 @@ func syncBySmallSteps(db ethdb.Database, ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func checkChanges(expectedAccountChanges map[uint64]*changeset.ChangeSet, db ethdb.Database, expectedStorageChanges map[uint64]*changeset.ChangeSet, execAtBlock uint64) error {
|
||||
func checkChanges(expectedAccountChanges map[uint64]*changeset.ChangeSet, db ethdb.Database, expectedStorageChanges map[uint64]*changeset.ChangeSet, execAtBlock uint64, historyEnabled bool) error {
|
||||
for blockN := range expectedAccountChanges {
|
||||
if err := checkChangeSet(db, blockN, expectedAccountChanges[blockN], expectedStorageChanges[blockN]); err != nil {
|
||||
return err
|
||||
@ -235,11 +235,13 @@ func checkChanges(expectedAccountChanges map[uint64]*changeset.ChangeSet, db eth
|
||||
delete(expectedStorageChanges, blockN)
|
||||
}
|
||||
|
||||
if err := checkHistory(db, dbutils.PlainAccountChangeSetBucket, execAtBlock); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := checkHistory(db, dbutils.PlainStorageChangeSetBucket, execAtBlock); err != nil {
|
||||
return err
|
||||
if historyEnabled {
|
||||
if err := checkHistory(db, dbutils.PlainAccountChangeSetBucket, execAtBlock); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := checkHistory(db, dbutils.PlainStorageChangeSetBucket, execAtBlock); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user