-
Notifications
You must be signed in to change notification settings - Fork 21.6k
core/txpool/blobpool: migrate billy to new slot size #31966
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
core/txpool/blobpool: migrate billy to new slot size #31966
Conversation
2503da0 to
7539ab9
Compare
core/txpool/blobpool/blobpool.go
Outdated
| // txBlobOverhead is an approximation of the overhead that an additional blob | ||
| // has on transaction size. This is added to the slotter to avoid | ||
| // tiny overflows causing all txs to move a shelf higher, wasting disk space. | ||
| txBlobOverhead = 2048 |
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.
Just curious, is this a cautious estimate or based on a specific computation?
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.
This is an estimation based on specific computation :D
I computed the size of a bunch of blob transactions and found that the overhead is ~1300 bytes iirc. So 2048 kinda gives us a round estimate over that
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.
I think we should update this value.
The size of original proof is 48 bytes, while the new version cell proof is 128 * 48 = 6144, already beyond this constant.
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.
Okay I bumped it to 6144, plus 64 of wiggle room.
core/txpool/blobpool/blobpool.go
Outdated
| if p.chain.Config().IsOsaka(head.Number, head.Time) { | ||
| // Check if we need to migrate our blob db to the new slotter | ||
| oldSlotSize := 135168 | ||
| if os.Stat(filepath.Join(queuedir, fmt.Sprintf("bkt_%08d.bag", oldSlotSize))); err == 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.
These seems to be taking advantage of billy internals -- can we just open the db and use Infos() to get the current slot size?
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.
We could, but that would mean we need to open the DB. I agree that this is not a super clean solution...
|
@MariusVanDerWijden let me know what you think about this last commit. I think the best thing to do is probably make a PR to billy to improve the migration flow, but given the current interface it seems like this is the best we can do downstream without hard coding any billy-specific behavior. |
e561a53 to
83a27ca
Compare
76146a5 to
90502a0
Compare
|
Okay I have updated the PR with a conversion step to convert v0 sidecars to v1 on startup. However, I wonder how useful this is since the code only runs on start up after Osaka has passed. So by the time this runs, I would guess most of the blobs actually do not have v0 sidecars. @rjl493456442 since you made the initial comment, wdyt? Some other approaches we could take:
Right now I'm leaning towards 2). |
3b3805f to
ebb2a43
Compare
Co-authored-by: lightclient <[email protected]>
2275e46 to
38ed51c
Compare
|
Updated in line with 2) as we discussed. |
|
LGTM |
|
As a consequence of moving blob sidecar version migration code around, we ended up building blocks with a mix of v0 and v1 blob transactions (different proof encoding in the sidecar). This PR makes sure we are not building illegal blocks after Osaka. Blob migration is left for another PR. Related issues and PRs: - #31791 - #32347 - #31966 - #32235 --------- Signed-off-by: Csaba Kiraly <[email protected]>
…32577) As a consequence of moving blob sidecar version migration code around, we ended up building blocks with a mix of v0 and v1 blob transactions (different proof encoding in the sidecar). This PR makes sure we are not building illegal blocks after Osaka. Blob migration is left for another PR. Related issues and PRs: - ethereum#31791 - ethereum#32347 - ethereum#31966 - ethereum#32235 --------- Signed-off-by: Csaba Kiraly <[email protected]>
Implements a migration path for the blobpool slotter --------- Co-authored-by: lightclient <[email protected]> Co-authored-by: lightclient <[email protected]> Co-authored-by: Gary Rong <[email protected]>
Implements a migration path for the blobpool slotter --------- Co-authored-by: lightclient <[email protected]> Co-authored-by: lightclient <[email protected]> Co-authored-by: Gary Rong <[email protected]>
Implements a migration path for the blobpool slotter