Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tamtamchik committed Jan 7, 2025
1 parent fcc857f commit eac5eb8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/modules/submodules/consensus.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,8 @@ def get_blockstamp_for_report(self, last_finalized_blockstamp: BlockStamp) -> Re
"""
latest_blockstamp = self._get_latest_blockstamp()

force_report = variables.FORCE_REPORTING

# Check if contract is currently reportable
if not self.is_contract_reportable(latest_blockstamp) and not force_report:
if not self.is_contract_reportable(latest_blockstamp):
logger.info({'msg': 'Contract is not reportable.'})
return None

Expand Down
6 changes: 6 additions & 0 deletions src/providers/execution/contracts/accounting.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def handle_oracle_report(
Updates accounting stats, collects EL rewards and distributes collected rewards
if beacon balance increased, performs withdrawal requests finalization
periodically called by the AccountingOracle contract
NB: see `simulate_oracle_report` for simulation details.
"""

report = (
Expand Down Expand Up @@ -61,6 +63,10 @@ def simulate_oracle_report(
) -> CalculatedReportResults:
"""
Simulates the effects of the `handleOracleReport` function without actually updating the contract state.
NB: should be calculated off-chain by calling the simulateOracleReport function with the same arguments as the
handleOracleReport function, while keeping `_withdrawalFinalizationBatches` empty ([]) and `_simulatedShareRate` == 0,
plugging the returned values to the following formula: `_simulatedShareRate = (postTotalPooledEther * 1e27) / postTotalShares`
"""

report = (
Expand Down
4 changes: 0 additions & 4 deletions src/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
GW3_SECRET_KEY: Final = from_file_or_env('GW3_SECRET_KEY')
PINATA_JWT: Final = from_file_or_env('PINATA_JWT')

CHAIN_ID: Final = int(os.getenv('CHAIN_ID', 1))

# - Account -
ACCOUNT = None
MEMBER_PRIV_KEY = from_file_or_env('MEMBER_PRIV_KEY')
Expand Down Expand Up @@ -58,8 +56,6 @@
SUBMIT_DATA_DELAY_IN_SLOTS = 0
CYCLE_SLEEP_IN_SECONDS = 0

FORCE_REPORTING: Final = os.getenv('FORCE_REPORTING', 'False').lower() == 'true'

# HTTP variables
HTTP_REQUEST_TIMEOUT_EXECUTION: Final = int(os.getenv('HTTP_REQUEST_TIMEOUT_EXECUTION', 2 * 60))

Expand Down

0 comments on commit eac5eb8

Please sign in to comment.