Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev: update nonce for evm accounts #513

Merged
merged 31 commits into from
Sep 15, 2023

Conversation

ftupas
Copy link
Contributor

@ftupas ftupas commented Sep 4, 2023

Time spent on this PR: 1

Resolves: #502

Pull Request type

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
  • Testing

What is the new behavior?

nonce method now returns the following:

  • If the account is an EOA, return protocol-level nonce
  • Otherwise if it's a contract account, we use managed nonce

Does this introduce a breaking change?

  • Yes
  • No

crates/core/src/client/config.rs Show resolved Hide resolved
crates/core/src/client/mod.rs Outdated Show resolved Hide resolved
crates/core/src/contracts/account.rs Outdated Show resolved Hide resolved
@ftupas ftupas force-pushed the dev/update-nonce-for-evm-accounts branch 2 times, most recently from 2bfde09 to 60b42ee Compare September 5, 2023 11:09
@ftupas ftupas marked this pull request as ready for review September 5, 2023 11:10
@ftupas ftupas force-pushed the dev/update-nonce-for-evm-accounts branch from cf8aec1 to 92a5319 Compare September 6, 2023 10:24
crates/core/src/client/config.rs Outdated Show resolved Hide resolved
crates/core/src/test_utils/execution_helpers.rs Outdated Show resolved Hide resolved
crates/core/tests/client.rs Outdated Show resolved Hide resolved
crates/core/tests/client.rs Show resolved Hide resolved
crates/core/tests/client.rs Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Patch coverage: 83.65% and project coverage change: +49.74% 🎉

Comparison is base (71506a8) 23.17% compared to head (9349349) 72.91%.
Report is 227 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #513       +/-   ##
===========================================
+ Coverage   23.17%   72.91%   +49.74%     
===========================================
  Files           9       45       +36     
  Lines        1247     4139     +2892     
===========================================
+ Hits          289     3018     +2729     
- Misses        958     1121      +163     
Files Changed Coverage Δ
crates/core/src/mock/serde.rs 0.00% <0.00%> (ø)
crates/core/src/models/transaction.rs 93.63% <ø> (ø)
crates/core/src/models/transaction_receipt.rs 97.02% <ø> (ø)
crates/eth-rpc/src/api/alchemy_api.rs 100.00% <ø> (ø)
crates/eth-rpc/src/api/eth_api.rs 100.00% <ø> (ø)
crates/eth-rpc/src/api/net_api.rs 100.00% <ø> (ø)
crates/eth-rpc/src/api/web3_api.rs 100.00% <ø> (ø)
crates/eth-rpc/src/config.rs 100.00% <ø> (ø)
crates/eth-rpc/src/lib.rs 93.33% <ø> (ø)
crates/eth-rpc/src/main.rs 0.00% <ø> (ø)
... and 35 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ftupas ftupas force-pushed the dev/update-nonce-for-evm-accounts branch from 92a5319 to 5825f25 Compare September 7, 2023 07:40
crates/core/src/client/config.rs Show resolved Hide resolved
crates/core/src/client/mod.rs Outdated Show resolved Hide resolved
crates/core/src/mock/mock_starknet.rs Outdated Show resolved Hide resolved
@ftupas ftupas force-pushed the dev/update-nonce-for-evm-accounts branch from 7b25faa to d4552b9 Compare September 11, 2023 09:44
@ftupas ftupas force-pushed the dev/update-nonce-for-evm-accounts branch from 741e29d to 6cfa7d4 Compare September 11, 2023 10:22
Copy link
Contributor Author

@ftupas ftupas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review @Eikix

crates/core/src/client/mod.rs Outdated Show resolved Hide resolved
crates/core/src/contracts/contract_account.rs Show resolved Hide resolved
Copy link
Member

@Eikix Eikix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be an overall integration test for this feature? Using the testsequencer flow

@ftupas
Copy link
Contributor Author

ftupas commented Sep 13, 2023

Should there be an overall integration test for this feature? Using the testsequencer flow

Yeah here we are testing for contract account and added the nonce test here for eoa 🤙

Copy link
Member

@Eikix Eikix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question

crates/core/src/client/mod.rs Outdated Show resolved Hide resolved
Eikix
Eikix previously approved these changes Sep 14, 2023
Copy link
Member

@Eikix Eikix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 🫡🫡🙏

Copy link
Member

@Eikix Eikix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Eikix Eikix added this pull request to the merge queue Sep 15, 2023
Merged via the queue into kkrt-labs:main with commit 388f807 Sep 15, 2023
9 checks passed
anukkrit149 pushed a commit to karnotxyz/kakarot-rpc that referenced this pull request Aug 9, 2024
<!--- 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: 0,5 days 

## 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)
- [x] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?
In the fuction by codelane there is unecessary code.

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

Resolves  kkrt-labs#513

## What is the new behavior?

<!-- Please describe the behavior or changes that are being added by
this PR. -->
Suppression of alloc locals from the body 

-
-
-

## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: update nonce to return managed nonce for contract accounts
4 participants