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

flashbots: bundle API and mev-geth integration #24

Merged
merged 9 commits into from
May 18, 2023

Conversation

shampoobera
Copy link

@shampoobera shampoobera commented May 17, 2023

add BundleAPI and various other mev-geth functionality into polaris-geth for future Flashbots and Skip integration

@shampoobera shampoobera requested a review from calbera May 17, 2023 19:02
@shampoobera
Copy link
Author

One sec fixing something

@@ -99,7 +99,7 @@ type Backend interface {
ServiceFilter(ctx context.Context, session *bloombits.MatcherSession)
}

func GetAPIs(apiBackend Backend) []rpc.API {
func GetAPIs(apiBackend Backend, chain *core.BlockChain) []rpc.API {
Copy link

Choose a reason for hiding this comment

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

hard type, would make unusable for Polaris because we dont use/have the *core.BlockChain object

Copy link
Author

Choose a reason for hiding this comment

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

why would they even use the hard type when ChainContext works just fine

les/client.go Outdated Show resolved Hide resolved
core/state/statedb.go Outdated Show resolved Hide resolved
core/state/statedb.go Outdated Show resolved Hide resolved
core/state/statedb.go Outdated Show resolved Hide resolved
@itsdevbear
Copy link
Member

lgtm utack

@calbera
Copy link

calbera commented May 18, 2023

gonna make some cleanup changes first

@shampoobera shampoobera changed the title Bundle support flashbots: bundle API and mev-geth integration May 18, 2023
@calbera
Copy link

calbera commented May 18, 2023

Is it true we should force NoBaseFee to be true only during bundleEstimateGas and not during bundleCall? @shampoobera @itsdevbear

@itsdevbear
Copy link
Member

mirror whatever flashbots has

@shampoobera shampoobera merged commit 8e46b86 into stateful-v1.11.4 May 18, 2023
shampoobera pushed a commit that referenced this pull request May 30, 2023
# This is the 1st commit message:

params: release Geth v1.11.2

# This is the commit message #2:

stateful

# This is the commit message #3:

use PrecompileExecutor

# This is the commit message #4:

use host terminology

# This is the commit message #5:

return precompiledContract and bool

# This is the commit message #6:

use ctx in Run instead of statedb

# This is the commit message #7:

change to ph

# This is the commit message #8:

bing bong

# This is the commit message #9:

rename to runner

# This is the commit message #10:

rename constructor

# This is the commit message #11:

new precompile function types

# This is the commit message #12:

precompile controller

# This is the commit message #13:

make PrecompileController public

# This is the commit message #14:

ctx setter

# This is the commit message #15:

add statedb in contract.Run

# This is the commit message #16:

use Prepare on controller

# This is the commit message #17:

prepare for state transition

# This is the commit message #18:

contract has registry key

# This is the commit message #19:

has and get

# This is the commit message #20:

controller > manager

# This is the commit message #21:

with statedb

# This is the commit message #22:

with ctx

# This is the commit message #23:

simple precompile manager

# This is the commit message #24:

allow setting block context to evm

# This is the commit message #25:

remove unneded evm funcs

# This is the commit message #26:

simplify precompile manager

# This is the commit message #27:

updated go.sum

# This is the commit message #28:

removing extra bits

# This is the commit message #29:

typo fixes

# This is the commit message #30:

ethapi

# This is the commit message #31:

cleanup precomp manager

# This is the commit message #32:

add get chain id

# This is the commit message #33:

make access list public

# This is the commit message #34:

make access list struct public

# This is the commit message #35:

fix typos

# This is the commit message #36:

ethpub

# This is the commit message #37:

use the StateDB interface in the API

# This is the commit message ethereum#38:

make compatible

# This is the commit message ethereum#39:

fixed merge conflicts

# This is the commit message ethereum#40:

remove unecessary vm imports

# This is the commit message ethereum#41:

add signature to signer interface

# This is the commit message ethereum#42:

params: begin v.1.11.3 release cycle

# This is the commit message ethereum#43:

log: improve documentation (ethereum#26753)

Add usage examples
# This is the commit message ethereum#44:

core/rawdb, node: use standalone flock dependency (ethereum#26633)


# This is the commit message ethereum#45:

eth: use the last announced finalized block as the sync ancient limit (ethereum#26685)


# This is the commit message ethereum#46:

ci: disable coverage reporting in appveyor and travis

# This is the commit message ethereum#47:

cmd/devp2p: faster crawling + less verbose dns updates (ethereum#26697)

This improves the speed of DHT crawling by using concurrent requests.
It also removes logging of individual DNS updates.

# This is the commit message ethereum#48:

eth/tracers: add native flatCallTracer (aka parity style tracer) (ethereum#26377)

Adds support for a native call tracer with the Parity format, which outputs call frames
in a flat array. This tracer accepts the following options:

- `convertParityErrors: true` will convert error messages to match those of Parity
- `includePrecompiles: true` will report all calls to precompiles. The default
  matches Parity's behavior where CALL and STATICCALLs to precompiles are excluded

Incompatibilities with Parity include:

- Parity removes the result object in case of failure. This behavior is maintained
  with the exception of reverts. Revert output usually contains useful information,
  i.e. Solidity revert reason.
- The `gasUsed` field accounts for intrinsic gas (e.g. 21000 for simple transfers)
  and refunds unlike Parity
- Block rewards are not reported

Co-authored-by: Sina Mahmoodi <[email protected]>
# This is the commit message ethereum#49:

core: improve withdrawal index assignment in GenerateChain (ethereum#26756)

This fixes an issue where the withdrawal index was not calculated correctly
for multiple withdrawals in a single block.

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Felix Lange <[email protected]>
# This is the commit message ethereum#50:

ethdb/pebble: fix range compaction (ethereum#26771)

* ethdb/pebble: fix range compaction

* ethdb/pebble: add comment
# This is the commit message ethereum#51:

ethdb/pebble: fix max memorytable size (ethereum#26776)


# This is the commit message ethereum#52:

ethclient: include withdrawals in ethclient block responses (ethereum#26778)

* include withdrawals in ethclient responses

* omit empty withdrawals array in json serialization
calbera added a commit that referenced this pull request May 30, 2023
* stateful

* use PrecompileExecutor

* use host terminology

* return precompiledContract and bool

* use ctx in Run instead of statedb

* change to ph

* bing bong

* rename to runner

* rename constructor

* new precompile function types

* precompile controller

* make PrecompileController public

* ctx setter

* add statedb in contract.Run

* use Prepare on controller

* prepare for state transition

* contract has registry key

* has and get

* controller > manager

* with statedb

* with ctx

* simple precompile manager

* allow setting block context to evm

* remove unneded evm funcs

* simplify precompile manager

* updated go.sum

* removing extra bits

* typo fixes

* ethapi

* cleanup precomp manager

* add get chain id

* make access list public

* make access list struct public

* fix typos

* ethpub

* use the StateDB interface in the API

* make compatible

* fixed merge conflicts

* remove unecessary vm imports

* add signature to signer interface

* resolve more

* get all tests passing

* remove code check for precompiles

* setup

* disabling m.txsub check (#17)

* disabling check

* added todo

* enableeeeeee

* Disable event check (#18)



* fn comment

* removing txsSub reference everywhere (#19)

* txsSub removed all ref

* use GetEVM for tracing txs

* check wrapped errors for execution revert

* fix fuzz test compile

* remove unneeded print line

* check statedb errors

* revert #17, #18, #19

* use precompile manager for active precompiles list

* cleanup

* get-block-context

* fix read only flag for callcode

* apply tx with evm

* flashbots: bundle API and mev-geth integration (#24)

* Prepare for tx

* added support for bundles

* remove useless Prepare function

* core.ChainConfig instead of *core.BlockChain for BundleAPI

* remove PrepareForTx

* ApplyTransactionWithEVMWithResult(...) in CallBundle(...)

* removed useless param

* cleanup

---------

Co-authored-by: Cal Bera <[email protected]>

* match applyTransaction function signatures

* allow reuse of blockhash

* graphql registrable

* register filter

---------

Co-authored-by: Devon Bear <[email protected]>
Co-authored-by: t12s <[email protected]>
Co-authored-by: t12s <[email protected]>
Co-authored-by: Never_Defined <[email protected]>
Co-authored-by: shampoobera <[email protected]>
calbera added a commit that referenced this pull request May 30, 2023
* stateful

* use PrecompileExecutor

* use host terminology

* return precompiledContract and bool

* use ctx in Run instead of statedb

* change to ph

* bing bong

* rename to runner

* rename constructor

* new precompile function types

* precompile controller

* make PrecompileController public

* ctx setter

* add statedb in contract.Run

* use Prepare on controller

* prepare for state transition

* contract has registry key

* has and get

* controller > manager

* with statedb

* with ctx

* simple precompile manager

* allow setting block context to evm

* remove unneded evm funcs

* simplify precompile manager

* updated go.sum

* removing extra bits

* typo fixes

* ethapi

* cleanup precomp manager

* add get chain id

* make access list public

* make access list struct public

* fix typos

* ethpub

* use the StateDB interface in the API

* make compatible

* fixed merge conflicts

* remove unecessary vm imports

* add signature to signer interface

* resolve more

* get all tests passing

* remove code check for precompiles

* setup

* disabling m.txsub check (#17)

* disabling check

* added todo

* enableeeeeee

* Disable event check (#18)

* fn comment

* removing txsSub reference everywhere (#19)

* txsSub removed all ref

* use GetEVM for tracing txs

* check wrapped errors for execution revert

* fix fuzz test compile

* remove unneeded print line

* check statedb errors

* revert #17, #18, #19

* use precompile manager for active precompiles list

* cleanup

* get-block-context

* fix read only flag for callcode

* apply tx with evm

* flashbots: bundle API and mev-geth integration (#24)

* Prepare for tx

* added support for bundles

* remove useless Prepare function

* core.ChainConfig instead of *core.BlockChain for BundleAPI

* remove PrepareForTx

* ApplyTransactionWithEVMWithResult(...) in CallBundle(...)

* removed useless param

* cleanup

---------

Co-authored-by: Cal Bera <[email protected]>

* match applyTransaction function signatures

* allow reuse of blockhash

* graphql registrable

* register filter

---------

Co-authored-by: Devon Bear <[email protected]>
Co-authored-by: t12s <[email protected]>
Co-authored-by: t12s <[email protected]>
Co-authored-by: Never_Defined <[email protected]>
Co-authored-by: shampoobera <[email protected]>
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