-
Notifications
You must be signed in to change notification settings - Fork 4
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
builder: implement BEP322 builder-api #7
Conversation
eth/handler.go
Outdated
@@ -84,10 +83,16 @@ type txPool interface { | |||
// Add should add the given transactions to the pool. | |||
Add(txs []*txpool.Transaction, local bool, sync bool) []error | |||
|
|||
// AddBundle should add the given bundle to the pool. | |||
AddBundle(bundle *types.Bundle) error | |||
|
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.
sorry, the two interface here seems useless
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.
func (b *EthAPIBackend) SendBundle(ctx context.Context, bundle *types.Bundle) error {
return b.eth.txPool.AddBundle(bundle)
}
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.
seems useless, the caller does not from interface, I'll remove it
internal/ethapi/api_issue.go
Outdated
return e.Code | ||
} | ||
|
||
func (s *IssueAPI) ReportIssue(ctx context.Context, args IssueArgs) error { |
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.
In most case, issue is bid about, tx error or gas error whatever. If mev is not runnig, sendBid would directly return err
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.
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) |
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.
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
* 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 <[email protected]>
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: