feat(gas-keys): rosetta, prefetcher, mirror support for DelegateV2 (3/3)#15906
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #15906 +/- ##
==========================================
+ Coverage 69.78% 69.80% +0.02%
==========================================
Files 946 946
Lines 203610 203752 +142
Branches 203610 203752 +142
==========================================
+ Hits 142095 142238 +143
+ Misses 56741 56740 -1
Partials 4774 4774
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c0cbec3 to
0f1bac4
Compare
0b2c394 to
f3581f1
Compare
49ab67e to
aa2633c
Compare
f3581f1 to
620ffac
Compare
aa2633c to
c617409
Compare
There was a problem hiding this comment.
Pull request overview
This PR completes the “gas-keys / DelegateV2” integration across Rosetta, the runtime trie prefetcher, and the mirror tool, ensuring DelegateV2 actions (including gas-key nonce indexing) round-trip correctly and are handled consistently across these subsystems.
Changes:
- Rosetta: carries
DelegateV2gas-keynonce_indexthrough operation metadata and reconstructsDelegateV2when present (with a bijection test). - Runtime prefetcher: adds deterministic prefetching for the gas-key per-index nonce row for
DelegateV2during receipt processing. - Mirror: maps and re-signs
DelegateV2actions while preserving the versioned nonce semantics via shared delegate mapping logic.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/mirror/src/genesis.rs | Adds DelegateV2 mapping/re-signing support and factors remapping into a shared map_delegate_action helper. |
| runtime/runtime/src/prefetch.rs | Prefetches DelegateV2 access keys and gas-key nonce rows when applicable. |
| chain/rosetta-rpc/src/models.rs | Extends operation metadata with nonce_index for gas-key DelegateV2 round-tripping. |
| chain/rosetta-rpc/src/adapters/validated_operations/delegate_action.rs | Threads nonce_index through delegate action operation encoding/decoding. |
| chain/rosetta-rpc/src/adapters/mod.rs | Extracts shared delegate operation building and adds DelegateV2 conversion + bijection test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c617409 to
a25dca6
Compare
620ffac to
372c515
Compare
a25dca6 to
09958f9
Compare
48ae1c3 to
ab5ebcf
Compare
09958f9 to
adba604
Compare
ab5ebcf to
ad2e760
Compare
adba604 to
1fe0ece
Compare
Adds a 2.13.0 changelog entry for the new `DelegateV2` meta-transaction action (`ProtocolFeature::DelegateV2`, protocol version 85), which lets gas keys ([NEP-611](near/NEPs#611)) sign relayed meta transactions. ([#15904](#15904), [#15905](#15905), [#15906](#15906)) Sorry I forgot this as part of the feature.
Last PR of the stack (on top of #15905).
DelegateV2's nonce index inOperationMetadata::nonce_index, so it round-trips through operations and the NEAR Actions -> Operations -> NEAR Actions bijection holds (test included). ADelegateV2with a plain nonce reconstructs as the semantically equivalent plainDelegate. The shared operation-building logic is extracted intopush_delegate_action_operations.DelegateV2actions like plainDelegateones, preserving the versioned nonce; the shared remapping moves intomap_delegate_actionoverVersionedDelegateActionRefwith a per-versionresignclosure.