-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add assertoor to additional toolings (#419)
Added assertoor testnet testing tool. There are currently 6 tests included: * Check for chain stability (finalizing, high voting consensus, no reorgs) * Check if all clients propose a block * Validator Lifecycle Test Test for the whole validator lifecycle, includes Deposits, BLSChanges, Exits & Slashings This Test takes up to 2 days to run through due to deposit delays & queues. * Normal Transaction Test Test if normal EOA transactions (type 0/2) are processed by all client pairs (inclusion & submission) * Blob Transaction Test Test if blob transactions (type 3) are processed by all client pairs (inclusion & submission) * All-Opcodes Transaction Test Generates & submits a transaction that triggers every EVM opcode once. Checks if the transaction succeeds and no client forks off --------- Co-authored-by: Barnabas Busa <busa.barnabas@gmail.com>
- Loading branch information
1 parent
e61c58a
commit 76dde3e
Showing
14 changed files
with
1,074 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
participants: | ||
- el_client_type: geth | ||
cl_client_type: lighthouse | ||
count: 1 | ||
- el_client_type: geth | ||
cl_client_type: lodestar | ||
count: 1 | ||
additional_services: | ||
- assertoor |
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,144 @@ | ||
shared_utils = import_module("../shared_utils/shared_utils.star") | ||
static_files = import_module("../static_files/static_files.star") | ||
constants = import_module("../package_io/constants.star") | ||
SERVICE_NAME = "assertoor" | ||
|
||
HTTP_PORT_ID = "http" | ||
HTTP_PORT_NUMBER = 8080 | ||
|
||
ASSERTOOR_CONFIG_FILENAME = "assertoor-config.yaml" | ||
|
||
ASSERTOOR_CONFIG_MOUNT_DIRPATH_ON_SERVICE = "/config" | ||
ASSERTOOR_TESTS_MOUNT_DIRPATH_ON_SERVICE = "/tests" | ||
|
||
VALIDATOR_RANGES_MOUNT_DIRPATH_ON_SERVICE = "/validator-ranges" | ||
VALIDATOR_RANGES_ARTIFACT_NAME = "validator-ranges" | ||
|
||
# The min/max CPU/memory that assertoor can use | ||
MIN_CPU = 100 | ||
MAX_CPU = 1000 | ||
MIN_MEMORY = 128 | ||
MAX_MEMORY = 2048 | ||
|
||
USED_PORTS = { | ||
HTTP_PORT_ID: shared_utils.new_port_spec( | ||
HTTP_PORT_NUMBER, | ||
shared_utils.TCP_PROTOCOL, | ||
shared_utils.HTTP_APPLICATION_PROTOCOL, | ||
) | ||
} | ||
|
||
|
||
def launch_assertoor( | ||
plan, | ||
config_template, | ||
participant_contexts, | ||
participant_configs, | ||
assertoor_params, | ||
): | ||
all_client_info = [] | ||
validator_client_info = [] | ||
|
||
for index, participant in enumerate(participant_contexts): | ||
participant_config = participant_configs[index] | ||
cl_client = participant.cl_client_context | ||
el_client = participant.el_client_context | ||
|
||
all_client_info.append( | ||
new_client_info( | ||
cl_client.ip_addr, | ||
cl_client.http_port_num, | ||
el_client.ip_addr, | ||
el_client.rpc_port_num, | ||
cl_client.beacon_service_name, | ||
) | ||
) | ||
|
||
if participant_config.validator_count != 0: | ||
validator_client_info.append( | ||
new_client_info( | ||
cl_client.ip_addr, | ||
cl_client.http_port_num, | ||
el_client.ip_addr, | ||
el_client.rpc_port_num, | ||
cl_client.beacon_service_name, | ||
) | ||
) | ||
|
||
template_data = new_config_template_data( | ||
HTTP_PORT_NUMBER, all_client_info, validator_client_info, assertoor_params | ||
) | ||
|
||
template_and_data = shared_utils.new_template_and_data( | ||
config_template, template_data | ||
) | ||
template_and_data_by_rel_dest_filepath = {} | ||
template_and_data_by_rel_dest_filepath[ | ||
ASSERTOOR_CONFIG_FILENAME | ||
] = template_and_data | ||
|
||
config_files_artifact_name = plan.render_templates( | ||
template_and_data_by_rel_dest_filepath, "assertoor-config" | ||
) | ||
|
||
tests_config_artifacts_name = plan.upload_files( | ||
static_files.ASSERTOOR_TESTS_CONFIG_DIRPATH, name="assertoor-tests" | ||
) | ||
|
||
config = get_config( | ||
config_files_artifact_name, | ||
tests_config_artifacts_name, | ||
) | ||
|
||
plan.add_service(SERVICE_NAME, config) | ||
|
||
|
||
def get_config(config_files_artifact_name, tests_config_artifacts_name): | ||
config_file_path = shared_utils.path_join( | ||
ASSERTOOR_CONFIG_MOUNT_DIRPATH_ON_SERVICE, | ||
ASSERTOOR_CONFIG_FILENAME, | ||
) | ||
|
||
IMAGE_NAME = "ethpandaops/assertoor:master" | ||
|
||
return ServiceConfig( | ||
image=IMAGE_NAME, | ||
ports=USED_PORTS, | ||
files={ | ||
ASSERTOOR_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name, | ||
ASSERTOOR_TESTS_MOUNT_DIRPATH_ON_SERVICE: tests_config_artifacts_name, | ||
VALIDATOR_RANGES_MOUNT_DIRPATH_ON_SERVICE: VALIDATOR_RANGES_ARTIFACT_NAME, | ||
}, | ||
cmd=["--config", config_file_path], | ||
min_cpu=MIN_CPU, | ||
max_cpu=MAX_CPU, | ||
min_memory=MIN_MEMORY, | ||
max_memory=MAX_MEMORY, | ||
) | ||
|
||
|
||
def new_config_template_data( | ||
listen_port_num, client_info, validator_client_info, assertoor_params | ||
): | ||
return { | ||
"ListenPortNum": listen_port_num, | ||
"ClientInfo": client_info, | ||
"ValidatorClientInfo": validator_client_info, | ||
"RunStabilityCheck": assertoor_params.run_stability_check, | ||
"RunBlockProposalCheck": assertoor_params.run_block_proposal_check, | ||
"RunLifecycleTest": assertoor_params.run_lifecycle_test, | ||
"RunTransactionTest": assertoor_params.run_transaction_test, | ||
"RunBlobTransactionTest": assertoor_params.run_blob_transaction_test, | ||
"RunOpcodesTransactionTest": assertoor_params.run_opcodes_transaction_test, | ||
"AdditionalTests": assertoor_params.tests, | ||
} | ||
|
||
|
||
def new_client_info(cl_ip_addr, cl_port_num, el_ip_addr, el_port_num, service_name): | ||
return { | ||
"CLIPAddr": cl_ip_addr, | ||
"CLPortNum": cl_port_num, | ||
"ELIPAddr": el_ip_addr, | ||
"ELPortNum": el_port_num, | ||
"Name": service_name, | ||
} |
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
Oops, something went wrong.