Skip to content

Commit fcb9615

Browse files
committed
fix(experimental): log duplicate addresses
This fixes an issue where the redis set was being manipulated during the update process.
1 parent 739e9e0 commit fcb9615

3 files changed

Lines changed: 5 additions & 35 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file.
66
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9-
## [1.5.1] 2024-08-16
9+
## [1.5.1] 2024-08-26
1010

1111
### Added
1212

offchain/authority-claimer/src/listener.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -531,35 +531,6 @@ mod tests {
531531
assert_listen(&mut listener, &dapps, &vec![0]).await;
532532
}
533533

534-
#[tokio::test]
535-
async fn multidapp_listen_with_duplicate_dapps() {
536-
let docker = Cli::default();
537-
let (fixture, mut listener, dapps) =
538-
setup_multidapp_listener(&docker, false).await.unwrap();
539-
fixture.dapps_set(vec![]).await;
540-
541-
// Initializes with 0 addresses in the set.
542-
assert_eq!(0, fixture.dapps_members().await.len());
543-
544-
// We add a lowercase and an uppercase version of the same address.
545-
let dapp: Address = [10; 20].into();
546-
fixture.dapps_add(dapp.to_string().to_lowercase()).await;
547-
fixture.dapps_add(dapp.to_string().to_uppercase()).await;
548-
549-
// We now have 2 addresses in the set.
550-
assert_eq!(2, fixture.dapps_members().await.len());
551-
552-
// We then produce some claims and listen for them.
553-
let mut epochs = vec![0; dapps.len()];
554-
let indexes = vec![2, 2, 0];
555-
multidapp_produce_claims(&fixture, &mut epochs, &dapps, &indexes).await;
556-
let indexes = vec![2, 2];
557-
assert_listen(&mut listener, &dapps, &indexes).await;
558-
559-
// Now we have 1 address because one of the duplicates got deleted.
560-
assert_eq!(1, fixture.dapps_members().await.len());
561-
}
562-
563534
#[tokio::test]
564535
async fn multidapp_listen_with_changing_dapps() {
565536
let docker = Cli::default();

offchain/rollups-events/src/broker/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,10 @@ impl Broker {
380380
match dapp_address {
381381
Ok(dapp_address) => {
382382
if dapp_addresses.contains(&dapp_address) {
383-
let _: () = self
384-
.connection
385-
.clone()
386-
.srem(DAPPS_KEY, value)
387-
.await?;
383+
tracing::info!(
384+
"Ignored duplicate DApp address {:?}",
385+
value,
386+
)
388387
} else {
389388
dapp_addresses.push(dapp_address);
390389
}

0 commit comments

Comments
 (0)