Skip to content

Commit

Permalink
core: only assert qo sequencer nonce bump when not ethcall (ethereum#139
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tynes committed Dec 3, 2020
1 parent 88da6e7 commit a4e6351
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,18 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo
}

if vm.UsingOVM {
// Make sure that queue origin sequencer transactions increment the
// nonce. Transactions that fail execution here will not be included
// in blocks.
qo := msg.QueueOrigin()
if qo != nil && qo.Uint64() == uint64(types.QueueOriginSequencer) {
postNonce := st.state.GetNonce(msg.From())
if initialNonce+1 != postNonce {
log.Error("Tx did not increment the nonce", "from", msg.From().Hex(), "pre-nonce", initialNonce, "post-nonce", postNonce)
return nil, 0, false, errNonIncrementingNonce
// Only assert that the nonce increments when its not `eth_call`
if st.evm.Context.EthCallSender == nil {
// Make sure that queue origin sequencer transactions increment the
// nonce. Transactions that fail execution here will not be included
// in blocks.
qo := msg.QueueOrigin()
if qo != nil && qo.Uint64() == uint64(types.QueueOriginSequencer) {
postNonce := st.state.GetNonce(msg.From())
if initialNonce+1 != postNonce {
log.Error("Tx did not increment the nonce", "from", msg.From().Hex(), "pre-nonce", initialNonce, "post-nonce", postNonce)
return nil, 0, false, errNonIncrementingNonce
}
}
}
}
Expand Down

0 comments on commit a4e6351

Please sign in to comment.