diff --git a/core/state/statedb.go b/core/state/statedb.go index 2a138a7384a2..ca7e94834d5c 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -704,7 +704,7 @@ func (s *StateDB) Copy() *StateDB { // CHANGE(taiko): RevisionId returns the latest snapshot id. func (s *StateDB) RevisionId() int { - return s.nextRevisionId + return s.journal.nextRevisionId } // Snapshot returns an identifier for the current revision of the state. diff --git a/miner/worker.go b/miner/worker.go index 9aa349f975ea..434f698370dc 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -159,10 +159,17 @@ func (miner *Miner) prepareWork(genParams *generateParams, witness bool) (*envir // to parent+1 if the mutation is allowed. timestamp := genParams.timestamp if parent.Time >= timestamp { - if genParams.forceTime { - return nil, fmt.Errorf("invalid timestamp, parent %d given %d", parent.Time, timestamp) + // CHANGE(taiko): block.timestamp == parent.timestamp is allowed in Taiko protocol. + if !miner.chainConfig.Taiko { + if genParams.forceTime { + return nil, fmt.Errorf("invalid timestamp, parent %d given %d", parent.Time, timestamp) + } + timestamp = parent.Time + 1 + } else { + if parent.Time > timestamp { + return nil, fmt.Errorf("invalid timestamp, parent %d given %d", parent.Time, timestamp) + } } - timestamp = parent.Time + 1 } // Construct the sealing block header. header := &types.Header{