Skip to content

Commit

Permalink
Merge pull request #597 from lidofinance/replace-consensus-version-calls
Browse files Browse the repository at this point in the history
Replace consensus version calls
  • Loading branch information
F4ever authored Jan 24, 2025
2 parents 00dc0c3 + bf0c28c commit 3376919
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/modules/accounting/accounting.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _get_processing_state(self, blockstamp: BlockStamp) -> AccountingProcessingS

# ---------------------------------------- Build report ----------------------------------------
def _calculate_report(self, blockstamp: ReferenceBlockStamp):
consensus_version = self.report_contract.get_consensus_version(blockstamp.block_hash)
consensus_version = self.get_consensus_version(blockstamp)
logger.info({'msg': 'Building the report', 'consensus_version': consensus_version})
rebase_part = self._calculate_rebase_report(blockstamp)
modules_part = self._get_newly_exited_validators_by_modules(blockstamp)
Expand Down
4 changes: 2 additions & 2 deletions src/modules/csm/csm.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def build_report(self, blockstamp: ReferenceBlockStamp) -> tuple:
if not distributed and not shares:
logger.info({"msg": "No shares distributed in the current frame"})
return ReportData(
self.report_contract.get_consensus_version(blockstamp.block_hash),
self.get_consensus_version(blockstamp),
blockstamp.ref_slot,
tree_root=prev_root,
tree_cid=prev_cid or "",
Expand All @@ -131,7 +131,7 @@ def build_report(self, blockstamp: ReferenceBlockStamp) -> tuple:
tree_cid = self.publish_tree(tree)

return ReportData(
self.report_contract.get_consensus_version(blockstamp.block_hash),
self.get_consensus_version(blockstamp),
blockstamp.ref_slot,
tree_root=tree.root,
tree_cid=tree_cid,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/ejector/ejector.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def build_report(self, blockstamp: ReferenceBlockStamp) -> tuple:
data, data_format = encode_data(validators)

report_data = ReportData(
self.report_contract.get_consensus_version(blockstamp.block_hash),
self.get_consensus_version(blockstamp),
blockstamp.ref_slot,
len(validators),
data_format,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/submodules/consensus.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def _process_report_hash(self, blockstamp: ReferenceBlockStamp, report_hash: Hex
logger.info({'msg': 'Consensus reached with provided hash.'})
return None

consensus_version = self.report_contract.get_consensus_version(blockstamp.block_hash)
consensus_version = self.get_consensus_version(blockstamp)

logger.info({'msg': f'Send report hash. Consensus version: [{consensus_version}]'})
self._send_report_hash(blockstamp, report_hash, consensus_version)
Expand Down

0 comments on commit 3376919

Please sign in to comment.