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

4844 batch posting support #2095

Merged
merged 14 commits into from
Jan 24, 2024
Merged

4844 batch posting support #2095

merged 14 commits into from
Jan 24, 2024

Conversation

PlasmaPower
Copy link
Collaborator

@PlasmaPower PlasmaPower commented Jan 23, 2024

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.

@cla-bot cla-bot bot added the s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA. label Jan 23, 2024
Base automatically changed from 4844-consensus to 4844-inbox-reader January 23, 2024 20:13
Copy link
Member

@Tristan-Wilson Tristan-Wilson left a 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{
Copy link
Member

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 {
Copy link
Collaborator Author

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,
Copy link
Member

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.

Copy link
Collaborator Author

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).

@PlasmaPower PlasmaPower merged commit 5e87053 into 4844-inbox-reader Jan 24, 2024
6 of 7 checks passed
@PlasmaPower PlasmaPower deleted the 4844-batch-posting branch January 24, 2024 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants