Skip to content

Commit eedec99

Browse files
committed
Add better documentation for adapter
1 parent 0edd4b7 commit eedec99

File tree

1 file changed

+12
-0
lines changed
  • crates/fuel-core/src/service/adapters/consensus_module

1 file changed

+12
-0
lines changed

crates/fuel-core/src/service/adapters/consensus_module/poa.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,18 @@ impl Clone for RedisNode {
118118
}
119119
}
120120

121+
/// Uses a set of Redis servers to take ownership of fencing tokens for each epoch and publish
122+
/// block data.
123+
///
124+
/// In steady state, a single block producer should be able to hold the lock indefinitely. If that
125+
/// producer is shut down, it will release the token and allow another producer to take over.
126+
///
127+
/// The code however is designed to be fault tolerant. If a producer fails to release the lock,
128+
/// there is a TTL on the lock that will allow another producer to take over.
129+
///
130+
/// If different producers claim locks on each Redis server, nodes can deterministically
131+
/// identify the true block producer of any given block. This is done by iterating over each epochs
132+
/// and finding the highest epoch with a quorum of blocks produced.
121133
pub struct RedisLeaderLeaseAdapter {
122134
redis_nodes: Vec<RedisNode>,
123135
quorum: usize,

0 commit comments

Comments
 (0)