Skip to content

Conversation

@MauroToscano
Copy link
Contributor

@MauroToscano MauroToscano commented Aug 25, 2025

Description

This pr introduces two new validations when processing proofs:

  • The min max_fee allowed has to be able to cover a batch of at least 32 proofs
  • For replacements, the max_fee must be at least 10 percent higher with respect to the original one.

Important

Note: this pr requires two new variables in the batcher config:

  • proofs_to_cover_in_min_max_fee: When validating if the msg covers the minimum max fee, a batch of how many > proofs should it cover
  • min_bump_percentage: When replacing the message, how much higher should the max fee in comparison to the > original one

How to test

  1. Start ethereum_package:
make ethereum_package_start
  1. Start the aggregator and operator (these components aren't required for the test thou):
make aggregator_start_ethereum_package ENVIRONMENT=devnet
make operator_full_registration CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml
make operator_start CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml ENVIRONMENT=devnet
  1. Start the batcher:
make batcher_start_ethereum_package
  1. Fund wallet on aligned with anvil rich account:
aligned deposit-to-batcher --amount 1ether --private_key 0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e  --network devnet --rpc_url http://localhost:8545
  1. Send proofs with a very low max_fee such that it does not cover the 32 proofs batch, for example if PROOFS_IN_BATCH=50, they should not be accepted
# Submit proofs with  
aligned submit --proving_system SP1 \
		--proof scripts/test_files/sp1/sp1_fibonacci_5_0_0.proof \
		--vm_program scripts/test_files/sp1/sp1_fibonacci_5_0_0.elf \
		--private_key 0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e \
		--public_input scripts/test_files/sp1/sp1_fibonacci_5_0_0.pub \
		--repetitions 10 \
		--custom_fee_estimate $(PROOFS_IN_BATCH) \
		--rpc_url  http://localhost:8545 \
		--network devnet
  1. Repeat 6 but with 10<PROOFS_IN_BATCH <= 32 so that the batch is not build. Then check the log:
[2025-07-03T21:57:23Z INFO  aligned] Will send each proof with an estimated max_fee of: 0.000066934172441950ether

Save the max_Fee number.
8. Try to replace a proof a proof with less than 10% percentof the previous max fee. For example if the batch of proofs starts withNONCE=0`

aligned submit --proving_system SP1 \
		--proof scripts/test_files/sp1/sp1_fibonacci_5_0_0.proof \
		--vm_program scripts/test_files/sp1/sp1_fibonacci_5_0_0.elf \
		--private_key 0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e \
		--public_input scripts/test_files/sp1/sp1_fibonacci_5_0_0.pub \
		--nonce 12
		--max_fee $(MAX_FEE = PREV_MAX_FEE*1,05) \
		--rpc_url  http://localhost:8545 \
		--network devnet
  1. Repeat 8 again but with MAX_FEE>= MAX_FEE*1,1, verify it gets replaced.

Type of change

  • 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

@MauroToscano MauroToscano changed the base branch from testnet to staging August 25, 2025 19:30
@MauroToscano MauroToscano changed the title asdasdFeat/min fee merge WIP: Update min fee Aug 26, 2025
@MarcosNicolau MarcosNicolau marked this pull request as ready for review August 29, 2025 17:24
@MarcosNicolau MarcosNicolau changed the title WIP: Update min fee feat(batcher): enforce a min max_fee and min bump for replacements Aug 29, 2025
@JuArce JuArce added this pull request to the merge queue Aug 29, 2025
Merged via the queue into staging with commit ea99689 Aug 29, 2025
3 checks passed
@JuArce JuArce deleted the feat/min-fee-merge branch August 29, 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