diff --git a/pallets/slow-clap/Cargo.toml b/pallets/slow-clap/Cargo.toml index b0c06ed..887e92e 100644 --- a/pallets/slow-clap/Cargo.toml +++ b/pallets/slow-clap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ghost-slow-clap" -version = "0.3.51" +version = "0.3.52" description = "Applause protocol for the EVM bridge" license.workspace = true authors.workspace = true diff --git a/pallets/slow-clap/src/lib.rs b/pallets/slow-clap/src/lib.rs index 75bd679..62dcab0 100644 --- a/pallets/slow-clap/src/lib.rs +++ b/pallets/slow-clap/src/lib.rs @@ -118,7 +118,6 @@ enum OffchainErr { UnknownNetworkType(NetworkId), OffchainTimeoutPeriod(NetworkId), TooManyRequests(NetworkId), - AuthorityDisabled(AuthIndex), } impl core::fmt::Debug for OffchainErr { @@ -144,7 +143,6 @@ impl core::fmt::Debug for OffchainErr { OffchainErr::UnknownNetworkType(ref network_id) => write!(fmt, "Unknown type for network #{:?}.", network_id), OffchainErr::OffchainTimeoutPeriod(ref network_id) => write!(fmt, "Offchain request should be in-flight for network #{:?}.", network_id), OffchainErr::TooManyRequests(ref network_id) => write!(fmt, "Too many requests over RPC endpoint for network #{:?}.", network_id), - OffchainErr::AuthorityDisabled(ref authority_index) => write!(fmt, "Authority index {:?} is disabled in current session.", authority_index), } } } @@ -768,14 +766,6 @@ impl Pallet { network_id: NetworkIdOf, network_data: &NetworkData, ) -> OffchainResult { - if ClapsInSession::::get(&session_index) - .get(&authority_index) - .map(|info| info.disabled) - .unwrap_or_default() - { - return Err(OffchainErr::AuthorityDisabled(authority_index)); - } - let network_id_encoded = network_id.encode(); let block_number_key = Self::create_storage_key(b"block-", &network_id_encoded); @@ -914,6 +904,20 @@ impl Pallet { Ok(Some(new_evm_block)) } EvmResponseType::TransactionLogs(evm_logs) => { + if ClapsInSession::::get(&session_index) + .get(&authority_index) + .map(|info| info.disabled) + .unwrap_or_default() + { + log::info!( + target: LOG_TARGET, + "🧐 Authority #{:?} disabled in session {:?}; no claps available", + authority_index, + session_index + ); + return Ok(None); + } + let claps: Vec<_> = evm_logs .iter() .filter_map(|log| {