Skip to content

Conversation

@maximopalopoli
Copy link
Collaborator

@maximopalopoli maximopalopoli commented Sep 29, 2025

Notify user after replacement message

Description

In the message replacement process, the old sink was being closed silently, without notifying the other side about the reason for the disconnection. With this change, the batcher now sends a ProofReplaced message before closing it.

Note: The closing handshake might not be handled gracefully by the other side, since we are replacing the sink with a new one. However, this can be improved in a future PR.

How to test

  1. Reinstall aligned CLI:
make aligned_install_compiling
  1. Start anvil:
make anvil_start
  1. Start the batcher:
make batcher_start_local
  1. Run the aggregator:
make aggregator_start ENVIRONMENT=devnet
  1. Run the operator
make operator_full_registration_and_start ENVIRONMENT=devnet
  1. Deposit in Aligned (for example, with an anvil-rich account):
cd crates/cli
cargo run --release -- deposit-to-batcher \
    --amount 1ether \
    --private_key 0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 \
    --network devnet \
    --rpc_url http://localhost:8545
  1. Send a proof:
cargo run --release -- submit \
                --proving_system Risc0 \
                --proof ../../scripts/test_files/risc_zero/no_public_inputs/risc_zero_no_pub_input_3_0_3.proof \
                --vm_program ../../scripts/test_files/risc_zero/no_public_inputs/risc_zero_no_pub_input_id_3_0_3.bin \
                --rpc_url http://localhost:8545 \
                --network devnet \
                --default_fee_estimate \
                --private_key 0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 \
                --random_address \
                --nonce 0
  1. Send the same proof with a higher fee from another terminal:
cd crates/cli
cargo run --release -- submit \
                --proving_system Risc0 \
                --proof ../../scripts/test_files/risc_zero/no_public_inputs/risc_zero_no_pub_input_3_0_3.proof \
                --vm_program ../../scripts/test_files/risc_zero/no_public_inputs/risc_zero_no_pub_input_id_3_0_3.bin \
                --rpc_url http://localhost:8545 \
                --network devnet \
                --instant_fee_estimate \
                --private_key 0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 \
                --random_address \
                --nonce 0

You should see the replacement message on the replaced proof CLI.

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

@maximopalopoli maximopalopoli self-assigned this Sep 29, 2025
@maximopalopoli maximopalopoli marked this pull request as ready for review September 29, 2025 17:30
@JuArce JuArce enabled auto-merge October 1, 2025 20:01
@JuArce JuArce added this pull request to the merge queue Oct 1, 2025
@JuArce JuArce removed this pull request from the merge queue due to the queue being cleared Oct 1, 2025
@JuArce JuArce added this pull request to the merge queue Oct 2, 2025
Merged via the queue into staging with commit 73661ab Oct 2, 2025
3 checks passed
@JuArce JuArce deleted the feat/notify-user-after-replacement-message branch October 2, 2025 19:18
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