feat: notify user after replacement message #2131
Merged
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.
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
cd crates/cli cargo run --release -- deposit-to-batcher \ --amount 1ether \ --private_key 0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 \ --network devnet \ --rpc_url http://localhost:8545cargo 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 0cd 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 0You should see the replacement message on the replaced proof CLI.
Type of change
Checklist
testnet, everything else tostaging