-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There are some immediate FLUPs here 1. Replace `h4ck3rk3y/builder` with `flashbots/builder` ( pending publishing of builder) 2. Replace `h4ck3rk3y/mev-boost-relay` with `flashbots/mev-boost-relay` (pending Capella signature fix)
- Loading branch information
Showing
6 changed files
with
214 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
ADMIN_KEY = "0xef5177cd0b6b21c87db5a0bf35d4084a8a57a9d6a064f86d51ac85f2b873a4e2" | ||
USER_KEY = "0x7988b3a148716ff800414935b305436493e1f25237a2a03e5eebc343735e2f31" | ||
|
||
def launch_mev_flood(plan, image, el_uri): | ||
plan.add_service( | ||
name = "mev-flood", | ||
config = ServiceConfig( | ||
image = image, | ||
entrypoint = ["/bin/sh", "-c", "touch main.log && tail -F main.log"] | ||
) | ||
) | ||
|
||
plan.exec( | ||
service_name = "mev-flood", | ||
recipe = ExecRecipe( | ||
command = ["/bin/sh", "-c", "./run init -r {0} -k {1} -u {2} -s deployment.json".format(el_uri, ADMIN_KEY, USER_KEY)] | ||
) | ||
) | ||
|
||
def spam_in_background(plan, el_uri, mev_flood_extra_args): | ||
command = ["/bin/sh", "-c", "nohup ./run spam -r {0} -k {1} -u {2} -l deployment.json --secondsPerBundle 15 >main.log 2>&1 &".format(el_uri, ADMIN_KEY, USER_KEY)] | ||
if mev_flood_extra_args: | ||
joined_extra_args = " ".join(mev_flood_extra_args) | ||
command = ["/bin/sh", "-c", "nohup ./run spam -r {0} -k {1} -u {2} -l deployment.json --secondsPerBundle 15 {3} >main.log 2>&1 &".format(el_uri, ADMIN_KEY, USER_KEY, joined_extra_args)] | ||
plan.exec( | ||
service_name = "mev-flood", | ||
recipe = ExecRecipe( | ||
command = command | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
redis_module = import_module("github.com/kurtosis-tech/redis-package/main.star") | ||
postgres_module = import_module("github.com/kurtosis-tech/postgres-package/main.star") | ||
|
||
DUMMY_SECRET_KEY = "0x607a11b45a7219cc61a3d9c5fd08c7eebd602a6a19a977f8d3771d5711a550f2" | ||
DUMMY_PUB_KEY = "0xa55c1285d84ba83a5ad26420cd5ad3091e49c55a813eee651cd467db38a8c8e63192f47955e9376f6b42f6d190571cb5" | ||
|
||
MEV_RELAY_WEBSITE = "mev-relay-website" | ||
MEV_RELAY_ENDPOINT = "mev-relay-api" | ||
MEV_RELAY_HOUSEKEEPER = "mev-relay-housekeeper" | ||
|
||
MEV_RELAY_ENDPOINT_PORT = 9062 | ||
MEV_RELAY_WEBSITE_PORT = 9060 | ||
|
||
NETWORK_ID_TO_NAME = { | ||
"5": "goerli", | ||
"11155111": "sepolia", | ||
"3": "ropsten", | ||
} | ||
|
||
def launch_mev_relay(plan, mev_params, network_id, beacon_uris, validator_root, builder_uri): | ||
redis = redis_module.run(plan, {}) | ||
# making the password postgres as the relay expects it to be postgres | ||
postgres = postgres_module.run(plan, {"password": "postgres", "user": "postgres", "database": "postgres", "name": "postgres"}) | ||
|
||
network_name = NETWORK_ID_TO_NAME.get(network_id, network_id) | ||
|
||
image = mev_params.mev_relay_image | ||
|
||
# TODO(maybe) remove hardocded values for the forks | ||
env_vars= { | ||
"GENESIS_FORK_VERSION": "0x10000038", | ||
"BELLATRIX_FORK_VERSION": "0x30000038", | ||
"CAPELLA_FORK_VERSION": "0x40000038", | ||
"DENEB_FORK_VERSION": "0x50000038", | ||
"GENESIS_VALIDATORS_ROOT": validator_root | ||
} | ||
|
||
plan.add_service( | ||
name = MEV_RELAY_HOUSEKEEPER, | ||
config = ServiceConfig( | ||
image = image, | ||
cmd = ["housekeeper", "--network", "custom", "--db", "postgres://postgres:postgres@postgres:5432/postgres?sslmode=disable", "--redis-uri", "redis:6379", "--beacon-uris", beacon_uris] + mev_params.mev_relay_housekeeper_extra_args, | ||
env_vars= env_vars | ||
) | ||
) | ||
|
||
api = plan.add_service( | ||
name = MEV_RELAY_ENDPOINT, | ||
config = ServiceConfig( | ||
image = image, | ||
cmd = ["api", "--network", "custom", "--db", "postgres://postgres:postgres@postgres:5432/postgres?sslmode=disable", "--secret-key", DUMMY_SECRET_KEY, "--listen-addr", "0.0.0.0:{0}".format(MEV_RELAY_ENDPOINT_PORT), "--redis-uri", "redis:6379", "--beacon-uris", beacon_uris, "--blocksim", builder_uri] + mev_params.mev_relay_api_extra_args, | ||
ports = { | ||
"api": PortSpec(number = MEV_RELAY_ENDPOINT_PORT, transport_protocol= "TCP") | ||
}, | ||
env_vars= env_vars | ||
) | ||
) | ||
|
||
plan.add_service( | ||
name = MEV_RELAY_WEBSITE, | ||
config = ServiceConfig( | ||
image = image, | ||
cmd = ["website", "--network", "custom", "--db", "postgres://postgres:postgres@postgres:5432/postgres?sslmode=disable", "--listen-addr", "0.0.0.0:{0}".format(MEV_RELAY_WEBSITE_PORT), "--redis-uri", "redis:6379", "https://{0}@{1}".format(DUMMY_PUB_KEY, MEV_RELAY_ENDPOINT)] + mev_params.mev_relay_website_extra_args, | ||
ports = { | ||
"api": PortSpec(number = MEV_RELAY_WEBSITE_PORT, transport_protocol= "TCP", application_protocol="http") | ||
}, | ||
env_vars= env_vars | ||
) | ||
) | ||
|
||
return "http://{0}@{1}:{2}".format(DUMMY_PUB_KEY, api.ip_address, MEV_RELAY_ENDPOINT_PORT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters