kona: preserve span-batch transaction type prefixes#21808
Conversation
|
The
It does not cause legacy encoding to emit a The problem is that the macro also uses the same
Under EIP-2718, a leading byte in There is also strong historical evidence that this was an accidental semantic change. Before commit OpTxType::Legacy => {
Err(alloy_rlp::Error::Custom("type-0 eip2718 transactions are not supported").into())
}After the derive conversion, The root Alloy fix would be an explicit legacy form, for example: #[envelope(legacy)]
Legacy(Signed<TxLegacy>)That could retain
So |
|
This makes sense. Proposing additional improvements at #21850 |
Summary
0x00so the downstream typed decoder rejects it instead of reinterpreting the payload as a prefixless legacy transaction[00 c3 80 80 80]Root cause
Kona inferred prefix presence from the logical
OpTxType. Because legacy is represented as0, a physically present0x00was consumed and then dropped. That allowed the following valid legacy payload to be accepted as a prefixless legacy transaction.Follow-up
Update Alloy's
TransactionEnvelopederive macro to model legacy explicitly (for example,#[envelope(legacy)]). This can preserveLegacy = 0for metadata and RPC while makingtyped_decode(0, ...)reject the reserved EIP-2718 value.Validation
cargo nextest run -p kona-protocol --features std test_read_tx_datacargo check -p kona-protocol --no-default-featuresgo test ./op-node/rollup/derive -run 'TestSpanBatchReadTxData(LeadingZero|Invalid|$)' -count=1