Skip to content

Conversation

@MarcosNicolau
Copy link
Member

@MarcosNicolau MarcosNicolau commented Jul 3, 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 \
		--repetitions 10 \
		--custom_fee_estimate $(PROOFS_IN_BATCH) \
		--rpc_url  http://localhost:8545 \
		--network devnet
  1. Repeat 6 but with PROOFS_IN_BATCH <= 32.
  2. Try to replace a proof a proof with less than 10% percent. Run 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

Get the fee per proof and then pass a value that is below MAX_FEE*1,1. For example if the batch of proofs starts with NONCE=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 \
		--nonce 12
		--max_fee $(MAX_FEE) \
		--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

@MarcosNicolau MarcosNicolau marked this pull request as ready for review July 3, 2025 22:14
Copy link
Collaborator

@JuArce JuArce left a comment

Choose a reason for hiding this comment

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

Add a warning note to the PR description about the new parameters needed in the config so we don't forget them

Copy link
Collaborator

@JuArce JuArce left a comment

Choose a reason for hiding this comment

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

Missing docs

@MarcosNicolau
Copy link
Member Author

Closed in favour of #2067

@JuArce JuArce deleted the feat/min-max-fee-min-bump branch September 2, 2025 21:44
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.

3 participants