Skip to content

Conversation

@robin-near
Copy link
Contributor

See near/NEPs#611

This PR adds the GasKey trie key. In subsequent PRs we will introduce a new transaction type to accept gas key transactions, and to implement the gas key actions.

@robin-near robin-near requested a review from pugachAG June 9, 2025 16:18
@robin-near robin-near requested a review from a team as a code owner June 9, 2025 16:18
&key.public_key,
);
let storage_key = KeyForStateChanges::from_raw_key(block_hash, &data_key);
let changes_per_key_prefix = storage_key.find_iter(&store);
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if that is relevant, but SingleAccessKeyChanges uses find_exact_iter, maybe that is what we should use here as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good eye! But here we do not want to use find_exact_iter because the prefix includes changes to the gas key itself (i.e. balance changes) as well as any of the nonces under the gas key. This is different from the access key case where there's only one raw key.

@robin-near robin-near requested a review from frol as a code owner June 9, 2025 23:11
@codecov
Copy link

codecov bot commented Jun 9, 2025

Codecov Report

Attention: Patch coverage is 0.53908% with 369 lines in your changes missing coverage. Please review.

Project coverage is 69.27%. Comparing base (25451c8) to head (d02409b).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
core/primitives/src/trie_key.rs 0.00% 77 Missing ⚠️
core/primitives/src/types.rs 0.00% 52 Missing ⚠️
tools/fork-network/src/storage_mutator.rs 0.00% 52 Missing ⚠️
tools/fork-network/src/cli.rs 0.00% 42 Missing ⚠️
core/store/src/genesis/state_applier.rs 0.00% 30 Missing ⚠️
tools/mirror/src/genesis.rs 0.00% 27 Missing ⚠️
core/primitives/src/views.rs 0.00% 26 Missing ⚠️
chain/chain/src/store/mod.rs 0.00% 19 Missing ⚠️
core/primitives/src/state_record.rs 0.00% 18 Missing ⚠️
core/store/src/utils/mod.rs 0.00% 17 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #13687      +/-   ##
==========================================
- Coverage   69.41%   69.27%   -0.15%     
==========================================
  Files         956      956              
  Lines      184142   184513     +371     
  Branches   184142   184513     +371     
==========================================
- Hits       127830   127818      -12     
- Misses      51252    51632     +380     
- Partials     5060     5063       +3     
Flag Coverage Δ
pytests 1.38% <0.00%> (-0.01%) ⬇️
pytests-nightly 1.45% <0.00%> (-0.01%) ⬇️
unittests 68.95% <0.53%> (-0.15%) ⬇️
unittests-nightly 68.78% <0.53%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@robin-near robin-near added this pull request to the merge queue Jun 10, 2025
Merged via the queue into master with commit 706012c Jun 10, 2025
27 of 29 checks passed
@robin-near robin-near deleted the robin/gaskey branch June 10, 2025 19:56
ssavenko-near pushed a commit that referenced this pull request Jun 13, 2025
See near/NEPs#611

This PR adds the GasKey trie key. In subsequent PRs we will introduce a
new transaction type to accept gas key transactions, and to implement
the gas key actions.
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.

2 participants