Skip to content

Commit

Permalink
Merge pull request #1752 from OffchainLabs/blockvalidator_fix_writeLa…
Browse files Browse the repository at this point in the history
…stValid

block_validator: fix calls to writeLastValidated
  • Loading branch information
PlasmaPower authored Jul 11, 2023
2 parents fbbe3d0 + 1ee47ca commit 82d3138
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions staker/block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ func (v *BlockValidator) InitAssumeValid(globalState validator.GoGlobalState) er

v.legacyValidInfo = nil

err := v.writeLastValidated(v.lastValidGS, nil)
err := v.writeLastValidated(globalState, nil)
if err != nil {
log.Error("failed writing new validated to database", "pos", v.lastValidGS, "err", err)
}
Expand Down Expand Up @@ -868,7 +868,7 @@ func (v *BlockValidator) UpdateLatestStaked(count arbutil.MessageIndex, globalSt
v.validatedA = countUint64
v.valLoopPos = count
validatorMsgCountValidatedGauge.Update(int64(countUint64))
err = v.writeLastValidated(v.lastValidGS, nil) // we don't know which wasm roots were validated
err = v.writeLastValidated(globalState, nil) // we don't know which wasm roots were validated
if err != nil {
log.Error("failed writing valid state after reorg", "err", err)
}
Expand Down Expand Up @@ -932,7 +932,7 @@ func (v *BlockValidator) Reorg(ctx context.Context, count arbutil.MessageIndex)
if v.validatedA > countUint64 {
v.validatedA = countUint64
validatorMsgCountValidatedGauge.Update(int64(countUint64))
err := v.writeLastValidated(v.lastValidGS, nil) // we don't know which wasm roots were validated
err := v.writeLastValidated(v.nextCreateStartGS, nil) // we don't know which wasm roots were validated
if err != nil {
log.Error("failed writing valid state after reorg", "err", err)
}
Expand Down

0 comments on commit 82d3138

Please sign in to comment.