Skip to content

Conversation

@maximopalopoli
Copy link
Collaborator

@maximopalopoli maximopalopoli commented Oct 16, 2025

Description

This PR improves the previous script that sent proofs every N seconds, considering the time elapsed and the current network gas price:

  • Every iteration occurs after 30 minutes
  • Between 10 and 14 iterations, if the gas price is higher than 2 gwei, send a proof
  • Between 14 and 16 iterations, if the gas price is higher than 5 gwei, send a proof
  • Between 16 and 24 iterations, if the gas price is higher than 15 gwei, send a proof
  • After 50 iterations, send a proof

How to test

We are using devnet to test the feature. You can use your own wallet or the one used in the alerts/.env.devnet file.

If you are using a local wallet, fund it using:

cast send <address> --value 10ether --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url http://localhost:8545/

Deposit into Aligned using the following CLI command:

aligned deposit-to-batcher \
--network devnet \
--rpc_url http://localhost:8545 \
--amount 5ether \
--keystore_path <KEYSTORE_PATH>

Or use the --private_key flag with the private key used in the .env.devnet file.

Now, you can run the script, but since the sleep time between intervals is 30 minutes, you'll have to reduce it, for example, to 10 seconds.

Add gas cost variations

Since the gas cost won't vary much during the testing interval, we have to modify the gas cost of the network manually.

Do it with the following command:

curl -s http://localhost:8545/ -H "Content-Type: application/json" -d '{
"jsonrpc":"2.0","id":1,
"method":"anvil_setNextBlockBaseFeePerGas",
"params":["0x3b9aca00"]   // 1 Gwei in hex
}'

Change the Gwei amount in hex for the one you want to test. Some sample values:

  • "0x3b9aca00" - 1 Gwei
  • "0x9502F900" - 2.5 Gwei
  • "0x165A0BC00" - 6 Gwei
  • "0x41314CF00" - 17.5 Gwei
  • "0xBA43B7400" - 50 Gwei

I noticed that once it's set to a value, it decreases with the passing of time, so I recommend increasing it to a high value and waiting for the time to pass.

Note: You'll see a log like the following

curl: (2) no URL specified
curl: try 'curl --help' or 'curl --manual' for more information

This is logged because it tries to connect to Slack via curl, but we have not set the Slack URL variable, as it's not relevant for this test.

Type of change

Please delete options that are not relevant.

  • New feature

Checklist

  • “Hotfix” to testnet, everything else to staging
  • Linked to Github Issue
  • This change depends on code or research by an external entity
    • Acknowledgements were updated to give credit
  • Unit tests added
  • This change requires new documentation.
    • Documentation has been added/updated.
  • This change is an Optimization
    • Benchmarks added/run
  • Has a known issue
  • If your PR changes the Operator compatibility (Ex: Upgrade prover versions)
    • This PR adds compatibility for operator for both versions and do not change crates/docs/examples
    • This PR updates batcher and docs/examples to the newer version. This requires the operator are already updated to be compatible

@maximopalopoli maximopalopoli self-assigned this Oct 16, 2025
@maximopalopoli maximopalopoli marked this pull request as ready for review October 17, 2025 18:06
Copy link
Member

@MarcosNicolau MarcosNicolau left a comment

Choose a reason for hiding this comment

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

Worked for me locally, not approving to discuss the params

@JuArce JuArce merged commit ecfef61 into testnet Oct 21, 2025
1 check passed
@JuArce JuArce deleted the feat/improve-periodic-proof-sending-script branch October 21, 2025 21:10
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.

4 participants