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 on bsc #2279

Merged
merged 28 commits into from
Mar 22, 2024
Merged

4844 on bsc #2279

merged 28 commits into from
Mar 22, 2024

Conversation

buddh0
Copy link
Collaborator

@buddh0 buddh0 commented Mar 13, 2024

Description

BSC will support Cancun EIPs, check out Tycho hard fork plan. Other EIPs except EIP-4844 are already supported. But the implementation of EIP-4844 will be the big one and it will be different on BSC, mainly the blob part, as Ethereum store and propagate blobs in its consensus layer, while BSC doesn't have it. BSC need to implement in execution layer.

This PR will implement the EIP-4844 on BSC, there are some docs you may refer:

Rationale

Check out the motivation part of BEP-336: https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-336.md#4-motivation

Example

NA

Changes

  • New transaction type(type: 0x3), Blob-Carrying Transaction, its definitin will be same as Ethereum.
  • New RPC APIs, mainly to support query of Blobs.
  • New blobs related storage in MainDB(level or pebble) and AncientDb.

@buddh0 buddh0 changed the title Blobtx 4844 on bsc Mar 13, 2024
@NathanBSC
Copy link
Contributor

need add logic to add the blobfee as validator income instead of burning it

core/blockchain.go Outdated Show resolved Hide resolved
core/types/block.go Outdated Show resolved Hide resolved
@buddh0
Copy link
Collaborator Author

buddh0 commented Mar 15, 2024

need add logic to add the blobfee as validator income instead of burning it

solved

core/blockchain.go Outdated Show resolved Hide resolved
zzzckck
zzzckck previously approved these changes Mar 18, 2024
Copy link
Collaborator

@zzzckck zzzckck left a comment

Choose a reason for hiding this comment

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

LGTM

internal/ethapi/api.go Outdated Show resolved Hide resolved
galaio and others added 13 commits March 21, 2024 10:07
* chainconfig: use cancun fork for BSC;
feat: fill WithdrawalsHash when BSC enable cancun fork;

* rawdb: support to CRUD blobs;
freezer: support to freeze block blobs;

* freezer: support to freeze block blobs;

* blockchain: add blob cache & blob query helper;

* blockchain: add blob cache & blob query helper;

* freezer: refactor addition table logic, add uts;

* blobexpiry: add more extra expiry time, and logs;

* ci: fix UT fails;

* fix: fix some PR review comments;

* parlia: implement IsDataAvailable function;

* blob: refactor blob transfer logic;

* blob: support config blob extra reserve;
* blob: implement min&max gas price logic;
blob: change some key parameters;

* blockchian: support import side chain;

* blobpool: reject the banned address;

* blockchain: add chasing head for DA check;

* params: update blob related config;

* blockchain: opt data available checking performance;
dataavailability: add more UTs;

* blockchain: opt data available checking performance;
dataavailability: add more UTs;

* ci: fix failed UTs;

* ci: fix failed UTs;

* params: modify blob related params;

* gasprice: support BEP-336 blob gas price calculate;

* ci: fix some broken UTs;
* ci: temp enable blobtx branch ci run;

* Switch ON blobpool & ensure Cancun hardfork can occur (#2223)

pool: switch ON blobpool+no reannotx

* feat: support blob storage & miscs; (#2229)

* chainconfig: use cancun fork for BSC;
feat: fill WithdrawalsHash when BSC enable cancun fork;

* rawdb: support to CRUD blobs;
freezer: support to freeze block blobs;

* freezer: support to freeze block blobs;

* blockchain: add blob cache & blob query helper;

* blockchain: add blob cache & blob query helper;

* freezer: refactor addition table logic, add uts;

* blobexpiry: add more extra expiry time, and logs;

* ci: fix UT fails;

* fix: fix some PR review comments;

* parlia: implement IsDataAvailable function;

* blob: refactor blob transfer logic;

* blob: support config blob extra reserve;

* blockchian: support to import block with blob & blobGasFee; (#2260)

* blob: implement min&max gas price logic;
blob: change some key parameters;

* blockchian: support import side chain;

* blobpool: reject the banned address;

* blockchain: add chasing head for DA check;

* params: update blob related config;

* blockchain: opt data available checking performance;
dataavailability: add more UTs;

* blockchain: opt data available checking performance;
dataavailability: add more UTs;

* ci: fix failed UTs;

* ci: fix failed UTs;

* params: modify blob related params;

* gasprice: support BEP-336 blob gas price calculate;

* ci: fix some broken UTs;

* fix failed check for WithdrawalsHash (#2276)

* eth: include sidecars in fitering of body

* core: refactor sidecars name

* eth: sidecars type refactor

* core: remove extra from bad merge

* eth: fix handlenewblock test after merge

---------

Co-authored-by: GalaIO <[email protected]>
Co-authored-by: buddho <[email protected]>
* internal/api: implement eth_getBlobSidecars && eth_getBlobSidecarByTxHash

* internal/api: implement eth_getBlobSidecars && eth_getBlobSidecarByTxHash

* internal/api: fix comments

* internal/api: fix comments

* internal/api: fix comments

* internal/api: fix comments
ci: fix some failed UTs;

sync: add more UTs for blob syncing;
* fix: fix some validation issues & ancient reset;

* fix: fix some UTs fails;

* fix: fix some UTs fails;
@NathanBSC
Copy link
Contributor

mev module should be adapted

* blobsidecar: add new sidecar struct with metadata;

* blobfee: add UT to check blob fee reward;

* fix: fix some UTs fails & comments;
* core: more check for validity of sidecars
core/rawdb: optimize write block with sidecars
core/rawdb: rollback interface freezeRange

* core: fix TestIsDataAvailable
rollback interface of NewFreezer
remove ci for blobtx
@buddh0 buddh0 marked this pull request as ready for review March 22, 2024 07:03
@buddh0
Copy link
Collaborator Author

buddh0 commented Mar 22, 2024

mev module should be adapted

fixed

@buddh0
Copy link
Collaborator Author

buddh0 commented Mar 22, 2024

need add logic to add the blobfee as validator income instead of burning it

solved

Copy link
Collaborator

@zzzckck zzzckck left a comment

Choose a reason for hiding this comment

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

LGTM👍

@zzzckck zzzckck merged commit 38db9bf into develop Mar 22, 2024
6 of 7 checks passed
@zzzckck zzzckck deleted the blobtx branch August 22, 2024 03:05
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.

6 participants