-
Notifications
You must be signed in to change notification settings - Fork 468
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
4844 batch posting support #2095
Conversation
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.
LGTM
To: to, | ||
Value: value256, | ||
Data: calldata, | ||
Sidecar: &types.BlobTxSidecar{ |
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.
Much nicer how they have the sidecar as part of the BlobTx struct now.
} | ||
var use4844 bool | ||
config := b.config() | ||
if config.Post4844Blobs && latestHeader.ExcessBlobGas != nil && latestHeader.BlobGasUsed != nil { |
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.
TODO: just in case make sure that latestHeader isn't an Arbitrum header
MaxSize: 100000, | ||
MaxSize: 100000, | ||
// TODO: is 1000 bytes an appropriate margin for error vs blob space efficiency? | ||
Max4844BatchSize: (254 * params.BlobTxFieldElementsPerBlob / 8 * (params.MaxBlobGasPerBlock / params.BlobTxBlobGasPerBlob)) - 1000, |
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.
Is there some way a batch that is (254 * params.BlobTxFieldElementsPerBlob / 8 * (params.MaxBlobGasPerBlock / params.BlobTxBlobGasPerBlob))
could expand to be bigger than (256 * params.BlobTxFieldElementsPerBlob / 8 * (params.MaxBlobGasPerBlock / params.BlobTxBlobGasPerBlob))
bytes when encoded as field elements? In any case it's probably worth being cautious about at the beginning.
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.
No, this math is based on us being able to pack 254 bits into every field element guaranteed. The 1000 byte margin of error is for compression and that we might exceed the max size we're aiming for (I'm unsure if this is still possible or it was a bug that we already fixed).
Points into #2093
Replace by fee support in this PR isn't very good, but we can fix that after we have a working MVP.