Fix/rlp v2 audit followups - #472
Conversation
|
tests failing with:
|
Fixed @rem1niscence |
rem1niscence
left a comment
There was a problem hiding this comment.
Although most of the review was focused on understanding the PR itself and styling issues as I lack the full implementation details to correct on logic. This seems pretty complete and throroughly tested. Just left a few questions to confirm behavior
| } | ||
| defer c.Mempool.L.Unlock() | ||
| for _, result := range c.Mempool.cachedResults { | ||
| if result == nil || result.Transaction == nil || result.Transaction.Memo != fsm.RLPV2Indicator || |
There was a problem hiding this comment.
As the pending nonce is somewhat dependant on the mempool cache, is it expected that if an user is connected to a canopy node (A) of X chain to process eth txs and for whatever reason goes to a different node (B) to perform txs, if it returns back to the first node (A) those transactions will fail due to a lower nonce err?
There was a problem hiding this comment.
Yes, this is expected and how ethereum behaves
|
|
||
| const ( | ||
| CurrentProtocolVersion = 1 | ||
| CurrentProtocolVersion = 2 |
There was a problem hiding this comment.
safe to assume that a protocol bump must be done right after merging this?
There was a problem hiding this comment.
A protocol bump doesn't need to be done immediately - this is in preparation if we do submit the protocol change transaction
What this does
This adds RLP.V2 transactions with account-based nonce protection for Ethereum wallets.
RLP.V2 stores the signed nonce directly on the Canopy transaction and advances a nonce floor on the sender’s account after execution. The nonce does not need to be consecutive: committing nonce
Ninvalidates that nonce and everything below it.Legacy RLP and RLP.V2 use different Ethereum chain ID domains, so a signature for one cannot be reused as the other. Legacy decoding remains available for replaying historical blocks, while new legacy transactions are disabled at protocol version 2.
Ethereum RPC changes
eth_sendRawTransactionnow creates RLP.V2 transactions.eth_getTransactionCountreads the committed account nonce and includes local pending transactions for"pending".eth_feeHistoryandeth_maxPriorityFeePerGasfor wallet compatibility.Follow-up fixes
This also includes the issues found during review:
uint64multiplication overflow.10; plugin-specific transaction fields are safe from field25onward.The Go, Python, TypeScript, Kotlin, and C# plugin schemas were updated together.
Rollout
Validators and configured plugins need to be upgraded together before RLP.V2 submissions begin. No account migration or nonce backfill is required.
RLP.V2 submission or replay during the transition window is an accepted rollout assumption.