Context
#11578 introduced ArrayPoolList<byte> as the carrier for eth_signTransaction's raw field, eliminating two heap allocations per call.
The serialize-only ArrayPoolListByteHexConverter is now globally registered in EthereumJsonSerializer, so any RPC type can use ArrayPoolList<byte> without per-property attributes.
This follow-up extends the pattern to:
- Request-side deserialization
- The other "raw bytes" RPC results that still allocate
byte[]
Scope
1. Support reads in ArrayPoolListByteHexConverter
Today, Read throws NotSupportedException.
Implement it so RPC request parameters can also be ArrayPoolList<byte>, allowing us to skip the per-call byte[] allocation currently performed by ByteArrayConverter.
Requirements
- Parse hex directly into a pool-rented buffer.
- No intermediate
byte[] allocation.
- Otherwise, this becomes strictly worse than the existing path.
- Document the lifecycle contract:
- The caller (the RPC method body) owns disposal of the returned
ArrayPoolList<byte>.
2. Convert other raw-bytes RPC results
Audit and switch the following from byte[] (or ResultWrapper<byte[]>) to ArrayPoolList<byte>, applying the same disposal-chain pattern as SignTransactionResult:
#11587 (comment)
#11587 (comment)
#11587 (comment)
Context
#11578 introduced
ArrayPoolList<byte>as the carrier foreth_signTransaction'srawfield, eliminating two heap allocations per call.The serialize-only
ArrayPoolListByteHexConverteris now globally registered inEthereumJsonSerializer, so any RPC type can useArrayPoolList<byte>without per-property attributes.This follow-up extends the pattern to:
byte[]Scope
1. Support reads in
ArrayPoolListByteHexConverterToday,
ReadthrowsNotSupportedException.Implement it so RPC request parameters can also be
ArrayPoolList<byte>, allowing us to skip the per-callbyte[]allocation currently performed byByteArrayConverter.Requirements
byte[]allocation.ArrayPoolList<byte>.2. Convert other raw-bytes RPC results
Audit and switch the following from
byte[](orResultWrapper<byte[]>) toArrayPoolList<byte>, applying the same disposal-chain pattern asSignTransactionResult:debug_getRawBlockdebug_getRawHeaderdebug_getRawReceiptsdebug_getRawTransactiondebug_getRawTransactionByHash(if separate)eth_getRawTransactionByHasheth_getRawTransactionByBlockHashAndIndexeth_getRawTransactionByBlockNumberAndIndexbyte[]-returning RPC method discovered during the audit#11587 (comment)
#11587 (comment)
#11587 (comment)