TaraClient
Inherits: IBridgeLightClient, OwnableUpgradeable, UUPSUpgradeable
State Variables
finalized
Contains the last finalized block
PillarBlock.FinalizedBlock public finalized;
finalizedBridgeRoots
Contains the last finalized block for each epoch
mapping(uint256 => bytes32) public finalizedBridgeRoots;
validatorVoteCounts
mapping(address => uint256) public validatorVoteCounts;
totalWeight
uint256 public totalWeight;
pillarBlockInterval
uint256 public pillarBlockInterval;
__gap
gap for upgrade safety <- can be used to add new storage variables(using up to 49 32 byte slots) in new versions of this contract If used, decrease the number of slots in the next contract that inherits this one(ex. uint256[48] __gap;)
uint256[49] __gap;
Functions
constructor
Note: oz-upgrades-unsafe-allow: constructor
constructor();
initialize
function initialize(uint256 _pillarBlockInterval) public initializer;
__TaraClient_init_unchained
function __TaraClient_init_unchained(uint256 _pillarBlockInterval) internal onlyInitializing;
_authorizeUpgrade
function _authorizeUpgrade(address newImplementation) internal override onlyOwner;
getFinalized
function getFinalized() public view returns (PillarBlock.FinalizedBlock memory);
getFinalizedBridgeRoot
Returns the finalized bridge root.
function getFinalizedBridgeRoot(uint256 epoch) external view returns (bytes32);
Returns
Name | Type | Description |
---|---|---|
<none> | bytes32 | The finalized bridge root as a bytes32 value. |
processValidatorChanges
Processes the changes in validator weights.
function processValidatorChanges(PillarBlock.VoteCountChange[] memory validatorChanges) internal;
Parameters
Name | Type | Description |
---|---|---|
validatorChanges | PillarBlock.VoteCountChange[] | An array of VoteCountChange structs representing the changes in validator vote counts. |
finalizeBlocks
Finalizes blocks by verifying the signatures for the last blocks
function finalizeBlocks(PillarBlock.WithChanges[] memory blocks, CompactSignature[] memory lastBlockSigs) public;
Parameters
Name | Type | Description |
---|---|---|
blocks | PillarBlock.WithChanges[] | list of PillarBlockWithChanges. |
lastBlockSigs | CompactSignature[] | An array of Signature structs representing the signatures of the last block. |
getSignaturesWeight
Calculates the total weight of the signatures
function getSignaturesWeight(bytes32 h, CompactSignature[] memory signatures) public view returns (uint256 weight);
Parameters
Name | Type | Description |
---|---|---|
h | bytes32 | The hash for verification. |
signatures | CompactSignature[] | An array of signatures. |
Returns
Name | Type | Description |
---|---|---|
weight | uint256 | The total weight of the signatures. |
Events
BlockFinalized
Events
event BlockFinalized(PillarBlock.FinalizedBlock indexed finalized);