-
Notifications
You must be signed in to change notification settings - Fork 255
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
[Bug] SidecarBuilder fails to encode anything bigger than 1 blob of data #1388
Comments
@prestwich I'm not that familiar with this but the issue appears to be that ingest first pre allocates a second blob: alloy/crates/eips/src/eip4844/builder.rs Lines 355 to 358 in 754431d
but only ever fills the last blob: alloy/crates/eips/src/eip4844/builder.rs Line 101 in 754431d
|
@mattsse I ran into same problem. Here's a minimal example to reproduce and let you play around with the boundary payload sizes that are causing problems. // [dependencies]
// alloy = { version = "0.8.3", features = ["consensus", "kzg"] }
use alloy::consensus::{SidecarBuilder, SidecarCoder, SimpleCoder};
fn main() {
// let data1 = vec![0xff; 124 * 1024 - 30]; // x2 blobs err
// let data1 = vec![0xff; 124 * 1024 - 31]; // x1 blobs err
// let data1 = vec![0xff; 124 * 1024 - 60]; // x1 blobs err
let data1 = vec![0xff; 124 * 1024 - 61]; // x1 blobs err
// let data1 = vec![0xff; 124 * 1024 - 62]; // x1 blobs ok
let blob_sidecar = SidecarBuilder::<SimpleCoder>::from_slice(&data1)
.build()
.expect("failed to encode blobs");
let mut coder = SimpleCoder::default();
let data2 = coder
.decode_all(&blob_sidecar.blobs)
.expect("failed to decode blobs")
.concat();
assert_eq!(data1, data2);
} |
Component
consensus, eips, genesis
What version of Alloy are you on?
├── alloy v0.3.6 │ ├── alloy-consensus v0.3.6 │ │ ├── alloy-eips v0.3.6 │ │ │ ├── alloy-eip2930 v0.1.0 │ │ │ │ ├── alloy-primitives v0.8.5 │ │ │ │ │ ├── alloy-rlp v0.3.8 │ │ │ │ │ │ ├── alloy-rlp-derive v0.3.8 (proc-macro) │ │ │ │ │ │ ├── alloy-rlp v0.3.8 () │ │ │ │ ├── alloy-rlp v0.3.8 () │ │ │ ├── alloy-eip7702 v0.1.0 │ │ │ │ ├── alloy-primitives v0.8.5 () │ │ │ │ ├── alloy-rlp v0.3.8 () │ │ │ ├── alloy-primitives v0.8.5 () │ │ │ ├── alloy-rlp v0.3.8 () │ │ │ ├── alloy-serde v0.3.6 │ │ │ │ ├── alloy-primitives v0.8.5 () │ │ ├── alloy-primitives v0.8.5 () │ │ ├── alloy-rlp v0.3.8 () │ │ ├── alloy-serde v0.3.6 () │ ├── alloy-contract v0.3.6 │ │ ├── alloy-dyn-abi v0.8.5 │ │ │ ├── alloy-json-abi v0.8.5 │ │ │ │ ├── alloy-primitives v0.8.5 () │ │ │ │ ├── alloy-sol-type-parser v0.8.5 │ │ │ ├── alloy-primitives v0.8.5 () │ │ │ ├── alloy-sol-type-parser v0.8.5 () │ │ │ ├── alloy-sol-types v0.8.5 │ │ │ │ ├── alloy-json-abi v0.8.5 () │ │ │ │ ├── alloy-primitives v0.8.5 () │ │ │ │ ├── alloy-sol-macro v0.8.5 (proc-macro) │ │ │ │ │ ├── alloy-sol-macro-expander v0.8.5 │ │ │ │ │ │ ├── alloy-json-abi v0.8.5 │ │ │ │ │ │ │ ├── alloy-primitives v0.8.5 │ │ │ │ │ │ │ ├── alloy-sol-type-parser v0.8.5 │ │ │ │ │ │ ├── alloy-sol-macro-input v0.8.5 │ │ │ │ │ │ │ ├── alloy-json-abi v0.8.5 () │ │ │ │ │ ├── alloy-sol-macro-input v0.8.5 () │ │ ├── alloy-json-abi v0.8.5 () │ │ ├── alloy-network v0.3.6 │ │ │ ├── alloy-consensus v0.3.6 () │ │ │ ├── alloy-eips v0.3.6 () │ │ │ ├── alloy-json-rpc v0.3.6 │ │ │ │ ├── alloy-primitives v0.8.5 () │ │ │ │ ├── alloy-sol-types v0.8.5 () │ │ │ ├── alloy-network-primitives v0.3.6 │ │ │ │ ├── alloy-eips v0.3.6 () │ │ │ │ ├── alloy-primitives v0.8.5 () │ │ │ │ ├── alloy-serde v0.3.6 () │ │ │ ├── alloy-primitives v0.8.5 () │ │ │ ├── alloy-rpc-types-eth v0.3.6 │ │ │ │ ├── alloy-consensus v0.3.6 () │ │ │ │ ├── alloy-eips v0.3.6 () │ │ │ │ ├── alloy-network-primitives v0.3.6 () │ │ │ │ ├── alloy-primitives v0.8.5 () │ │ │ │ ├── alloy-rlp v0.3.8 () │ │ │ │ ├── alloy-serde v0.3.6 () │ │ │ │ ├── alloy-sol-types v0.8.5 () │ │ │ ├── alloy-serde v0.3.6 () │ │ │ ├── alloy-signer v0.3.6 │ │ │ │ ├── alloy-primitives v0.8.5 () │ │ │ ├── alloy-sol-types v0.8.5 () │ │ ├── alloy-network-primitives v0.3.6 () │ │ ├── alloy-primitives v0.8.5 () │ │ ├── alloy-provider v0.3.6 │ │ │ ├── alloy-chains v0.1.34 │ │ │ ├── alloy-consensus v0.3.6 () │ │ │ ├── alloy-eips v0.3.6 () │ │ │ ├── alloy-json-rpc v0.3.6 () │ │ │ ├── alloy-network v0.3.6 () │ │ │ ├── alloy-network-primitives v0.3.6 () │ │ │ ├── alloy-primitives v0.8.5 () │ │ │ ├── alloy-pubsub v0.3.6 │ │ │ │ ├── alloy-json-rpc v0.3.6 () │ │ │ │ ├── alloy-primitives v0.8.5 () │ │ │ │ ├── alloy-transport v0.3.6 │ │ │ │ │ ├── alloy-json-rpc v0.3.6 () │ │ │ ├── alloy-rpc-client v0.3.6 │ │ │ │ ├── alloy-json-rpc v0.3.6 () │ │ │ │ ├── alloy-primitives v0.8.5 () │ │ │ │ ├── alloy-pubsub v0.3.6 () │ │ │ │ ├── alloy-transport v0.3.6 () │ │ │ │ ├── alloy-transport-http v0.3.6 │ │ │ │ │ ├── alloy-json-rpc v0.3.6 () │ │ │ │ │ ├── alloy-transport v0.3.6 () │ │ │ │ ├── alloy-transport-ipc v0.3.6 │ │ │ │ │ ├── alloy-json-rpc v0.3.6 () │ │ │ │ │ ├── alloy-pubsub v0.3.6 () │ │ │ │ │ ├── alloy-transport v0.3.6 () │ │ │ │ ├── alloy-transport-ws v0.3.6 │ │ │ │ │ ├── alloy-pubsub v0.3.6 () │ │ │ │ │ ├── alloy-transport v0.3.6 () │ │ │ ├── alloy-rpc-types-eth v0.3.6 () │ │ │ ├── alloy-transport v0.3.6 () │ │ │ ├── alloy-transport-http v0.3.6 () │ │ │ ├── alloy-transport-ipc v0.3.6 () │ │ │ ├── alloy-transport-ws v0.3.6 () │ │ ├── alloy-pubsub v0.3.6 () │ │ ├── alloy-rpc-types-eth v0.3.6 () │ │ ├── alloy-sol-types v0.8.5 () │ │ ├── alloy-transport v0.3.6 () │ ├── alloy-core v0.8.5 │ │ ├── alloy-dyn-abi v0.8.5 () │ │ ├── alloy-json-abi v0.8.5 () │ │ ├── alloy-primitives v0.8.5 () │ │ └── alloy-sol-types v0.8.5 () │ ├── alloy-eips v0.3.6 () │ ├── alloy-network v0.3.6 () │ ├── alloy-provider v0.3.6 () │ ├── alloy-pubsub v0.3.6 () │ ├── alloy-rpc-client v0.3.6 () │ ├── alloy-rpc-types v0.3.6 │ │ ├── alloy-rpc-types-eth v0.3.6 () │ │ ├── alloy-serde v0.3.6 () │ ├── alloy-signer v0.3.6 () │ ├── alloy-signer-local v0.3.6 │ │ ├── alloy-consensus v0.3.6 () │ │ ├── alloy-network v0.3.6 () │ │ ├── alloy-primitives v0.8.5 () │ │ ├── alloy-signer v0.3.6 () │ ├── alloy-transport v0.3.6 () │ ├── alloy-transport-http v0.3.6 () │ ├── alloy-transport-ipc v0.3.6 () │ └── alloy-transport-ws v0.3.6 (*)
Operating System
Linux
Describe the bug
I've noticed that all of my blob transactions have data only in the last blob, while the preceding ones are filled with 0s.
Upon closer inspection it turns out that the
SidecarBuilder
behaves weirdly once you approach the 1 blob boundary.Reproduction:
I think this might be happening due to the way
SidecarBuilder
is allocating and giving blobs to the underlying coder:preallocation of empty blobs
this makes sure that for the last example there are two blobs which the coder can fill.
The issue (probably) is due to the coder asking for the current blob and that is always the last blob that the builder preallocated.
What ends up happening is that out of all of the preallocated blobs only the last one is filled.
Since the docstring says this should be used for large amounts of data;
these issues caught me by surprise.
Giving the input data byte by byte to the builder solves the issues (but is inefficient, goes without saying)Nope, byte-by-byte doesn't solve it, just pushes the limit to 256000B where we again get
None
fromdecode_all
.The text was updated successfully, but these errors were encountered: