Skip to content
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

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

ryanschneider
Copy link
Contributor

@ryanschneider ryanschneider commented Sep 8, 2023

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 and eth.Receipt are both updated. Note that further work will still be needed for Cancun, namely #90 and #87.

@ryanschneider ryanschneider changed the title [WIP] eth.Transaction: EIP-4844 Support feat(EIP-4844): eth.Transaction/Receipt EIP-4844 support Sep 13, 2023
@@ -29,6 +31,32 @@ func TestTransaction_FromRaw(t *testing.T) {
require.True(t, tx.IsProtected())
}

// polygon
Copy link
Contributor Author

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.

@ryanschneider ryanschneider marked this pull request as ready for review September 13, 2023 22:22
Copy link
Contributor

@antonydenyer antonydenyer left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryanschneider
Copy link
Contributor Author

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

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!

@ryanschneider ryanschneider merged commit 35c5654 into master Sep 21, 2023
1 check passed
@ryanschneider ryanschneider deleted the blob-tx-4844 branch September 21, 2023 15:48
metachris pushed a commit to flashbots/mempool-dumpster that referenced this pull request Jun 24, 2024
…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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eth.Transaction: EIP-4844 Blob Txs (type 0x3)
2 participants