-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(EIP-4844): eth.Transaction/Receipt EIP-4844 support #92
Conversation
481fecf
to
3e1b28a
Compare
3e1b28a
to
ea03cb2
Compare
@@ -29,6 +31,32 @@ func TestTransaction_FromRaw(t *testing.T) { | |||
require.True(t, tx.IsProtected()) | |||
} | |||
|
|||
// polygon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah, didn't mean to stage this, it's an unrelated test to make sure that we can parse Polygon txs correctly, though at this point I don't see any harm in leaving it in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable.
There's a few examples in besu https://github.com/hyperledger/besu/blob/main/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionEncodingTest.java
Couldn't find anything in geth. Might be worth incorporating as a sanity check?
@@ -15,6 +15,7 @@ var ( | |||
TransactionTypeLegacy = int64(0x0) // TransactionTypeLegacy refers to pre-EIP-2718 transactions. | |||
TransactionTypeAccessList = int64(0x1) // TransactionTypeAccessList refers to EIP-2930 transactions. | |||
TransactionTypeDynamicFee = int64(0x2) // TransactionTypeDynamicFee refers to EIP-1559 transactions. | |||
TransactionTypeBlob = int64(0x3) // TransactionTypeBlob refers to EIP-4844 "blob" transactions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a point in time when the blob type was going to be 0x05
😆
Ah perfect, thanks @antonydenyer! I checked geth, Nethermind, and ethereum-js and was going to check besu and then it slipped my mind, glad to see they have some I can use, I'll do that! |
ea03cb2
to
9e026b6
Compare
…39) ## 📝 Summary This is an alternative to the `no-fwd-blobs` branch that filters blobs depending on whether or not they have the `BlobTxSidecar` available. If the sidecar is available then the blob is in the correct network representation form and can be collected and forwarded, otherwise the blob data is incomplete and shouldn't be forwarded. ``` 2024-06-21T09:17:06.111-0700 DEBUG processTx {"tx_hash": "0x82161fd324f41f29fa8fdf0720938b946b37ea7f6fa051f74305dbd384ed624d", "source": "alchemy"} 2024-06-21T09:17:06.112-0700 DEBUG error: invalid blob transaction {"tx_hash": "0x82161fd324f41f29fa8fdf0720938b946b37ea7f6fa051f74305dbd384ed624d", "source": "alchemy", "reason": "missing blob sidecar"} ``` Notably the "full" `newPendingTransactions` subscription from Alchemy and Quiknode returns the incomplete blob. This is probably an upstream `geth` bug I'll see if it's possible for the subscription to contain the sidecar. I haven't been able to test other node sources, but hopefully they return the full network representation. ## ⛱ Motivation and Context Blobs come in two forms, there's the `PoolTransactions` network representation used in the mempool, and the blobless `TransactionPayload` format used in block bodies. ## 📚 References - https://eips.ethereum.org/EIPS/eip-4844#networking - INFURA/go-ethlibs#92 --- ## ✅ I have run these commands * [x] `make lint` * [x] `make test` * [x] `go mod tidy`
Built on top of #91 so will need a rebase if that PR is ✅'d.
Fixes #89
This implements EIP-4844 "blob" transaction types as per the EIP: https://eips.ethereum.org/EIPS/eip-4844#blob-transaction
eth.Transaction
andeth.Receipt
are both updated. Note that further work will still be needed for Cancun, namely #90 and #87.