-
Notifications
You must be signed in to change notification settings - Fork 391
feat: ethereum-package for real conditions network stress-test #1426
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
Merged
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
659bece
feat: basic localnet with 4 nodes
avilagaston9 6042b80
feat: are more makefile targets
avilagaston9 736a8e4
chore: remove tx_spammer
MarcosNicolau bfd250b
feat: add grafana panels
avilagaston9 d51869b
chore: add network params and prefunded accounts
MarcosNicolau e625a50
fix: network_params.yml
MarcosNicolau 21033a0
feat: spamoor commands
MarcosNicolau d7a050b
refactor: spamoor commands
MarcosNicolau 4a0ca44
fix: spamoor commands
MarcosNicolau a9897d6
feat: add aligned contracts
avilagaston9 deba97b
feat: add batcher and aggregator
avilagaston9 fd64066
feat: connect operator to devnet
avilagaston9 6342c06
feat: spamoor with gas burning
MarcosNicolau a0d4222
chore: 12 seconds per slot and increment initial rich wallets balance
MarcosNicolau 80ecbfb
chore: makefile separate register and start operator
MarcosNicolau 258d419
fix: makefile operator commands
MarcosNicolau 4997002
chore: add max_fee and tip_fee to spamoor
MarcosNicolau 643488a
chore: add tracing to batcher send responseToTask
MarcosNicolau 5400685
chore: increase max_fee for groth16
MarcosNicolau b642714
fix: remove ethereum_package_contracts file
avilagaston9 0982069
refactor: remove unnecesary log
avilagaston9 e24469f
docs: add docs about how to run
avilagaston9 21ee4c7
feat: add comment about the contracts deployment
avilagaston9 8ddd753
Merge branch 'staging' into aligned-ethereum-package
avilagaston9 3526cb2
feat: deploy new contracts in ethereum package
avilagaston9 cfb4278
docs: add example to docs
avilagaston9 9b6f2c2
Merge branch 'staging' into aligned-ethereum-package
MauroToscano e8d1261
Update docs/0_internal/ethereum_package.md
MauroToscano be69255
fix: removes stop instruction
avilagaston9 db65c37
fix: docs detail missing pormetheus
uri-99 7b7a414
docs: add instructions to check network status
avilagaston9 17da41c
chore: details on new guide
uri-99 3d9e5c0
chore: install_spamoor install message
MarcosNicolau 2595f84
Merge branch 'staging' into aligned-ethereum-package
MarcosNicolau e115f37
Merge branch 'staging' into aligned-ethereum-package
MauroToscano dca4d0e
docs: add guide about how to update the contracts
avilagaston9 83e72ca
Merge remote-tracking branch 'origin/staging' into aligned-ethereum-p…
MarcosNicolau 4ace6df
chore: update contracts on eth package
MarcosNicolau 51dee0d
chore: improve contract creation json command
MarcosNicolau 2701272
fix: restore max_fee
avilagaston9 fc3acc1
fix: restore fund operator script
avilagaston9 dc0110d
fix: remove unused param
JuArce b7f715c
Merge remote-tracking branch 'refs/remotes/origin/staging' into align…
JuArce File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,36 @@ | ||
| # Common variables for all the services | ||
| # 'production' only prints info and above. 'development' also prints debug | ||
| environment: "production" | ||
| aligned_layer_deployment_config_file_path: "./contracts/script/output/devnet/alignedlayer_deployment_output.json" | ||
| eigen_layer_deployment_config_file_path: "./contracts/script/output/devnet/eigenlayer_deployment_output.json" | ||
| eth_rpc_url: "http://localhost:8545" | ||
| eth_rpc_url_fallback: "http://localhost:8550" | ||
| eth_ws_url: "ws://localhost:8546" | ||
| eth_ws_url_fallback: "ws://localhost:8551" | ||
| eigen_metrics_ip_port_address: "localhost:9090" | ||
|
|
||
| ## ECDSA Configurations | ||
| ecdsa: | ||
| private_key_store_path: "config-files/anvil.aggregator.ecdsa.key.json" | ||
| private_key_store_password: "" | ||
|
|
||
| ## BLS Configurations | ||
| bls: | ||
| private_key_store_path: "config-files/anvil.aggregator.bls.key.json" | ||
| private_key_store_password: "" | ||
|
|
||
| ## Aggregator Configurations | ||
| aggregator: | ||
| server_ip_port_address: localhost:8090 | ||
| bls_public_key_compendium_address: 0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44 | ||
| avs_service_manager_address: 0xc3e53F4d16Ae77Db1c982e75a937B9f60FE63690 | ||
| enable_metrics: true | ||
| metrics_ip_port_address: localhost:9091 | ||
| telemetry_ip_port_address: localhost:4001 | ||
| garbage_collector_period: 2m #The period of the GC process. Suggested value for Prod: '168h' (7 days) | ||
| garbage_collector_tasks_age: 20 #The age of tasks that will be removed by the GC, in blocks. Suggested value for prod: '216000' (30 days) | ||
| garbage_collector_tasks_interval: 10 #The interval of queried blocks to get an old batch. Suggested value for prod: '900' (3 hours) | ||
| bls_service_task_timeout: 168h # The timeout of bls aggregation service tasks. Suggested value for prod '168h' (7 days) | ||
| gas_base_bump_percentage: 10 # How much to bump gas price when responding to task. Suggested value 10% | ||
| gas_bump_incremental_percentage: 2 # An extra percentage to bump every retry i*2 when responding to task. Suggested value 2% | ||
| time_to_wait_before_bump: 36s # The time to wait for the receipt when responding to task. Suggested value 36 seconds (3 blocks) |
This file contains hidden or 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 @@ | ||
| # Common variables for all the services | ||
| # 'production' only prints info and above. 'development' also prints debug | ||
| environment: "production" | ||
| aligned_layer_deployment_config_file_path: "./contracts/script/output/devnet/alignedlayer_deployment_output.json" | ||
| eigen_layer_deployment_config_file_path: "./contracts/script/output/devnet/eigenlayer_deployment_output.json" | ||
| eth_rpc_url: "http://localhost:8545" | ||
| eth_rpc_url_fallback: "http://localhost:8550" | ||
| eth_ws_url: "ws://localhost:8546" | ||
| eth_ws_url_fallback: "ws://localhost:8551" | ||
| eigen_metrics_ip_port_address: "localhost:9090" | ||
|
|
||
| ## ECDSA Configurations | ||
| ecdsa: | ||
| private_key_store_path: "config-files/anvil.batcher.ecdsa.key.json" | ||
| private_key_store_password: "" | ||
|
|
||
| ## Batcher configurations | ||
| batcher: | ||
| block_interval: 3 | ||
| batch_size_interval: 10 | ||
| transaction_wait_timeout: 36000 # 3 blocks | ||
| max_proof_size: 67108864 # 64 MiB | ||
| max_batch_byte_size: 268435456 # 256 MiB | ||
| max_batch_proof_qty: 3000 # 3000 proofs in a batch | ||
| pre_verification_is_enabled: true | ||
| metrics_port: 9093 | ||
| telemetry_ip_port_address: localhost:4001 | ||
| non_paying: | ||
| address: 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 # Anvil address 9 | ||
| replacement_private_key: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 # Anvil address 1 |
This file contains hidden or 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,41 @@ | ||
| # Common variables for all the services | ||
| # 'production' only prints info and above. 'development' also prints debug | ||
| environment: 'development' | ||
| aligned_layer_deployment_config_file_path: './contracts/script/output/devnet/alignedlayer_deployment_output.json' | ||
| eigen_layer_deployment_config_file_path: './contracts/script/output/devnet/eigenlayer_deployment_output.json' | ||
| eth_rpc_url: 'http://localhost:8545' | ||
| eth_rpc_url_fallback: 'http://localhost:8550' | ||
| eth_ws_url: 'ws://localhost:8546' | ||
| eth_ws_url_fallback: 'ws://localhost:8551' | ||
| eigen_metrics_ip_port_address: 'localhost:9090' | ||
|
|
||
| ## ECDSA Configurations | ||
| ecdsa: | ||
| private_key_store_path: 'config-files/devnet/keys/operator-1.ecdsa.key.json' | ||
| private_key_store_password: '' | ||
|
|
||
| ## BLS Configurations | ||
| bls: | ||
| private_key_store_path: 'config-files/devnet/keys/operator-1.bls.key.json' | ||
| private_key_store_password: '' | ||
|
|
||
| ## Operator Configurations | ||
| operator: | ||
| aggregator_rpc_server_ip_port_address: localhost:8090 | ||
| operator_tracker_ip_port_address: http://localhost:4001 | ||
| address: 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 | ||
| earnings_receiver_address: 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 | ||
| delegation_approver_address: '0x0000000000000000000000000000000000000000' | ||
| staker_opt_out_window_blocks: 0 | ||
| metadata_url: 'https://yetanotherco.github.io/operator_metadata/metadata.json' | ||
| enable_metrics: true | ||
| metrics_ip_port_address: localhost:9092 | ||
| max_batch_size: 268435456 # 256 MiB | ||
| last_processed_batch_filepath: 'config-files/operator-1.last_processed_batch.json' | ||
|
|
||
| # Operators variables needed for register it in EigenLayer | ||
| el_delegation_manager_address: '0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9' | ||
| private_key_store_path: config-files/devnet/keys/operator-1.ecdsa.key.json | ||
| bls_private_key_store_path: config-files/devnet/keys/operator-1.bls.key.json | ||
| signer_type: local_keystore | ||
| chain_id: 31337 |
This file contains hidden or 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,126 @@ | ||
| # Ethereum Package | ||
|
|
||
| > [!WARNING] | ||
| > [Kurtosis](https://github.com/kurtosis-tech/kurtosis) must be installed. | ||
|
|
||
| ## Usage and Setup | ||
|
|
||
| To start a local network run: | ||
|
|
||
| ```bash | ||
| make ethereum_package_start | ||
| ``` | ||
|
|
||
| To see the status of the network run: | ||
|
|
||
| ```bash | ||
| make ethereum_package_inspect | ||
| ``` | ||
|
|
||
| This will show you all the containers running and their respective ports. The most interesting ones are prometheus, grafana and el_forkmon, they will provide you with metrics to see the gasPrice, gasUsed, txPerBlock, and others that will be in our interest to create chaos on the network. | ||
|
|
||
| To stop the network run the following: | ||
|
|
||
| ```bash | ||
| make ethereum_package_rm | ||
| ``` | ||
|
|
||
| To start the batcher run: | ||
|
|
||
| ```bash | ||
| make batcher_start_ethereum_package | ||
| ``` | ||
|
|
||
| To start the aggregator run: | ||
|
|
||
| ```bash | ||
| make aggregator_start_ethereum_package | ||
| ``` | ||
|
|
||
| To start an operator run: | ||
|
|
||
| ```bash | ||
| make operator_register_start_ethereum_package | ||
| ``` | ||
|
|
||
| If you want to deploy more operators, you must duplicate the config-operator-1-ethereum-package.yaml and change the private and bls keys and the address. | ||
|
|
||
| To start Telemetry and the Explorer, run the usual commands: | ||
|
|
||
| ```bash | ||
| make telemetry_full_start | ||
| make run_explorer | ||
| ``` | ||
|
|
||
| To spam transactions install spamoor: | ||
| ```bash | ||
| make install_spamoor | ||
| ``` | ||
|
|
||
| and run the following make targets: | ||
|
|
||
| ```bash | ||
| make spamoor_send_transactions \\ | ||
| COUNT=<TOTAL_TX_TO_EXECUTE> \\ | ||
| TX_PER_BLOCK=<LIMIT_OF_TXS_TO_SEND_PER_BLOCK> \\ | ||
| TX_CONSUME_GAS=<HOW_MUCH_GAS_TO_USE_PER_TX> \\ | ||
| NUM_WALLETS=<NUMBER_OF_WALLETS_FROM_WHICH_TO_SEND_TXS> \\ | ||
| TIP_FEE=<TIP_FEE_IN_GWEI> | ||
| ``` | ||
|
|
||
| For Example: | ||
| ```bash | ||
| make spamoor_send_transactions COUNT=1000 TX_CONSUME_GAS=150000 TX_PER_BLOCK=50 NUM_WALLETS=100 TIP_FEE=2 | ||
| ``` | ||
|
|
||
| ## Network status | ||
|
|
||
| You can check the network status using Grafana and el_forkmon explorer. | ||
| Run `make ethereum_package_inspect` to see the exposed ports for the enabled services. You can check for example the Grafana panels under `Dashboards -> Ethereum Metrics Exporter Overview` which provides useful information about the network. | ||
|
|
||
| ## Changing Network Params | ||
|
|
||
| To adjust network params you have to modify `network_params.yaml`. | ||
|
|
||
| > [!NOTE] | ||
| > We are using a hardcoded input to deploy Eigen and Aligned contracts using the output from anvil. | ||
|
|
||
| ## How to make transactions compete and see bumping in the Aggregator and Batcher logs | ||
|
|
||
| To increment the gas price and make transactions compete with aligned transactions we need to: | ||
|
|
||
| 1. **Exceed the block `gasLimit` (30 million):** This is achieved by ensuring the total gas consumed per block is greater than `30,000,000`. Calculate it as: `TX_CONSUME_GAS * TX_PER_BLOCK` | ||
| 2. **Raise the `tipFee` slightly above the current gas price:** For instance, if the current `gasPrice` is `20 GWEI`, you can generate spam transactions with: | ||
|
|
||
| ```bash | ||
| make spamoor_send_transactions COUNT=1000000000 TX_CONSUME_GAS=150000 TX_PER_BLOCK=210 NUM_WALLETS=1000 TIP_FEE=22 | ||
| ``` | ||
|
|
||
| - Notes: | ||
| - A transaction consuming `150000` of gas would be similar to a bridge swap. | ||
| - We pass `2` gwei more to the `tipFee` that should be enough if not, you can increase it. | ||
|
|
||
| 3. **Monitor Gas Price Updates:** After a few blocks, the `gasPrice` will adjust. The aligned batcher and aggregator will fetch the updated `gasPrice` and start competing in the mempool with their adjusted bump. | ||
| 4. **Repeat as Needed:** Re-run the same command with the updated `TIP_FEE` to maintain competition: | ||
|
|
||
| ```bash | ||
| make spamoor_send_transactions COUNT=1000000000 TX_CONSUME_GAS=150000 TX_PER_BLOCK=210 NUM_WALLETS=1000 TIP_FEE=<new_tip_fee> | ||
| ``` | ||
|
|
||
| ## How to update preloaded contracts | ||
|
|
||
| 1. First, deploy the new contracts in Anvil: | ||
|
|
||
| ```bash | ||
| make anvil_deploy_aligned_contracts | ||
| ``` | ||
|
|
||
| That will generate the state output in `contracts/scripts/anvil/state/alignedlayer-deployed-anvil-state.json` | ||
|
|
||
| 2. Filter the contracts' state: | ||
JuArce marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| jq '.accounts | to_entries | map(select(.value.code != "0x")) | from_entries' contracts/scripts/anvil/state/alignedlayer-deployed-anvil-state.json > contracts.json | ||
| ``` | ||
|
|
||
| 3. Open the `network_params.yaml` file and replace the `additional_preloaded_contracts` section with the content of `contracts.json`. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.