risechain / pevm

Blazingly fast Parallel EVM
MIT License
227 stars 47 forks source link

fix: do not panic in nonce check #400

Closed kien-rise closed 2 weeks ago

kien-rise commented 2 weeks ago

Resolves https://github.com/risechain/pevm/issues/397

kien-rise commented 2 weeks ago

all discussions resolved

kien-rise commented 2 weeks ago

Sorry for the CI failure, I have fixed the test at tests/ethereum/main.rs.

cr-rise commented 1 week ago

@hai-rise the code is different. It is not failing if tx.caller != address, as it was before :

debug_assert!(
    tx.caller != address || tx.nonce.map_or(true, |n| n + 1 == nonce)
);
hai-rise commented 1 week ago

@cr-rise Hmm, previously if tx.caller != address then it's an instant true that passes the assertion without needing to evaluate further, right?

cr-rise commented 1 week ago

@hai-rise I got it, I was misreading somehow. The PR is correct.

hai-rise commented 1 week ago

@cr-rise No worries at all. I just made a boolean mistake today too! https://github.com/risechain/pevm/pull/415#discussion_r1825715235