Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
fix: CREATE high nonce (#976)
Browse files Browse the repository at this point in the history
<!--- Please provide a general summary of your changes in the title
above -->

<!-- Give an estimate of the time you spent on this PR in terms of work
days.
Did you spend 0.5 days on this PR or rather 2 days?  -->

Time spent on this PR:

## Pull request type

<!-- Please try to limit your pull request to one type,
submit multiple pull requests if needed. -->

Please check the type of change your PR introduces:

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying,
or link to a relevant issue. -->

Resolves #<Issue number>

## What is the new behavior?

<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Fixes wrong computation of nonce overflow 
-
-

<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/kkrt-labs/kakarot/976)
<!-- Reviewable:end -->
  • Loading branch information
enitrat authored Feb 13, 2024
1 parent febd374 commit 46d68c8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
14 changes: 0 additions & 14 deletions blockchain-tests-skip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,6 @@ testname:
stChainId:
- chainId_d0g0v0_Shanghai
stCreate2:
- CREATE2_HighNonceDelegatecall_d11g0v0_Shanghai
- CREATE2_HighNonceDelegatecall_d17g0v0_Shanghai
- CREATE2_HighNonceDelegatecall_d18g0v0_Shanghai
- CREATE2_HighNonceDelegatecall_d19g0v0_Shanghai
- CREATE2_HighNonceDelegatecall_d20g0v0_Shanghai
- CREATE2_HighNonceDelegatecall_d21g0v0_Shanghai
- CREATE2_HighNonceDelegatecall_d23g0v0_Shanghai
- CREATE2_HighNonceDelegatecall_d5g0v0_Shanghai
- CREATE2_HighNonceDelegatecall_d6g0v0_Shanghai
- CREATE2_HighNonceDelegatecall_d7g0v0_Shanghai
- CREATE2_HighNonceDelegatecall_d8g0v0_Shanghai
- CREATE2_HighNonceDelegatecall_d9g0v0_Shanghai
- CREATE2_HighNonce_d0g0v0_Shanghai
- Create2OOGafterInitCodeReturndataSize_d0g0v0_Shanghai
- Create2OOGafterInitCodeReturndata_d0g1v0_Shanghai
- Create2OOGafterInitCodeRevert_d0g0v0_Shanghai
Expand All @@ -85,7 +72,6 @@ testname:
- CREATE_EmptyContractWithStorageAndCallIt_1wei_d0g0v0_Shanghai
- CREATE_EmptyContractWithStorage_d0g0v0_Shanghai
- CREATE_EmptyContract_d0g0v0_Shanghai
- CREATE_HighNonce_d0g0v0_Shanghai
- CreateAddressWarmAfterFail_d10g0v0_Shanghai
- CreateAddressWarmAfterFail_d10g0v1_Shanghai
- CreateAddressWarmAfterFail_d11g0v0_Shanghai
Expand Down
2 changes: 1 addition & 1 deletion src/kakarot/instructions/system_operations.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ namespace SystemOperations {

// Check sender balance and nonce
let sender = State.get_account(evm.message.address.evm);
let is_nonce_overflow = is_le(Constants.MAX_NONCE + 1, sender.nonce);
let is_nonce_overflow = Helpers.is_zero(Constants.MAX_NONCE - sender.nonce);
let (is_balance_overflow) = uint256_lt([sender.balance], [value]);
let stack_depth_limit = is_le(1024, evm.message.depth);
if (is_nonce_overflow + is_balance_overflow + stack_depth_limit != 0) {
Expand Down

0 comments on commit 46d68c8

Please sign in to comment.