Skip to content
Merged
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.5
version: 0.8.6
apiVersion: v2
keywords:
- fhevm
Expand Down
3 changes: 0 additions & 3 deletions charts/coprocessor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -937,13 +937,10 @@ txSender:
- --database-polling-interval-secs=1
- --verify-proof-resp-database-channel=event_zkpok_computed
- --add-ciphertexts-database-channel=event_ciphertexts_uploaded
- --allow-handle-database-channel=event_allowed_handle
- --verify-proof-resp-batch-limit=128
- --verify-proof-resp-max-retries=6
- --verify-proof-remove-after-max-retries
- --add-ciphertexts-batch-limit=10
- --allow-handle-batch-limit=10
- --allow-handle-max-retries=2147483647
- --add-ciphertexts-max-retries=2147483647
- --error-sleep-initial-secs=1
- --error-sleep-max-secs=4
Expand Down
6 changes: 0 additions & 6 deletions coprocessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ Options:
[default: event_zkpok_computed]
--add-ciphertexts-database-channel <ADD_CIPHERTEXTS_DATABASE_CHANNEL>
[default: event_ciphertexts_uploaded]
--allow-handle-database-channel <ALLOW_HANDLE_DATABASE_CHANNEL>
[default: event_allowed_handle]
--verify-proof-resp-batch-limit <VERIFY_PROOF_RESP_BATCH_LIMIT>
[default: 128]
--verify-proof-resp-max-retries <VERIFY_PROOF_RESP_MAX_RETRIES>
Expand All @@ -215,10 +213,6 @@ Options:

