From b00d9ef1e168368bcb47133062603e3e0b6cabd1 Mon Sep 17 00:00:00 2001 From: Maximilian Hubert <64627729+gap-editor@users.noreply.github.com> Date: Wed, 29 Apr 2026 01:35:50 +0200 Subject: [PATCH 1/2] fix: standardize test function naming to use 'settled' consistently (#1359) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Standardized test function names to use past tense 'settled' consistently, matching the `CertificateStatus::Settled` enum variant. ### Changes - `from_pending_to_settle` → `from_pending_to_settled` - `from_candidate_to_settle` → `from_candidate_to_settled` - `from_settle_to_settle` → `from_settled_to_settled` Co-authored-by: Simon Paitrault --- .../src/network_task/tests/status.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/agglayer-certificate-orchestrator/src/network_task/tests/status.rs b/crates/agglayer-certificate-orchestrator/src/network_task/tests/status.rs index f78c13f4e..83cb0b222 100644 --- a/crates/agglayer-certificate-orchestrator/src/network_task/tests/status.rs +++ b/crates/agglayer-certificate-orchestrator/src/network_task/tests/status.rs @@ -25,7 +25,7 @@ use crate::{ #[rstest] #[test_log::test(tokio::test)] #[timeout(Duration::from_secs(2))] -async fn from_pending_to_settle() { +async fn from_pending_to_settled() { let tmp = TempDBDir::new(); let storage = new_storage(&tmp.path); @@ -288,7 +288,7 @@ async fn from_proven_to_settled() { #[rstest] #[test_log::test(tokio::test)] #[timeout(Duration::from_secs(2))] -async fn from_candidate_to_settle() { +async fn from_candidate_to_settled() { let tmp = TempDBDir::new(); let storage = new_storage(&tmp.path); @@ -401,7 +401,7 @@ async fn from_candidate_to_settle() { #[rstest] #[test_log::test(tokio::test)] #[timeout(Duration::from_secs(2))] -async fn from_settle_to_settle() { +async fn from_settled_to_settled() { let tmp = TempDBDir::new(); let storage = new_storage(&tmp.path); From 90588d3eb4b01bef3cb9d90c5589ebcd8888c34c Mon Sep 17 00:00:00 2001 From: iPLAY888 <133153661+letmehateu@users.noreply.github.com> Date: Wed, 29 Apr 2026 05:26:11 +0300 Subject: [PATCH 2/2] fix: use correct error type for pending certificate validation (#1289) Fixes incorrect error type usage in pending certificate insertion. The code was using `CertificateCandidateError::UnexpectedHeight` for pending certificate validation, but this error type is semantically intended for candidate certificates in the epoch context. --------- Co-authored-by: atanmarko Co-authored-by: Simon Paitrault --- crates/agglayer-storage/src/error.rs | 6 ++++++ crates/agglayer-storage/src/stores/pending/mod.rs | 11 ++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/crates/agglayer-storage/src/error.rs b/crates/agglayer-storage/src/error.rs index 46c2fe3c7..84a0cd274 100644 --- a/crates/agglayer-storage/src/error.rs +++ b/crates/agglayer-storage/src/error.rs @@ -49,6 +49,12 @@ pub enum Error { #[error(transparent)] SettlementCompat(#[from] crate::types::settlement::compat::Error), + + #[error( + "Invalid pending certificate height for network {0}: attempted to insert height {1}, but \ + latest pending height is {2}" + )] + InvalidPendingHeight(NetworkId, Height, Height), } impl From for CertificateStatusError { diff --git a/crates/agglayer-storage/src/stores/pending/mod.rs b/crates/agglayer-storage/src/stores/pending/mod.rs index ca2e10f5a..4274188ea 100644 --- a/crates/agglayer-storage/src/stores/pending/mod.rs +++ b/crates/agglayer-storage/src/stores/pending/mod.rs @@ -73,13 +73,10 @@ impl PendingCertificateWriter for PendingStore { self.get_latest_pending_certificate_for_network(&network_id)? { if latest_height > height { - // TODO: This is technically not Candidate error, - return Err(Error::CertificateCandidateError( - crate::error::CertificateCandidateError::UnexpectedHeight( - network_id, - height, - latest_height, - ), + return Err(Error::InvalidPendingHeight( + network_id, + height, + latest_height, )); } }