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
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion zilliqa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ arc-swap = "1.9.1"
redis = { version = "0.32.7", features = ["keep-alive", "r2d2", "tcp_nodelay"], default-features = false }
alloy = { version = "2.0.4", default-features = false, features = ["consensus", "contract", "dyn-abi", "eips", "hyper", "json-abi", "k256", "rlp", "rpc-types", "rpc-types-trace", "serde", "sol-types"] }
crossbeam = "0.8.4"
lru = "0.17.0"
lru = "0.18.0"

[dev-dependencies]
alloy = { version = "2.0.4", default-features = false, features = ["consensus", "dyn-abi", "eips", "json-abi", "k256", "rlp", "rpc-types", "rpc-types-trace", "serde", "sol-types", "pubsub", "json-rpc", "contract", "signer-local"] }
Expand Down
42 changes: 20 additions & 22 deletions zilliqa/src/uccb/relayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,28 +277,26 @@ impl Relayer {
// do this in an inner-scope to release the lock before calling `relay_ops()` below.
let promote = {
// 2. Get the cache entry
let bop = self
.signatures
.write()
.get_or_insert_mut_ref(&userop_hash, || {
let stakers = state.get_stakers(block.header).expect("must exist");
let len = stakers.len();
let total_stake: u128 = stakers
.into_iter()
.map(|pub_key| {
state
.get_stake(pub_key, block.header)
.expect("must have stake")
.expect("stake != 0")
.get()
})
.sum();
BlsUserOp {
userop: None,
threshold: 2 * total_stake / 3 + 1,
signatures: Vec::with_capacity(len),
}
});
let mut cache = self.signatures.write();
let bop = cache.get_or_insert_mut_ref(&userop_hash, || {
let stakers = state.get_stakers(block.header).expect("must exist");
let len = stakers.len();
let total_stake: u128 = stakers
.into_iter()
.map(|pub_key| {
state
.get_stake(pub_key, block.header)
.expect("must have stake")
.expect("stake != 0")
.get()
})
.sum();
BlsUserOp {
userop: None,
threshold: 2 * total_stake / 3 + 1,
signatures: Vec::with_capacity(len),
}
});

// 3. Cache the signature entry
let stake = state
Expand Down
Loading