diff --git a/block/fork.go b/block/fork.go index 8867a6319..8fe76259a 100644 --- a/block/fork.go +++ b/block/fork.go @@ -63,7 +63,7 @@ func (m *Manager) checkForkUpdate(msg string) error { if err != nil { return err } - m.freezeNode(fmt.Errorf("%s local_block_height: %d rollapp_revision_start_height: %d local_revision: %d rollapp_revision: %d", msg, m.State.Height(), expectedRevision.StartHeight, actualRevision, expectedRevision.Number)) + m.freezeNode(fmt.Errorf("%s local_block_height: %d rollapp_revision_start_height: %d local_revision: %d rollapp_revision: %d", msg, m.State.Height(), expectedRevision.StartHeight, actualRevision, expectedRevision.Number)) } return nil @@ -246,8 +246,6 @@ func (m *Manager) updateStateForNextRevision() error { if nextRevision.StartHeight == m.State.NextHeight() { // Set proposer to nil to force updating it from SL m.State.SetProposer(nil) - // Upgrade revision on state - m.State.RevisionStartHeight = nextRevision.StartHeight m.State.SetRevision(nextRevision.Number) // update stored state diff --git a/block/slvalidator.go b/block/slvalidator.go index bf9b8ac0a..758a7f510 100644 --- a/block/slvalidator.go +++ b/block/slvalidator.go @@ -179,8 +179,13 @@ func (v *SettlementValidator) ValidateDaBlocks(slBatch *settlement.ResultRetriev // last block of the batch lastDABlock := daBlocks[numSlBDs-1] + // we get revision for the next state update + revision, err := v.blockManager.getRevisionFromSL(lastDABlock.Header.Height + 1) + if err != nil { + return err + } // if lastDaBlock is previous block to fork, dont validate nextsequencerhash of last block because it will not match - if v.blockManager.State.RevisionStartHeight-1 == lastDABlock.Header.Height { + if revision.StartHeight-1 == lastDABlock.Header.Height { v.logger.Debug("DA blocks, previous to fork, validated successfully", "start height", daBlocks[0].Header.Height, "end height", daBlocks[len(daBlocks)-1].Header.Height) return nil }