Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/coprocessor/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: coprocessor
description: A helm chart to distribute and deploy Zama fhevm Co-Processor services
version: 0.8.1
version: 0.8.2
apiVersion: v2
keywords:
- fhevm
Expand Down
1 change: 1 addition & 0 deletions charts/coprocessor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ gwListener:
# --replay-from-block BLOCK_NUMBER
# To go back in time from latest block
# --replay-from-block -NB_BLOCK
# --replay-skip-verify-proof # Skip VerifyProofRequest events during replay

# Service ports configuration
ports:
Expand Down
8 changes: 8 additions & 0 deletions coprocessor/fhevm-engine/gw-listener/src/bin/gw_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ struct Conf {

#[arg(long, default_value = None, help = "Can be negative from last processed block", allow_hyphen_values = true, alias = "catchup-kms-generation-from-block")]
pub replay_from_block: Option<i64>,

#[arg(
long,
default_value_t = false,
help = "Skip VerifyProofRequest events during replay"
)]
pub replay_skip_verify_proof: bool,
}

fn install_signal_handlers(cancel_token: CancellationToken) -> anyhow::Result<()> {
Expand Down Expand Up @@ -170,6 +177,7 @@ async fn main() -> anyhow::Result<()> {
get_logs_poll_interval: conf.get_logs_poll_interval,
get_logs_block_batch_size: conf.get_logs_block_batch_size,
replay_from_block: conf.replay_from_block,
replay_skip_verify_proof: conf.replay_skip_verify_proof,
log_last_processed_every_number_of_updates: conf.log_last_processed_every_number_of_updates,
};

Expand Down
4 changes: 4 additions & 0 deletions coprocessor/fhevm-engine/gw-listener/src/gw_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ impl<P: Provider<Ethereum> + Clone + 'static, A: AwsS3Interface + Clone + 'stati
}
for log in logs {
if log.address() == self.input_verification_address {
if replay_from_block.is_some() && self.conf.replay_skip_verify_proof {
debug!(log = ?log, "Skipping VerifyProofRequest during replay");
continue;
}
if let Ok(event) = InputVerification::InputVerificationEvents::decode_log(&log.inner) {
match event.data {
InputVerification::InputVerificationEvents::VerifyProofRequest(request) => {
Expand Down
2 changes: 2 additions & 0 deletions coprocessor/fhevm-engine/gw-listener/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub struct ConfigSettings {
pub get_logs_poll_interval: Duration,
pub get_logs_block_batch_size: u64,
pub replay_from_block: Option<i64>,
pub replay_skip_verify_proof: bool,

pub log_last_processed_every_number_of_updates: u64,
}
Expand Down Expand Up @@ -86,6 +87,7 @@ impl Default for ConfigSettings {
get_logs_poll_interval: Duration::from_millis(500),
get_logs_block_batch_size: 100,
replay_from_block: None,
replay_skip_verify_proof: false,
log_last_processed_every_number_of_updates: 50,
}
}
Expand Down
Loading