Skip to content

builder: implement BEP322 builder-api#7

Merged
irrun merged 6 commits intodevelopfrom
BEP-322
Mar 13, 2024
Merged

builder: implement BEP322 builder-api#7
irrun merged 6 commits intodevelopfrom
BEP-322

Conversation

@pythonberg1997
Copy link
Copy Markdown

@pythonberg1997 pythonberg1997 commented Jan 22, 2024

Description

This pr is to implement the BEP322 builder-api.

This project represents a minimal implementation of the protocol and is provided as is. We make no guarantees regarding its functionality or security.

See also: bnb-chain/BEPs#322

Rationale

tell us why we need these changes...

Example

add an example CLI or API response...

Changes

Notable changes:

  • implement BEP322 builder-api


// AddBundle should add the given bundle to the pool.
AddBundle(bundle *types.Bundle) error

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

sorry, the two interface here seems useless

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

func (b *EthAPIBackend) SendBundle(ctx context.Context, bundle *types.Bundle) error {
	return b.eth.txPool.AddBundle(bundle)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

seems useless, the caller does not from interface, I'll remove it

return e.Code
}

func (s *IssueAPI) ReportIssue(ctx context.Context, args IssueArgs) error {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In most case, issue is bid about, tx error or gas error whatever. If mev is not runnig, sendBid would directly return err

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

so I'll delete this API

miner/bidder.go Outdated
case work := <-b.newBidCh:
if work.header.Number.Int64() > currentHeight {
bidNum = 0
bidUntil = time.Unix(int64(work.header.Time+b.chain.Config().Parlia.Period-b.config.DelayLeftOver), 0)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

worker.header.Time has already added period

* consesus: add a interface to set validator at runtime
* core/txpool: add bundlepool to maintain bundle txs
* core/type: define bundle
* internal/ethapi: add sendBundle, bundlePrice, unregis
* ethclient: add SendBundle
* miner: add fillTransacitonsAndBundles, add Bidder to sendBid to validators
* add README.builder.md
@irrun irrun merged commit 884dad6 into develop Mar 13, 2024
@irrun irrun deleted the BEP-322 branch March 13, 2024 09:06
irrun added a commit that referenced this pull request Apr 1, 2024
* feat: mev-builder

* consesus: add a interface to set validator at runtime
* core/txpool: add bundlepool to maintain bundle txs
* core/type: define bundle
* internal/ethapi: add sendBundle, bundlePrice, unregis
* ethclient: add SendBundle
* miner: add fillTransacitonsAndBundles, add Bidder to sendBid to validators
* add README.builder.md
---------

Co-authored-by: raina <irunert@gmail.com>
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.

3 participants