--add-ciphertexts-batch-limit <ADD_CIPHERTEXTS_BATCH_LIMIT>
[default: 10]
--allow-handle-batch-limit <ALLOW_HANDLE_BATCH_LIMIT>
[default: 10]
--allow-handle-max-retries <ALLOW_HANDLE_MAX_RETRIES>
[default: 2147483647]
--add-ciphertexts-max-retries <ADD_CIPHERTEXTS_MAX_RETRIES>
[default: 2147483647]
--error-sleep-initial-secs <ERROR_SLEEP_INITIAL_SECS>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Drop the allowed handle notify trigger and function as they are no longer used by transaction-sender.
DROP TRIGGER IF EXISTS on_insert_notify_event_allowed_handle ON allowed_handles;
DROP FUNCTION IF EXISTS notify_event_allowed_handle();
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ contract CiphertextCommits {
error CoprocessorAlreadyAdded(bytes32 ctHandle, address coprocessorTxSenderAddress);
error NotCoprocessorTxSender(address txSenderAddress);

event AddCiphertextMaterial(
bytes32 indexed ctHandle,
bytes32 ciphertextDigest,
bytes32 snsCiphertextDigest,
address[] coprocessorTxSenderAddresses
);

bool alreadyAddedRevert;
ConfigErrorMode configErrorMode;

Expand Down Expand Up @@ -44,11 +37,5 @@ contract CiphertextCommits {
revert CoprocessorAlreadyAdded(ctHandle, msg.sender);
}

emit AddCiphertextMaterial(
ctHandle,
ciphertextDigest,
snsCiphertextDigest,
new address[](0)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ struct Conf {
#[arg(long, default_value = "event_ciphertexts_uploaded")]
add_ciphertexts_database_channel: String,

#[arg(long, default_value = "event_allowed_handle")]
allow_handle_database_channel: String,

#[arg(long, default_value_t = 128)]
verify_proof_resp_batch_limit: u32,

Expand All @@ -88,13 +85,6 @@ struct Conf {
#[arg(long, default_value_t = 10)]
add_ciphertexts_batch_limit: u32,

#[arg(long, default_value_t = 10)]
allow_handle_batch_limit: u32,

// For now, use i32 as that's what we have in the DB as integer type.
#[arg(long, default_value_t = i32::MAX, value_parser = clap::value_parser!(i32).range(0..))]
allow_handle_max_retries: i32,

// For now, use i32 as that's what we have in the DB as integer type.
#[arg(long, default_value_t = i32::MAX, value_parser = clap::value_parser!(i32).range(0..))]
add_ciphertexts_max_retries: i32,
Expand Down Expand Up @@ -309,7 +299,6 @@ async fn main() -> anyhow::Result<()> {
let config = ConfigSettings {
verify_proof_resp_db_channel: conf.verify_proof_resp_database_channel,
add_ciphertexts_db_channel: conf.add_ciphertexts_database_channel,
allow_handle_db_channel: conf.allow_handle_database_channel,
verify_proof_resp_batch_limit: conf.verify_proof_resp_batch_limit,
verify_proof_resp_max_retries: conf.verify_proof_resp_max_retries,
verify_proof_remove_after_max_retries: conf.verify_proof_remove_after_max_retries,
Expand All @@ -318,8 +307,6 @@ async fn main() -> anyhow::Result<()> {
error_sleep_initial_secs: conf.error_sleep_initial_secs,
error_sleep_max_secs: conf.error_sleep_max_secs,
add_ciphertexts_max_retries: conf.add_ciphertexts_max_retries,
allow_handle_batch_limit: conf.allow_handle_batch_limit,
allow_handle_max_retries: conf.allow_handle_max_retries,
send_txn_sync_timeout_secs: conf.send_txn_sync_timeout_secs,
review_after_unlimited_retries: conf.review_after_unlimited_retries,
health_check_port: conf.health_check_port,
Expand Down
10 changes: 0 additions & 10 deletions coprocessor/fhevm-engine/transaction-sender/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ pub const DEFAULT_GAS_LIMIT_OVERPROVISION_PERCENT: u32 = 120;
pub struct ConfigSettings {
pub verify_proof_resp_db_channel: String,
pub add_ciphertexts_db_channel: String,
pub allow_handle_db_channel: String,

pub verify_proof_resp_batch_limit: u32,
pub verify_proof_resp_max_retries: u32,
pub verify_proof_remove_after_max_retries: bool,
Expand All @@ -17,11 +15,6 @@ pub struct ConfigSettings {
// For now, use i32 as that's what we have in the DB as integer type.
pub add_ciphertexts_max_retries: i32,

pub allow_handle_batch_limit: u32,

// For now, use i32 as that's what we have in the DB as integer type.
pub allow_handle_max_retries: i32,

pub db_polling_interval_secs: u16,

pub error_sleep_initial_secs: u16,
Expand All @@ -45,7 +38,6 @@ impl Default for ConfigSettings {
Self {
verify_proof_resp_db_channel: "event_zkpok_computed".to_owned(),
add_ciphertexts_db_channel: "event_ciphertexts_uploaded".to_owned(),
allow_handle_db_channel: "event_allowed_handle".to_owned(),
verify_proof_resp_batch_limit: 128,
verify_proof_resp_max_retries: 6,
verify_proof_remove_after_max_retries: true,
Expand All @@ -54,8 +46,6 @@ impl Default for ConfigSettings {
error_sleep_max_secs: 4,
add_ciphertexts_batch_limit: 10,
add_ciphertexts_max_retries: i32::MAX,
allow_handle_batch_limit: 10,
allow_handle_max_retries: i32::MAX,
send_txn_sync_timeout_secs: 4,
review_after_unlimited_retries: 30,
health_check_port: 8080,
Expand Down
23 changes: 0 additions & 23 deletions coprocessor/fhevm-engine/transaction-sender/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ pub(crate) static ADD_CIPHERTEXT_MATERIAL_FAIL_COUNTER: LazyLock<IntCounter> =
.unwrap()
});

pub(crate) static ALLOW_HANDLE_UNSENT: LazyLock<IntGauge> = LazyLock::new(|| {
register_int_gauge!(
"coprocessor_allow_handle_unsent_gauge",
"Number of unsent allow handle transactions"
)
.unwrap()
});

pub(crate) static ADD_CIPHERTEXT_MATERIAL_UNSENT: LazyLock<IntGauge> = LazyLock::new(|| {
register_int_gauge!(
"coprocessor_add_ciphertext_material_unsent_gauge",
Expand Down Expand Up @@ -73,21 +65,6 @@ pub(crate) static VERIFY_PROOF_PENDING: LazyLock<IntGauge> = LazyLock::new(|| {
pub fn spawn_gauge_update_routine(period: std::time::Duration, db_pool: PgPool) -> JoinHandle<()> {
tokio::spawn(async move {
loop {
match sqlx::query_scalar(
"SELECT COUNT(*) FROM allowed_handles WHERE txn_is_sent = FALSE",
)
.fetch_one(&db_pool)
.await
{
Ok(count) => {
info!(unsent_allow_handle_count = %count, "Fetched unsent allow handle count");
ALLOW_HANDLE_UNSENT.set(count);
}
Err(e) => {
error!(error = %e, "Failed to fetch unsent allow handle count");
}
}

match sqlx::query_scalar(
"SELECT COUNT(*) FROM ciphertext_digest WHERE txn_is_sent = FALSE",
)
Expand Down
6 changes: 0 additions & 6 deletions docs/metrics/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ Note that recommendations assume a smoke test that runs transactions/requests at
- **Alarm**: If the counter increases over a period of time.
- **Recommendation**: more than 60 failures in 1 minute, i.e. `increase(counter[1m]) > 60`.

#### Metric Name: `coprocessor_allow_handle_unsent_gauge`
- **Type**: Gauge
- **Description**: Tracks the number of unsent allow handle transactions in the transaction-sender.
- **Alarm**: If the gauge value exceeds a predefined threshold.
- **Recommendation**: more than 100 unsent over 2 minutes, i.e. `min_over_time(gauge[2m]) > 100`.

#### Metric Name: `coprocessor_add_ciphertext_material_unsent_gauge`
- **Type**: Gauge
- **Description**: Tracks the number of unsent add ciphertext material transactions in the transaction-sender.
Expand Down
Loading