Skip to content

Commit be4e034

Browse files
committed
fix: pr reviews
1 parent a72e967 commit be4e034

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

rust/main/agents/relayer/src/msg/metadata/sealevel_composite.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ async fn build_metadata_from_spec_inner(
156156
}
157157

158158
CompositeIsmMetadataSpec::Aggregation {
159-
threshold: _,
159+
threshold,
160160
sub_specs,
161161
} => {
162162
let ism_count = sub_specs.len();
@@ -169,6 +169,11 @@ async fn build_metadata_from_spec_inner(
169169
}
170170
}
171171

172+
let valid_count = sub_results.iter().filter(|r| r.is_some()).count();
173+
if valid_count < *threshold as usize {
174+
return Err(MetadataBuildError::CouldNotFetch);
175+
}
176+
172177
// Pack into aggregation format:
173178
// [start_0(4b)][end_0(4b)] ... [start_n(4b)][end_n(4b)] [data_0] [data_1] ...
174179
// (0,0) means no metadata for that ISM.

rust/sealevel/programs/ism/composite-ism/src/accounts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ pub enum IsmNode {
8383
/// verify time, so heap usage is O(1) and the number of supported domains is
8484
/// unlimited.
8585
///
86-
/// Each domain PDA is at seeds `[DOMAIN_ISM_SEED, &[table_id], &domain.to_le_bytes()]`.
87-
/// The `table_id` field namespaces this routing table so that multiple `Routing`
88-
/// nodes in the same ISM tree can coexist (e.g. inside an `Aggregation`).
86+
/// Each domain PDA is at seeds `[DOMAIN_ISM_SEED, &domain.to_le_bytes()]`
87+
/// (see [`derive_domain_pda`]). At most one `Routing` node is allowed per ISM
88+
/// tree (enforced by `validate_config`), so no namespace field is needed.
8989
///
9090
/// `RateLimited` inside a domain PDA is disallowed by `SetDomainIsm` validation
9191
/// (writeback requires the domain PDA to be writable, which is not supported).

rust/sealevel/programs/ism/composite-ism/src/instruction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub fn update_config_instruction(
125125
program_id,
126126
data: Instruction::UpdateConfig(root).encode()?,
127127
accounts: vec![
128-
AccountMeta::new(owner, true),
128+
AccountMeta::new_readonly(owner, true),
129129
AccountMeta::new(storage_pda_key, false),
130130
],
131131
})

0 commit comments

Comments
 (0)