diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index 39b3e25..6ec8fbc 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -9,6 +9,10 @@ on: jobs: smoke: name: Testnet Smoke Tests + # The v0.19 line intentionally targets the resolution-kernel train and + # does not support the currently deployed pre-train testnets. Its live + # coverage comes from the cross-repository E2E stack until they upgrade. + if: github.event_name != 'pull_request' || github.base_ref != 'v0.19-dev' runs-on: ubuntu-latest # Bradbury/Asimov RPC reads occasionally stall for 2-3 minutes on # single calls (testnet capacity); with 17 testnet-flagged tests diff --git a/README.md b/README.md index 476569d..1751b16 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,10 @@ To install the GenLayerPY SDK, use the following command: $ pip install genlayer-py ``` +SDK releases follow their corresponding GenLayer protocol release. This +release targets the current resolution-kernel train; use the matching older SDK +release when connecting to an older deployment. + Here’s how to initialize the client and connect to the GenLayer Simulator: ### Reading a Transaction @@ -44,21 +48,20 @@ transaction = client.get_transaction(hash=transaction_hash) ```python from genlayer_py import create_client from genlayer_py.chains import localnet -from genlayer_py.types import TransactionStatus client = create_client(chain=localnet) # Get simplified receipt (default - removes binary data, keeps execution results) receipt = client.wait_for_transaction_receipt( transaction_hash="0x...", - status=TransactionStatus.FINALIZED, + wait_until="finalized", full_transaction=False # Default - simplified for readability ) # Get complete receipt with all fields full_receipt = client.wait_for_transaction_receipt( transaction_hash="0x...", - status=TransactionStatus.FINALIZED, + wait_until="finalized", full_transaction=True # Complete receipt with all internal data ) ``` @@ -101,7 +104,7 @@ transaction_hash = client.write_contract( ) receipt = client.wait_for_transaction_receipt( hash=transaction_hash, - status=TransactionStatus.FINALIZED, // or ACCEPTED + wait_until="finalized", full_transaction=False // False by default - returns simplified receipt for better readability ) ``` @@ -117,7 +120,6 @@ estimate = client.estimate_transaction_fees( { "leaderTimeunitsAllocation": 100, "validatorTimeunitsAllocation": 200, - "rotations": [0], } ) @@ -133,6 +135,11 @@ tx_hash = client.write_contract( ) ``` +When `rotations` is omitted, estimates fund +`chain.default_consensus_max_rotations` for the initial round and every enabled +appeal round. Pass an explicit list, including `[0]`, when the application wants +to fund a different number of rotations. + If `fees["distribution"]` is provided without `feeValue`, the SDK derives the fee deposit from FeeManager on network backends, or from `sim_getFeeConfig` on Studio. Use `messageAllocations` with `estimate_transaction_fees` for @@ -254,18 +261,26 @@ client.top_up_fees( }, ) -client.top_up_and_submit_appeal( - transaction_id=tx_hash, - value=1_400, - distribution={ - "appealRounds": 1, - "rotations": [0, 0], - }, -) +quote = client.get_appeal_quote(tx_hash) +if client.can_appeal(tx_hash, expected_decision_id=quote["decision_id"]): + client.top_up_and_submit_appeal( + transaction_id=tx_hash, + expected_decision_id=quote["decision_id"], + value=quote["total"], + distribution={ + "appealRounds": 1, + "rotations": [0, 0], + }, + ) ``` `top_up_fees` returns the backend RPC hash. On network backends this is the EVM transaction hash; on Studio/localnet it is the target GenLayer transaction id. +Appeal commands are guarded by the quoted decision id so a stale request cannot +bind to a newer decision. If the id and value are omitted, the SDK refreshes +this lightweight quote automatically. This applies to deployed Consensus. +Current Studio uses its native decision-free appeal methods: pass ``value`` +explicitly and omit ``expected_decision_id``. ### Checking execution results @@ -274,13 +289,13 @@ A transaction can be finalized by consensus but still have a failed execution. A ```python from genlayer_py import create_client, create_account from genlayer_py.chains import testnet_bradbury -from genlayer_py.types import TransactionStatus, ExecutionResult +from genlayer_py.types import ExecutionResult client = create_client(chain=testnet_bradbury, account=create_account()) receipt = client.wait_for_transaction_receipt( transaction_hash=tx_hash, - status=TransactionStatus.FINALIZED, + wait_until="finalized", ) if receipt.get("tx_execution_result_name") == ExecutionResult.FINISHED_WITH_RETURN.value: @@ -305,6 +320,27 @@ Transactions can emit messages to other contracts. These messages create new chi ```python tx = client.get_transaction(transaction_hash=tx_hash) +# The default lifecycle is derived only from stored chain state. +print(tx["lifecycle"]) +# {"state": "processing", "phase": "revealing"} +# {"state": "decided", "outcome": "accepted"} + +# Protocol projection/action details are available only through the explicit +# advanced API. +raw_lifecycle = client.get_transaction_lifecycle(transaction_hash=tx_hash) +print(raw_lifecycle["stored_status_name"]) +print(raw_lifecycle["projected_status_name"]) +print(raw_lifecycle["resolution_action_name"]) +print(raw_lifecycle["resolution_source_name"]) +# `resolution_action_name == "Finalize"` is the authoritative readiness verdict. +# On current Studio without the advanced lifecycle RPC, only stored status is +# provable; projection repeats it and resolution/decision fields stay inactive. + +# The train stores the execution hash, not the old receipt bytes. +print(tx["tx_execution_hash"]) +# `tx_receipt` remains present but is `None` when the +# protocol cannot supply the old bytes. + # Messages emitted by the contract during execution print(tx["messages"]) # [{"messageType": 1, "recipient": "0x...", "value": 0, "data": "0x...", "onAcceptance": True, "saltNonce": 0}, ...] @@ -315,6 +351,20 @@ print(child_tx_ids) # ["0xabc...", "0xdef..."] ``` +### Active and joined validators + +The active set contains only validators currently eligible for protocol +duties. The joined registry is broader and can include validators that are not +yet selectable, are under-staked, or are otherwise unavailable. + +```python +active = client.active_validators() +active_count = client.active_validators_count() + +joined = client.joined_validators() +joined_count = client.joined_validators_count() +``` + ### Debugging transaction execution Use `debug_trace_transaction` to inspect the full execution trace of a transaction, including return data, errors, and GenVM logs: diff --git a/docs/api-references/api.md b/docs/api-references/api.md index 92046fb..6c8844e 100644 --- a/docs/api-references/api.md +++ b/docs/api-references/api.md @@ -64,19 +64,19 @@ client.initialize_consensus_smart_contract(force_reset: bool = False) Executes a read-only contract call without modifying state. ```python -client.read_contract(address: Union, function_name: str, args: Union = None, kwargs: Union = None, account: Union = None, raw_return: bool = False, transaction_hash_variant: TransactionHashVariant = , sim_config: Union = None) +client.read_contract(address: Union, function_name: str, args: Optional = None, kwargs: Optional = None, account: Optional = None, raw_return: bool = False, transaction_hash_variant: TransactionHashVariant = , sim_config: Optional = None) ``` | Parameter | Type | Required | Default | |-----------|------|----------|---------| | address | `Union` | yes | | | function_name | `str` | yes | | -| args | `Union` | no | None | -| kwargs | `Union` | no | None | -| account | `Union` | no | None | +| args | `Optional` | no | None | +| kwargs | `Optional` | no | None | +| account | `Optional` | no | None | | raw_return | `bool` | no | False | | transaction_hash_variant | `TransactionHashVariant` | no | | -| sim_config | `Union` | no | None | +| sim_config | `Optional` | no | None | --- @@ -85,20 +85,22 @@ client.read_contract(address: Union, function_name: str, args: Union = None, kwa Executes a state-modifying function on a contract through consensus. Returns the transaction hash. ```python -client.write_contract(address: Union, function_name: str, account: Union = None, consensus_max_rotations: Union = None, value: int = 0, leader_only: bool = False, args: Union = None, kwargs: Union = None, sim_config: Union = None) +client.write_contract(address: Union, function_name: str, account: Optional = None, consensus_max_rotations: Optional = None, value: int = 0, leader_only: bool = False, args: Optional = None, kwargs: Optional = None, sim_config: Optional = None, valid_until: Optional = None, fees: Optional = None) ``` | Parameter | Type | Required | Default | |-----------|------|----------|---------| | address | `Union` | yes | | | function_name | `str` | yes | | -| account | `Union` | no | None | -| consensus_max_rotations | `Union` | no | None | +| account | `Optional` | no | None | +| consensus_max_rotations | `Optional` | no | None | | value | `int` | no | 0 | | leader_only | `bool` | no | False | -| args | `Union` | no | None | -| kwargs | `Union` | no | None | -| sim_config | `Union` | no | None | +| args | `Optional` | no | None | +| kwargs | `Optional` | no | None | +| sim_config | `Optional` | no | None | +| valid_until | `Optional` | no | None | +| fees | `Optional` | no | None | --- @@ -107,17 +109,20 @@ client.write_contract(address: Union, function_name: str, account: Union = None, Simulates a state-modifying contract call without executing on-chain. Localnet only. ```python -client.simulate_write_contract(address: Union, function_name: str, account: Union = None, args: Union = None, kwargs: Union = None, sim_config: Union = None, transaction_hash_variant: TransactionHashVariant = ) +client.simulate_write_contract(address: Union, function_name: str, account: Optional = None, args: Optional = None, kwargs: Optional = None, value: int = 0, leader_only: bool = False, fees: Optional = None, sim_config: Optional = None, transaction_hash_variant: TransactionHashVariant = ) ``` | Parameter | Type | Required | Default | |-----------|------|----------|---------| | address | `Union` | yes | | | function_name | `str` | yes | | -| account | `Union` | no | None | -| args | `Union` | no | None | -| kwargs | `Union` | no | None | -| sim_config | `Union` | no | None | +| account | `Optional` | no | None | +| args | `Optional` | no | None | +| kwargs | `Optional` | no | None | +| value | `int` | no | 0 | +| leader_only | `bool` | no | False | +| fees | `Optional` | no | None | +| sim_config | `Optional` | no | None | | transaction_hash_variant | `TransactionHashVariant` | no | | --- @@ -127,18 +132,20 @@ client.simulate_write_contract(address: Union, function_name: str, account: Unio Deploys a new intelligent contract to GenLayer. Returns the transaction hash. ```python -client.deploy_contract(code: Union, account: Union = None, args: Union = None, kwargs: Union = None, consensus_max_rotations: Union = None, leader_only: bool = False, sim_config: Union = None) +client.deploy_contract(code: Union, account: Optional = None, args: Optional = None, kwargs: Optional = None, consensus_max_rotations: Optional = None, leader_only: bool = False, sim_config: Optional = None, valid_until: Optional = None, fees: Optional = None) ``` | Parameter | Type | Required | Default | |-----------|------|----------|---------| | code | `Union` | yes | | -| account | `Union` | no | None | -| args | `Union` | no | None | -| kwargs | `Union` | no | None | -| consensus_max_rotations | `Union` | no | None | +| account | `Optional` | no | None | +| args | `Optional` | no | None | +| kwargs | `Optional` | no | None | +| consensus_max_rotations | `Optional` | no | None | | leader_only | `bool` | no | False | -| sim_config | `Union` | no | None | +| sim_config | `Optional` | no | None | +| valid_until | `Optional` | no | None | +| fees | `Optional` | no | None | --- @@ -177,31 +184,188 @@ client.get_contract_schema_for_code(contract_code: AnyStr) ### appeal_transaction Appeals a consensus transaction to trigger a new round of validation. +Returns the original transaction_id (appeals operate on the same tx). +Deployed Consensus fills missing decision/value inputs from its +authoritative quote. Current Studio requires an explicit value and does +not accept ``expected_decision_id``. ```python -client.appeal_transaction(transaction_id: HexStr, account: Union = None, value: int = 0) +client.appeal_transaction(transaction_id: HexStr, account: Optional = None, value: Optional = None, expected_decision_id: Optional = None) ``` | Parameter | Type | Required | Default | |-----------|------|----------|---------| | transaction_id | `HexStr` | yes | | -| account | `Union` | no | None | -| value | `int` | no | 0 | +| account | `Optional` | no | None | +| value | `Optional` | no | None | +| expected_decision_id | `Optional` | no | None | + +--- + +### top_up_fees + +Deposits additional fee budget for an existing consensus transaction. + +```python +client.top_up_fees(transaction_id: HexStr, distribution: FeesDistributionInput, value: int, account: Optional = None) +``` + +| Parameter | Type | Required | Default | +|-----------|------|----------|---------| +| transaction_id | `HexStr` | yes | | +| distribution | `FeesDistributionInput` | yes | | +| value | `int` | yes | | +| account | `Optional` | no | None | + +**Returns:** `HexStr` + +--- + +### top_up_and_submit_appeal + +Deposits appeal funding and submits an appeal. + +On deployed Consensus, omitted decision/value inputs are resolved from +the authoritative appeal quote. Current Studio requires an explicit +value and does not accept ``expected_decision_id``. + +```python +client.top_up_and_submit_appeal(transaction_id: HexStr, distribution: FeesDistributionInput, account: Optional = None, value: Optional = None, expected_decision_id: Optional = None) +``` + +| Parameter | Type | Required | Default | +|-----------|------|----------|---------| +| transaction_id | `HexStr` | yes | | +| distribution | `FeesDistributionInput` | yes | | +| account | `Optional` | no | None | +| value | `Optional` | no | None | +| expected_decision_id | `Optional` | no | None | + +**Returns:** `HexStr` + +--- + +### can_appeal + +Checks whether the exact active decision can be appealed on a network. + +This decision-bound read is not available on current Studio. + +```python +client.can_appeal(transaction_id: HexStr, expected_decision_id: Optional = None) +``` + +| Parameter | Type | Required | Default | +|-----------|------|----------|---------| +| transaction_id | `HexStr` | yes | | +| expected_decision_id | `Optional` | no | None | + +**Returns:** `bool` + +--- + +### get_appeal_quote + +Returns a network's latest decision id, appeal charges, and deadline. + +Current Studio has no decision-bound quote surface. + +```python +client.get_appeal_quote(transaction_id: HexStr) +``` + +| Parameter | Type | Required | Default | +|-----------|------|----------|---------| +| transaction_id | `HexStr` | yes | | + +**Returns:** `Dict` + +--- + +### get_appeal_charge + +Returns the full appeal payment (bond plus induced-work funding). + +Current Studio has no decision-bound quote surface. + +```python +client.get_appeal_charge(transaction_id: HexStr) +``` + +| Parameter | Type | Required | Default | +|-----------|------|----------|---------| +| transaction_id | `HexStr` | yes | | + +**Returns:** `int` + +--- + +### get_min_appeal_bond + +Deprecated alias for :meth:`get_appeal_charge`. + +```python +client.get_min_appeal_bond(transaction_id: HexStr) +``` + +| Parameter | Type | Required | Default | +|-----------|------|----------|---------| +| transaction_id | `HexStr` | yes | | + +**Returns:** `int` + +--- + +### wait_for_decision + +Poll until the stored transaction state is decided or terminal. + +```python +client.wait_for_decision(transaction_hash: Union, interval: int = 3000, retries: int = 10, full_transaction: bool = False) +``` + +| Parameter | Type | Required | Default | +|-----------|------|----------|---------| +| transaction_hash | `Union` | yes | | +| interval | `int` | no | 3000 | +| retries | `int` | no | 10 | +| full_transaction | `bool` | no | False | + +**Returns:** `GenLayerTransaction` + +--- + +### wait_for_finalization + +Poll until the stored transaction state is finalized. + +```python +client.wait_for_finalization(transaction_hash: Union, interval: int = 3000, retries: int = 10, full_transaction: bool = False) +``` + +| Parameter | Type | Required | Default | +|-----------|------|----------|---------| +| transaction_hash | `Union` | yes | | +| interval | `int` | no | 3000 | +| retries | `int` | no | 10 | +| full_transaction | `bool` | no | False | + +**Returns:** `GenLayerTransaction` --- ### wait_for_transaction_receipt -Polls until a transaction reaches the specified status. Returns the transaction receipt. +Poll for a stored decision (default) or stored finalization. ```python -client.wait_for_transaction_receipt(transaction_hash: Union, status: TransactionStatus = , interval: int = 3000, retries: int = 10, full_transaction: bool = False) +client.wait_for_transaction_receipt(transaction_hash: Union, wait_until: Literal = 'decided', interval: int = 3000, retries: int = 10, full_transaction: bool = False) ``` | Parameter | Type | Required | Default | |-----------|------|----------|---------| | transaction_hash | `Union` | yes | | -| status | `TransactionStatus` | no | | +| wait_until | `Literal` | no | 'decided' | | interval | `int` | no | 3000 | | retries | `int` | no | 10 | | full_transaction | `bool` | no | False | @@ -212,7 +376,12 @@ client.wait_for_transaction_receipt(transaction_hash: Union, status: Transaction ### get_transaction -Fetches transaction data including status, execution result, and consensus details. +Fetch transaction data with a stable stored-state ``lifecycle``. + +The lifecycle's ``state`` is one of processing, decided, finalized, or +canceled. Processing carries ``phase`` and decided carries ``outcome``. +The train exposes ``tx_execution_hash``; legacy receipt bytes are +unavailable, so ``tx_receipt`` is ``None``. ```python client.get_transaction(transaction_hash: Union) @@ -226,6 +395,27 @@ client.get_transaction(transaction_hash: Union) --- +### get_transaction_lifecycle + +Return advanced stored/projected/action protocol lifecycle data. + +If current Studio does not expose the advanced RPC, only its provable +stored status is returned: projection repeats it, resolution is +NoOp/Unspecified, and decision identity is inactive. + +```python +client.get_transaction_lifecycle(transaction_hash: Union, timestamp: Optional = None) +``` + +| Parameter | Type | Required | Default | +|-----------|------|----------|---------| +| transaction_hash | `Union` | yes | | +| timestamp | `Optional` | no | None | + +**Returns:** `ProtocolTransactionLifecycle` + +--- + ### get_triggered_transaction_ids Returns transaction IDs of child transactions created from emitted messages. @@ -261,29 +451,6 @@ client.debug_trace_transaction(transaction_hash: Union, round: int = 0) ## Types and Enums -### TransactionStatus - -Status of a GenLayer transaction in the consensus lifecycle. - -```python -TransactionStatus.UNINITIALIZED = "UNINITIALIZED" -TransactionStatus.PENDING = "PENDING" -TransactionStatus.PROPOSING = "PROPOSING" -TransactionStatus.COMMITTING = "COMMITTING" -TransactionStatus.REVEALING = "REVEALING" -TransactionStatus.ACCEPTED = "ACCEPTED" -TransactionStatus.UNDETERMINED = "UNDETERMINED" -TransactionStatus.FINALIZED = "FINALIZED" -TransactionStatus.CANCELED = "CANCELED" -TransactionStatus.APPEAL_REVEALING = "APPEAL_REVEALING" -TransactionStatus.APPEAL_COMMITTING = "APPEAL_COMMITTING" -TransactionStatus.READY_TO_FINALIZE = "READY_TO_FINALIZE" -TransactionStatus.VALIDATORS_TIMEOUT = "VALIDATORS_TIMEOUT" -TransactionStatus.LEADER_TIMEOUT = "LEADER_TIMEOUT" -``` - ---- - ### TransactionResult Consensus voting result across validators. @@ -297,6 +464,7 @@ TransactionResult.DETERMINISTIC_VIOLATION = "DETERMINISTIC_VIOLATION" TransactionResult.NO_MAJORITY = "NO_MAJORITY" TransactionResult.MAJORITY_AGREE = "MAJORITY_AGREE" TransactionResult.MAJORITY_DISAGREE = "MAJORITY_DISAGREE" +TransactionResult.MAJORITY_TIMEOUT = "MAJORITY_TIMEOUT" ``` --- @@ -309,28 +477,23 @@ Result of contract execution by the GenVM. ExecutionResult.NOT_VOTED = "NOT_VOTED" ExecutionResult.FINISHED_WITH_RETURN = "FINISHED_WITH_RETURN" ExecutionResult.FINISHED_WITH_ERROR = "FINISHED_WITH_ERROR" +ExecutionResult.TIMEOUT = "TIMEOUT" +ExecutionResult.NONDET_DISAGREE = "NONDET_DISAGREE" +ExecutionResult.DETERMINISTIC_VIOLATION = "DETERMINISTIC_VIOLATION" ``` --- ### VoteType -str(object='') -> str -str(bytes_or_buffer[, encoding[, errors]]) -> str - -Create a new string object from the given object. If encoding or -errors is specified, then the object must expose a data buffer -that will be decoded using the given encoding and error handler. -Otherwise, returns the result of object.__str__() (if defined) -or repr(object). -encoding defaults to 'utf-8'. -errors defaults to 'strict'. +Validator execution vote recorded for a consensus round. ```python VoteType.NOT_VOTED = "NOT_VOTED" -VoteType.AGREE = "AGREE" -VoteType.DISAGREE = "DISAGREE" +VoteType.FINISHED_WITH_RETURN = "FINISHED_WITH_RETURN" +VoteType.FINISHED_WITH_ERROR = "FINISHED_WITH_ERROR" VoteType.TIMEOUT = "TIMEOUT" +VoteType.NONDET_DISAGREE = "NONDET_DISAGREE" VoteType.DETERMINISTIC_VIOLATION = "DETERMINISTIC_VIOLATION" ``` diff --git a/docs/api-references/genlayer-py.md b/docs/api-references/genlayer-py.md index b844f06..7cca50f 100644 --- a/docs/api-references/genlayer-py.md +++ b/docs/api-references/genlayer-py.md @@ -192,16 +192,16 @@ client.appeal_transaction(transaction_id: HexStr, account: Union = None, value: ### wait_for_transaction_receipt -Polls until a transaction reaches the specified status. Returns the transaction receipt. +Polls for a stored decision by default, or for stored finalization. ```python -client.wait_for_transaction_receipt(transaction_hash: Union, status: TransactionStatus = , interval: int = 3000, retries: int = 10, full_transaction: bool = False) +client.wait_for_transaction_receipt(transaction_hash: Union, wait_until: Literal = "decided", interval: int = 3000, retries: int = 10, full_transaction: bool = False) ``` **Parameters:** - **transaction_hash** (`Union`) — required -- **status** (`TransactionStatus`) — optional = +- **wait_until** (`Literal["decided", "finalized"]`) — optional = "decided" - **interval** (`int`) — optional = 3000 - **retries** (`int`) — optional = 10 - **full_transaction** (`bool`) — optional = False @@ -210,9 +210,30 @@ client.wait_for_transaction_receipt(transaction_hash: Union, status: Transaction --- +### wait_for_decision + +Polls until the stored transaction state is decided, finalized, or canceled. + +```python +client.wait_for_decision(transaction_hash: Union, interval: int = 3000, retries: int = 10, full_transaction: bool = False) +``` + +--- + +### wait_for_finalization + +Polls until the stored transaction state is finalized. + +```python +client.wait_for_finalization(transaction_hash: Union, interval: int = 3000, retries: int = 10, full_transaction: bool = False) +``` + +--- + ### get_transaction -Fetches transaction data including status, execution result, and consensus details. +Fetches transaction data with a stable lifecycle derived from stored chain +state, plus execution result and consensus details. ```python client.get_transaction(transaction_hash: Union) @@ -224,6 +245,25 @@ client.get_transaction(transaction_hash: Union) **Returns:** `GenLayerTransaction` +`lifecycle` is discriminated by its `state` field: processing carries `phase`, +decided carries `outcome`, finalized may carry an outcome when it is actually +known, and canceled has no extra branch data. + +The train exposes the authoritative `tx_execution_hash`. It does not retain the +old receipt bytes, so the legacy `tx_receipt` field is `None`. + +--- + +### get_transaction_lifecycle + +Returns the advanced raw protocol view: stored status, projected status, +resolution action/source, decision identity, and evaluation time. A `FINALIZE` +action is the authoritative finalization-readiness verdict. + +```python +client.get_transaction_lifecycle(transaction_hash: Union) +``` + --- ### get_triggered_transaction_ids @@ -261,29 +301,6 @@ client.debug_trace_transaction(transaction_hash: Union, round: int = 0) ## Types and Enums -### TransactionStatus - -Status of a GenLayer transaction in the consensus lifecycle. - -```python -TransactionStatus.UNINITIALIZED = "UNINITIALIZED" -TransactionStatus.PENDING = "PENDING" -TransactionStatus.PROPOSING = "PROPOSING" -TransactionStatus.COMMITTING = "COMMITTING" -TransactionStatus.REVEALING = "REVEALING" -TransactionStatus.ACCEPTED = "ACCEPTED" -TransactionStatus.UNDETERMINED = "UNDETERMINED" -TransactionStatus.FINALIZED = "FINALIZED" -TransactionStatus.CANCELED = "CANCELED" -TransactionStatus.APPEAL_REVEALING = "APPEAL_REVEALING" -TransactionStatus.APPEAL_COMMITTING = "APPEAL_COMMITTING" -TransactionStatus.READY_TO_FINALIZE = "READY_TO_FINALIZE" -TransactionStatus.VALIDATORS_TIMEOUT = "VALIDATORS_TIMEOUT" -TransactionStatus.LEADER_TIMEOUT = "LEADER_TIMEOUT" -``` - ---- - ### TransactionResult Consensus voting result across validators. @@ -309,28 +326,23 @@ Result of contract execution by the GenVM. ExecutionResult.NOT_VOTED = "NOT_VOTED" ExecutionResult.FINISHED_WITH_RETURN = "FINISHED_WITH_RETURN" ExecutionResult.FINISHED_WITH_ERROR = "FINISHED_WITH_ERROR" +ExecutionResult.TIMEOUT = "TIMEOUT" +ExecutionResult.NONDET_DISAGREE = "NONDET_DISAGREE" +ExecutionResult.DETERMINISTIC_VIOLATION = "DETERMINISTIC_VIOLATION" ``` --- ### VoteType -str(object='') -> str -str(bytes_or_buffer[, encoding[, errors]]) -> str - -Create a new string object from the given object. If encoding or -errors is specified, then the object must expose a data buffer -that will be decoded using the given encoding and error handler. -Otherwise, returns the result of object.__str__() (if defined) -or repr(object). -encoding defaults to 'utf-8'. -errors defaults to 'strict'. +Validator execution vote recorded for a consensus round. ```python VoteType.NOT_VOTED = "NOT_VOTED" -VoteType.AGREE = "AGREE" -VoteType.DISAGREE = "DISAGREE" +VoteType.FINISHED_WITH_RETURN = "FINISHED_WITH_RETURN" +VoteType.FINISHED_WITH_ERROR = "FINISHED_WITH_ERROR" VoteType.TIMEOUT = "TIMEOUT" +VoteType.NONDET_DISAGREE = "NONDET_DISAGREE" VoteType.DETERMINISTIC_VIOLATION = "DETERMINISTIC_VIOLATION" ``` diff --git a/docs/api-references/index.md b/docs/api-references/index.md index 0df4eae..0eba21a 100644 --- a/docs/api-references/index.md +++ b/docs/api-references/index.md @@ -20,6 +20,10 @@ To install the GenLayerPY SDK, use the following command: $ pip install genlayer-py ``` +SDK releases follow their corresponding GenLayer protocol release. This +release targets the current resolution-kernel train; use the matching older SDK +release when connecting to an older deployment. + Here’s how to initialize the client and connect to the GenLayer Simulator: ### Reading a Transaction @@ -41,21 +45,20 @@ transaction = client.get_transaction(hash=transaction_hash) ```python from genlayer_py import create_client from genlayer_py.chains import localnet -from genlayer_py.types import TransactionStatus client = create_client(chain=localnet) # Get simplified receipt (default - removes binary data, keeps execution results) receipt = client.wait_for_transaction_receipt( transaction_hash="0x...", - status=TransactionStatus.FINALIZED, + wait_until="finalized", full_transaction=False # Default - simplified for readability ) # Get complete receipt with all fields full_receipt = client.wait_for_transaction_receipt( transaction_hash="0x...", - status=TransactionStatus.FINALIZED, + wait_until="finalized", full_transaction=True # Complete receipt with all internal data ) ``` @@ -98,11 +101,184 @@ transaction_hash = client.write_contract( ) receipt = client.wait_for_transaction_receipt( hash=transaction_hash, - status=TransactionStatus.FINALIZED, // or ACCEPTED + wait_until="finalized", full_transaction=False // False by default - returns simplified receipt for better readability ) ``` +### Fee presets for transactions + +Apps can build a trusted fee preset once they know the transaction shape, then +submit the same preset with the transaction. The user may still override these +values in wallet or app UI before signing. + +```python +estimate = client.estimate_transaction_fees( + { + "leaderTimeunitsAllocation": 100, + "validatorTimeunitsAllocation": 200, + } +) + +tx_hash = client.write_contract( + account=account, + address=contract_address, + function_name="update_storage", + args=["new_storage"], + fees={ + "distribution": estimate["distribution"], + "feeValue": estimate["feeValue"], + }, +) +``` + +When `rotations` is omitted, estimates fund +`chain.default_consensus_max_rotations` for the initial round and every enabled +appeal round. Pass an explicit list, including `[0]`, when the application wants +to fund a different number of rotations. + +If `fees["distribution"]` is provided without `feeValue`, the SDK derives the +fee deposit from FeeManager on network backends, or from `sim_getFeeConfig` on +Studio. Use `messageAllocations` with `estimate_transaction_fees` for +transactions that can emit funded messages. For method-specific message +budgets, derive the same call key GenVM reports in fee accounting: + +```python +from genlayer_py.transactions import ( + MessageType, + derive_external_message_call_key, + derive_internal_message_call_key, + encode_external_message_fee_params, + encode_internal_message_fee_params, +) + +estimate = client.estimate_transaction_fees( + { + "messageAllocations": [ + { + "messageType": MessageType.Internal, + "onAcceptance": True, + "recipient": contract_address, + "callKey": derive_internal_message_call_key("update_storage"), + "budget": 55, + "feeParams": encode_internal_message_fee_params(), + }, + { + "messageType": MessageType.External, + "onAcceptance": False, + "recipient": "0x3333333333333333333333333333333333333333", + "callKey": derive_external_message_call_key("0xaabbccdd"), + "budget": 210_000, + "feeParams": encode_external_message_fee_params( + {"gasLimit": 21_000, "maxGasPrice": 10} + ), + }, + ], + } +) +``` + +For a concrete Studio/localnet write, use the one-call helper. The SDK sends an +initial fee budget to `sim_estimateTransactionFees`; Studio simulates the write +without committing state and returns the authoritative recommended preset. + +```python +recommended = client.estimate_transaction_fees_for_write( + account=account, + address=contract_address, + function_name="update_storage", + args=["new_storage"], +) + +tx_hash = client.write_contract( + account=account, + address=contract_address, + function_name="update_storage", + args=["new_storage"], + fees={ + "distribution": recommended["distribution"], + "messageAllocations": recommended.get("messageAllocations"), + "feeValue": recommended["feeValue"], + }, +) +``` + +For tests or tools that need to inspect the raw simulation, use the explicit +two-step flow. `simulate_write_contract` uses `sim_call`; the returned receipt +includes the fee accounting report produced by GenVM and Studio: + +```python +simulation = client.simulate_write_contract( + account=account, + address=contract_address, + function_name="update_storage", + args=["new_storage"], + fees={ + "distribution": estimate["distribution"], + "feeValue": estimate["feeValue"], + }, +) + +print(simulation["genvm_result"]["fee_accounting"]) +``` + +To reuse a representative Studio simulation as the trusted preset source, pass +the simulation result into `estimate_transaction_fees_from_simulation`: + +```python +estimate = client.estimate_transaction_fees_from_simulation( + { + "simulation": simulation, + } +) + +tx_hash = client.write_contract( + account=account, + address=contract_address, + function_name="update_storage", + args=["new_storage"], + fees={ + "distribution": estimate["distribution"], + "messageAllocations": estimate.get("messageAllocations"), + "feeValue": estimate["feeValue"], + }, +) +``` + +For transactions that are already submitted, use the fee-management helpers: + +```python +client.top_up_fees( + transaction_id=tx_hash, + value=1_100, + distribution={ + "leaderTimeunitsAllocation": 100, + "validatorTimeunitsAllocation": 200, + "rotations": [0], + }, +) + +quote = client.get_appeal_quote(tx_hash) +if client.can_appeal(tx_hash, expected_decision_id=quote["decision_id"]): + client.top_up_and_submit_appeal( + transaction_id=tx_hash, + expected_decision_id=quote["decision_id"], + value=quote["total"], + distribution={ + "appealRounds": 1, + "rotations": [0, 0], + }, + ) +``` + +`top_up_fees` returns the backend RPC hash. On network backends this is the EVM +transaction hash; on Studio/localnet it is the target GenLayer transaction id. +Appeal commands are guarded by the quoted decision id so a stale request cannot +bind to a newer decision. If the id and value are omitted, the SDK refreshes +this lightweight quote automatically. This applies to deployed Consensus. +Current Studio uses its native decision-free appeal methods: pass ``value`` +explicitly and omit ``expected_decision_id``. + ### Checking execution results A transaction can be finalized by consensus but still have a failed execution. Always check `tx_execution_result` before reading contract state: @@ -110,13 +286,13 @@ A transaction can be finalized by consensus but still have a failed execution. A ```python from genlayer_py import create_client, create_account from genlayer_py.chains import testnet_bradbury -from genlayer_py.types import TransactionStatus, ExecutionResult +from genlayer_py.types import ExecutionResult client = create_client(chain=testnet_bradbury, account=create_account()) receipt = client.wait_for_transaction_receipt( transaction_hash=tx_hash, - status=TransactionStatus.FINALIZED, + wait_until="finalized", ) if receipt.get("tx_execution_result_name") == ExecutionResult.FINISHED_WITH_RETURN.value: @@ -141,6 +317,27 @@ Transactions can emit messages to other contracts. These messages create new chi ```python tx = client.get_transaction(transaction_hash=tx_hash) +# The default lifecycle is derived only from stored chain state. +print(tx["lifecycle"]) +# {"state": "processing", "phase": "revealing"} +# {"state": "decided", "outcome": "accepted"} + +# Protocol projection/action details are available only through the explicit +# advanced API. +raw_lifecycle = client.get_transaction_lifecycle(transaction_hash=tx_hash) +print(raw_lifecycle["stored_status_name"]) +print(raw_lifecycle["projected_status_name"]) +print(raw_lifecycle["resolution_action_name"]) +print(raw_lifecycle["resolution_source_name"]) +# `resolution_action_name == "Finalize"` is the authoritative readiness verdict. +# On current Studio without the advanced lifecycle RPC, only stored status is +# provable; projection repeats it and resolution/decision fields stay inactive. + +# The train stores the execution hash, not the old receipt bytes. +print(tx["tx_execution_hash"]) +# `tx_receipt` remains present but is `None` when the +# protocol cannot supply the old bytes. + # Messages emitted by the contract during execution print(tx["messages"]) # [{"messageType": 1, "recipient": "0x...", "value": 0, "data": "0x...", "onAcceptance": True, "saltNonce": 0}, ...] @@ -151,6 +348,20 @@ print(child_tx_ids) # ["0xabc...", "0xdef..."] ``` +### Active and joined validators + +The active set contains only validators currently eligible for protocol +duties. The joined registry is broader and can include validators that are not +yet selectable, are under-staked, or are otherwise unavailable. + +```python +active = client.active_validators() +active_count = client.active_validators_count() + +joined = client.joined_validators() +joined_count = client.joined_validators_count() +``` + ### Debugging transaction execution Use `debug_trace_transaction` to inspect the full execution trace of a transaction, including return data, errors, and GenVM logs: diff --git a/genlayer_py/chains/testnet_asimov.py b/genlayer_py/chains/testnet_asimov.py index 8984a80..4a06e6d 100644 --- a/genlayer_py/chains/testnet_asimov.py +++ b/genlayer_py/chains/testnet_asimov.py @@ -1,6 +1,9 @@ from genlayer_py.types import GenLayerChain, NativeCurrency, SimpleContractInfo -from genlayer_py.consensus.abi import CONSENSUS_MAIN_ABI, CONSENSUS_DATA_ABI - +from genlayer_py.consensus.abi import ( + APPEALS_ABI, + CONSENSUS_MAIN_ABI, + CONSENSUS_DATA_ABI, +) TESTNET_JSON_RPC_URL = "https://rpc-asimov.genlayer.com" EXPLORER_URL = "https://explorer-asimov.genlayer.com/" @@ -103,15 +106,7 @@ APPEALS_CONTRACT: SimpleContractInfo = { "address": "0x0F739Dd8f5322b9547c7d19a9621BC2ac8DF4089", - "abi": [ - { - "type": "function", - "name": "canAppeal", - "stateMutability": "view", - "inputs": [{"name": "_txId", "type": "bytes32"}], - "outputs": [{"name": "", "type": "bool"}], - }, - ], + "abi": APPEALS_ABI, } diff --git a/genlayer_py/chains/testnet_bradbury.py b/genlayer_py/chains/testnet_bradbury.py index 352bf3c..44ed0a1 100644 --- a/genlayer_py/chains/testnet_bradbury.py +++ b/genlayer_py/chains/testnet_bradbury.py @@ -1,19 +1,27 @@ -from genlayer_py.types import GenLayerChain, NativeCurrency, ContractInfo, SimpleContractInfo -from genlayer_py.consensus.abi import CONSENSUS_MAIN_ABI_V06, CONSENSUS_DATA_ABI_V06 - +from genlayer_py.types import ( + GenLayerChain, + NativeCurrency, + ContractInfo, + SimpleContractInfo, +) +from genlayer_py.consensus.abi import ( + APPEALS_ABI, + CONSENSUS_MAIN_ABI, + CONSENSUS_DATA_ABI, +) TESTNET_JSON_RPC_URL = "https://rpc-bradbury.genlayer.com" EXPLORER_URL = "https://explorer-bradbury.genlayer.com/" CONSENSUS_MAIN_CONTRACT: ContractInfo = { "address": "0x0112Bf6e83497965A5fdD6Dad1E447a6E004271D", - "abi": CONSENSUS_MAIN_ABI_V06, + "abi": CONSENSUS_MAIN_ABI, "bytecode": "", } CONSENSUS_DATA_CONTRACT: ContractInfo = { "address": "0x85D7bf947A512Fc640C75327A780c90847267697", - "abi": CONSENSUS_DATA_ABI_V06, + "abi": CONSENSUS_DATA_ABI, "bytecode": "", } @@ -103,15 +111,7 @@ APPEALS_CONTRACT: SimpleContractInfo = { "address": "0xbb8C35AA878D09b9830aFF9e5aAC6492BFbd5471", - "abi": [ - { - "type": "function", - "name": "canAppeal", - "stateMutability": "view", - "inputs": [{"name": "_txId", "type": "bytes32"}], - "outputs": [{"name": "", "type": "bool"}], - }, - ], + "abi": APPEALS_ABI, } diff --git a/genlayer_py/client/genlayer_client.py b/genlayer_py/client/genlayer_client.py index a453dc3..77392ca 100644 --- a/genlayer_py/client/genlayer_client.py +++ b/genlayer_py/client/genlayer_client.py @@ -7,7 +7,6 @@ from typing import AnyStr, Literal from genlayer_py.types import ( GenLayerChain, - TransactionStatus, CalldataEncodable, GenLayerTransaction, ContractSchema, @@ -28,6 +27,8 @@ get_round_data, get_last_round_data, can_appeal, + get_appeal_quote, + get_appeal_charge, get_min_appeal_bond, get_contract_schema, get_contract_schema_for_code, @@ -40,11 +41,15 @@ ) from genlayer_py.chains.actions import initialize_consensus_smart_contract from genlayer_py.transactions.actions import ( + wait_for_decision, + wait_for_finalization, wait_for_transaction_receipt, get_transaction, + get_transaction_lifecycle, get_triggered_transaction_ids, debug_trace_transaction, ) +from genlayer_py.types.transactions import ProtocolTransactionLifecycle from genlayer_py.staking.actions import ( validator_join, validator_deposit, @@ -53,6 +58,7 @@ validator_prime, set_operator, get_operator_transfer_context, + get_validator_join_context, initiate_operator_transfer, complete_operator_transfer, cancel_operator_transfer, @@ -64,6 +70,8 @@ epoch as staking_epoch, active_validators, active_validators_count, + joined_validators, + joined_validators_count, is_validator, get_validator_info, get_stake_info, @@ -71,6 +79,10 @@ validator_min_stake, delegator_min_stake, ) +from genlayer_py.staking.operator_registration import ( + OperatorRegistrationContext, + OperatorRegistrationProof, +) from genlayer_py.config import transaction_config from genlayer_py.transactions.fees import ( FeeEstimateOptions, @@ -325,50 +337,112 @@ def top_up_and_submit_appeal( distribution: FeesDistributionInput, account: Optional[LocalAccount] = None, value: Optional[int] = None, + expected_decision_id: Optional[int] = None, ) -> HexStr: - """Deposits appeal fee budget and submits an appeal in one consensus call.""" + """Deposits appeal funding and submits an appeal. + + On deployed Consensus, omitted decision/value inputs are resolved from + the authoritative appeal quote. Current Studio requires an explicit + value and does not accept ``expected_decision_id``. + """ return top_up_and_submit_appeal( self=self, transaction_id=transaction_id, distribution=distribution, account=account, value=value, + expected_decision_id=expected_decision_id, ) # Transaction actions def wait_for_transaction_receipt( self, transaction_hash: _Hash32, - status: Optional[TransactionStatus] = None, - wait_until: Optional[Literal["decided", "finalized"]] = None, + wait_until: Literal["decided", "finalized"] = "decided", interval: int = transaction_config.wait_interval, retries: int = transaction_config.retries, full_transaction: bool = False, ) -> GenLayerTransaction: - """Polls until a transaction reaches the specified status. Returns the transaction receipt.""" + """Poll for a stored decision (default) or stored finalization.""" return wait_for_transaction_receipt( self=self, transaction_hash=transaction_hash, - status=status, wait_until=wait_until, interval=interval, retries=retries, full_transaction=full_transaction, ) + def wait_for_decision( + self, + transaction_hash: _Hash32, + interval: int = transaction_config.wait_interval, + retries: int = transaction_config.retries, + full_transaction: bool = False, + ) -> GenLayerTransaction: + """Poll until the stored transaction state is decided or terminal.""" + return wait_for_decision( + self=self, + transaction_hash=transaction_hash, + interval=interval, + retries=retries, + full_transaction=full_transaction, + ) + + def wait_for_finalization( + self, + transaction_hash: _Hash32, + interval: int = transaction_config.wait_interval, + retries: int = transaction_config.retries, + full_transaction: bool = False, + ) -> GenLayerTransaction: + """Poll until the stored transaction state is finalized.""" + return wait_for_finalization( + self=self, + transaction_hash=transaction_hash, + interval=interval, + retries=retries, + full_transaction=full_transaction, + ) + def get_transaction( self, transaction_hash: _Hash32, ) -> GenLayerTransaction: - """Fetches transaction data including status, execution result, and consensus details.""" + """Fetch transaction data with a stable stored-state ``lifecycle``. + + The lifecycle's ``state`` is one of processing, decided, finalized, or + canceled. Processing carries ``phase`` and decided carries ``outcome``. + The train exposes ``tx_execution_hash``; legacy receipt bytes are + unavailable, so ``tx_receipt`` is ``None``. + """ return get_transaction(self=self, transaction_hash=transaction_hash) + def get_transaction_lifecycle( + self, + transaction_hash: _Hash32, + timestamp: Optional[int] = None, + ) -> ProtocolTransactionLifecycle: + """Return advanced stored/projected/action protocol lifecycle data. + + If current Studio does not expose the advanced RPC, only its provable + stored status is returned: projection repeats it, resolution is + NoOp/Unspecified, and decision identity is inactive. + """ + return get_transaction_lifecycle( + self=self, + transaction_hash=transaction_hash, + timestamp=timestamp, + ) + def get_triggered_transaction_ids( self, transaction_hash: _Hash32, ) -> list: """Returns transaction IDs of child transactions created from emitted messages.""" - return get_triggered_transaction_ids(self=self, transaction_hash=transaction_hash) + return get_triggered_transaction_ids( + self=self, transaction_hash=transaction_hash + ) def debug_trace_transaction( self, @@ -376,21 +450,29 @@ def debug_trace_transaction( round: int = 0, ) -> dict: """Fetches the full execution trace including return data, stdout, stderr, and GenVM logs.""" - return debug_trace_transaction(self=self, transaction_hash=transaction_hash, round=round) + return debug_trace_transaction( + self=self, transaction_hash=transaction_hash, round=round + ) def appeal_transaction( self, transaction_id: HexStr, account: Optional[LocalAccount] = None, value: Optional[int] = None, + expected_decision_id: Optional[int] = None, ): """Appeals a consensus transaction to trigger a new round of validation. - Returns the original transaction_id (appeals operate on the same tx).""" + Returns the original transaction_id (appeals operate on the same tx). + Deployed Consensus fills missing decision/value inputs from its + authoritative quote. Current Studio requires an explicit value and does + not accept ``expected_decision_id``. + """ return appeal_transaction( self=self, transaction_id=transaction_id, account=account, value=value, + expected_decision_id=expected_decision_id, ) def get_round_number(self, transaction_id: HexStr) -> int: @@ -405,12 +487,37 @@ def get_last_round_data(self, transaction_id: HexStr) -> tuple: """Returns the current round number and its data.""" return get_last_round_data(self=self, transaction_id=transaction_id) - def can_appeal(self, transaction_id: HexStr) -> bool: - """Checks if a transaction can be appealed.""" - return can_appeal(self=self, transaction_id=transaction_id) + def can_appeal( + self, + transaction_id: HexStr, + expected_decision_id: Optional[int] = None, + ) -> bool: + """Checks whether the exact active decision can be appealed on a network. + + This decision-bound read is not available on current Studio. + """ + return can_appeal( + self=self, + transaction_id=transaction_id, + expected_decision_id=expected_decision_id, + ) + + def get_appeal_quote(self, transaction_id: HexStr) -> Dict[str, int]: + """Returns a network's latest decision id, appeal charges, and deadline. + + Current Studio has no decision-bound quote surface. + """ + return get_appeal_quote(self=self, transaction_id=transaction_id) + + def get_appeal_charge(self, transaction_id: HexStr) -> int: + """Returns the full appeal payment (bond plus induced-work funding). + + Current Studio has no decision-bound quote surface. + """ + return get_appeal_charge(self=self, transaction_id=transaction_id) def get_min_appeal_bond(self, transaction_id: HexStr) -> int: - """Calculates the minimum bond required to appeal a transaction.""" + """Deprecated alias for :meth:`get_appeal_charge`.""" return get_min_appeal_bond(self=self, transaction_id=transaction_id) # ── Staking actions (EVM, not consensus-layer) ──────────────────── @@ -422,12 +529,21 @@ def staking_epoch(self) -> int: return staking_epoch(self=self) def active_validators(self) -> List: - """Returns ValidatorWallet addresses active in the current epoch.""" + """Returns ValidatorWallet addresses currently eligible for duties.""" return active_validators(self=self) def active_validators_count(self) -> int: + """Returns the number of validators currently eligible for duties.""" return active_validators_count(self=self) + def joined_validators(self) -> List: + """Returns every ValidatorWallet in the append-only joined registry.""" + return joined_validators(self=self) + + def joined_validators_count(self) -> int: + """Returns the size of the append-only joined validator registry.""" + return joined_validators_count(self=self) + def is_validator(self, address) -> bool: return is_validator(self=self, address=address) @@ -451,15 +567,25 @@ def delegator_min_stake(self) -> int: def validator_join( self, amount: int, - operator=None, + registration: Optional[OperatorRegistrationProof] = None, account: Optional[LocalAccount] = None, + operator=None, ) -> HexBytes: - """Joins as a validator. Deploys a ValidatorWallet with msg.sender - as owner and `operator` (defaults to owner) as operator.""" + """Joins with a proof-bound operator key and deploys a ValidatorWallet.""" return validator_join( - self=self, amount=amount, operator=operator, account=account + self=self, + amount=amount, + registration=registration, + account=account, + operator=operator, ) + def get_validator_join_context( + self, account: Optional[LocalAccount] = None + ) -> OperatorRegistrationContext: + """Factory-bound context for building a validator join proof.""" + return get_validator_join_context(self=self, account=account) + def validator_deposit( self, validator, amount: int, account: Optional[LocalAccount] = None ) -> HexBytes: @@ -490,7 +616,7 @@ def validator_prime( def set_operator( self, validator, operator, account: Optional[LocalAccount] = None ) -> HexBytes: - """Rotates the operator for an existing ValidatorWallet.""" + """Raises with migration guidance for proof-based operator rotation.""" return set_operator( self=self, validator=validator, operator=operator, account=account ) @@ -519,9 +645,7 @@ def cancel_operator_transfer( self, validator, account: Optional[LocalAccount] = None ) -> HexBytes: """Abandons a pending operator rotation.""" - return cancel_operator_transfer( - self=self, validator=validator, account=account - ) + return cancel_operator_transfer(self=self, validator=validator, account=account) def get_pending_operator(self, validator) -> dict: """Pending operator and when its transfer was initiated.""" diff --git a/genlayer_py/consensus/abi/__init__.py b/genlayer_py/consensus/abi/__init__.py index 86bef2c..5c5c920 100644 --- a/genlayer_py/consensus/abi/__init__.py +++ b/genlayer_py/consensus/abi/__init__.py @@ -1,37 +1,45 @@ import json import importlib.resources -with importlib.resources.as_file( - importlib.resources.files("genlayer_py.consensus.abi").joinpath( - "consensus_data_abi.json" - ) -) as path, open(path, "r", encoding="utf-8") as f: - CONSENSUS_DATA_ABI = json.load(f) -with importlib.resources.as_file( - importlib.resources.files("genlayer_py.consensus.abi").joinpath( - "consensus_main_abi.json" - ) -) as path, open(path, "r", encoding="utf-8") as f: - CONSENSUS_MAIN_ABI = json.load(f) +def _load_abi(name: str): + with ( + importlib.resources.as_file( + importlib.resources.files("genlayer_py.consensus.abi").joinpath(name) + ) as path, + open(path, "r", encoding="utf-8") as file, + ): + return json.load(file) -with importlib.resources.as_file( - importlib.resources.files("genlayer_py.consensus.abi").joinpath( - "consensus_data_abi_v06.json" - ) -) as path, open(path, "r", encoding="utf-8") as f: - CONSENSUS_DATA_ABI_V06 = json.load(f) -with importlib.resources.as_file( - importlib.resources.files("genlayer_py.consensus.abi").joinpath( - "consensus_main_abi_v06.json" - ) -) as path, open(path, "r", encoding="utf-8") as f: - CONSENSUS_MAIN_ABI_V06 = json.load(f) +CONSENSUS_DATA_LIFECYCLE_ABI = _load_abi("consensus_data_lifecycle_abi.json") +CONSENSUS_DATA_TRAIN_READS_ABI = _load_abi("consensus_data_train_reads_abi.json") +CONSENSUS_DATA_TRAIN_ABI = CONSENSUS_DATA_LIFECYCLE_ABI + CONSENSUS_DATA_TRAIN_READS_ABI +CONSENSUS_DATA_ABI = _load_abi("consensus_data_abi.json") +CONSENSUS_MAIN_ABI = _load_abi("consensus_main_abi.json") +APPEALS_ABI = _load_abi("appeals_abi.json") + +# Preserve the historical import names without preserving an old contract +# surface. This SDK release targets the train ABI only. +CONSENSUS_DATA_ABI_V06 = CONSENSUS_DATA_ABI +CONSENSUS_MAIN_ABI_V06 = CONSENSUS_MAIN_ABI + +CONSENSUS_DATA_BIG_ROUNDS_ABI = _load_abi("consensus_data_big_rounds_abi.json") +ADDRESS_MANAGER_ABI = _load_abi("address_manager_abi.json") +TRANSACTION_MANAGER_READ_ABI = _load_abi("transaction_manager_read_abi.json") +ROUNDS_STORAGE_READ_ABI = _load_abi("rounds_storage_read_abi.json") __all__ = [ "CONSENSUS_DATA_ABI", "CONSENSUS_MAIN_ABI", "CONSENSUS_DATA_ABI_V06", "CONSENSUS_MAIN_ABI_V06", + "APPEALS_ABI", + "CONSENSUS_DATA_LIFECYCLE_ABI", + "CONSENSUS_DATA_TRAIN_READS_ABI", + "CONSENSUS_DATA_TRAIN_ABI", + "CONSENSUS_DATA_BIG_ROUNDS_ABI", + "ADDRESS_MANAGER_ABI", + "TRANSACTION_MANAGER_READ_ABI", + "ROUNDS_STORAGE_READ_ABI", ] diff --git a/genlayer_py/consensus/abi/address_manager_abi.json b/genlayer_py/consensus/abi/address_manager_abi.json new file mode 100644 index 0000000..424b78f --- /dev/null +++ b/genlayer_py/consensus/abi/address_manager_abi.json @@ -0,0 +1,21 @@ +[ + { + "inputs": [ + { + "internalType": "string", + "name": "key", + "type": "string" + } + ], + "name": "getAddressNonZero", + "outputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/genlayer_py/consensus/abi/appeals_abi.json b/genlayer_py/consensus/abi/appeals_abi.json new file mode 100644 index 0000000..7e5f616 --- /dev/null +++ b/genlayer_py/consensus/abi/appeals_abi.json @@ -0,0 +1,710 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AccessControlBadConfirmation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "neededRole", + "type": "bytes32" + } + ], + "name": "AccessControlUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "CanNotAppeal", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidAppealBond", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSender", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTransactionStatus", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } + ], + "name": "AppealCommitteeSelected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "AppealSelectionAborted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "round", + "type": "uint256" + } + ], + "name": "UnionRoundCreated", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "addressManager", + "outputs": [ + { + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_expectedDecisionId", + "type": "uint256" + } + ], + "name": "canAppeal", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "callerConfirmation", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "setAddressManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "txExecutionResult", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numOfInitialValidators", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "resultHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange[]", + "name": "readStateBlockRanges", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedStorageUnitPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "storageFeeUsed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedReceiptGasPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "txSigner", + "type": "address" + }, + { + "internalType": "enum ITransactions.QueueContext", + "name": "queueContext", + "type": "uint8" + } + ], + "internalType": "struct ITransactions.Transaction", + "name": "_transaction", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_expectedDecisionId", + "type": "uint256" + } + ], + "name": "submitAppeal", + "outputs": [ + { + "internalType": "address[]", + "name": "appealValidators", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "address", + "name": "newLeader", + "type": "address" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "lastRoundLeaderTimeoutOrUndetermined", + "type": "bool" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "previousStatus", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/genlayer_py/consensus/abi/consensus_data_abi.json b/genlayer_py/consensus/abi/consensus_data_abi.json index ac30f82..ef27aa5 100644 --- a/genlayer_py/consensus/abi/consensus_data_abi.json +++ b/genlayer_py/consensus/abi/consensus_data_abi.json @@ -1,2577 +1,2573 @@ [ - { - "inputs": [], - "name": "AccessControlBadConfirmation", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "neededRole", - "type": "bytes32" - } - ], - "name": "AccessControlUnauthorizedAccount", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnableInvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "OwnableUnauthorizedAccount", - "type": "error" - }, - { - "inputs": [], - "name": "ReentrancyGuardReentrantCall", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_currentTimestamp", - "type": "uint256" - } - ], - "name": "canFinalize", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "consensusMain", - "outputs": [ - { - "internalType": "contract IConsensusMain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_tx_id", - "type": "bytes32" - } - ], - "name": "getLastAppealResult", - "outputs": [ - { - "internalType": "enum ITransactions.ResultType", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "getLatestAcceptedTransaction", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "numOfInitialValidators", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "createdTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastVoteTimestamp", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "randomSeed", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "txData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "txReceipt", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" - }, - { - "internalType": "enum IQueues.QueueType", - "name": "queueType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "queuePosition", - "type": "uint256" - }, - { - "internalType": "address", - "name": "activator", - "type": "address" - }, - { - "internalType": "address", - "name": "lastLeader", - "type": "address" - }, - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "activationBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "processingBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposalBlock", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "numOfRounds", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "round", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leaderIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesCommitted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesRevealed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "appealBond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rotationsLeft", - "type": "uint256" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "roundValidators", - "type": "address[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorVotesHash", - "type": "bytes32[]" - }, - { - "internalType": "enum ITransactions.VoteType[]", - "name": "validatorVotes", - "type": "uint8[]" - } - ], - "internalType": "struct ITransactions.RoundData", - "name": "lastRound", - "type": "tuple" - } - ], - "internalType": "struct ConsensusData.TransactionData", - "name": "txData", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "startIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pageSize", - "type": "uint256" - } - ], - "name": "getLatestAcceptedTransactions", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "numOfInitialValidators", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "createdTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastVoteTimestamp", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "randomSeed", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "txData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "txReceipt", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" - }, - { - "internalType": "enum IQueues.QueueType", - "name": "queueType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "queuePosition", - "type": "uint256" - }, - { - "internalType": "address", - "name": "activator", - "type": "address" - }, - { - "internalType": "address", - "name": "lastLeader", - "type": "address" - }, - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "activationBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "processingBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposalBlock", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "numOfRounds", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "round", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leaderIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesCommitted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesRevealed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "appealBond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rotationsLeft", - "type": "uint256" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "roundValidators", - "type": "address[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorVotesHash", - "type": "bytes32[]" - }, - { - "internalType": "enum ITransactions.VoteType[]", - "name": "validatorVotes", - "type": "uint8[]" - } - ], - "internalType": "struct ITransactions.RoundData", - "name": "lastRound", - "type": "tuple" - } - ], - "internalType": "struct ConsensusData.TransactionData[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "getLatestAcceptedTxCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "getLatestFinalizedTransaction", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "numOfInitialValidators", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "createdTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastVoteTimestamp", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "randomSeed", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "txData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "txReceipt", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" - }, - { - "internalType": "enum IQueues.QueueType", - "name": "queueType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "queuePosition", - "type": "uint256" - }, - { - "internalType": "address", - "name": "activator", - "type": "address" - }, - { - "internalType": "address", - "name": "lastLeader", - "type": "address" - }, - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "activationBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "processingBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposalBlock", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "numOfRounds", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "round", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leaderIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesCommitted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesRevealed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "appealBond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rotationsLeft", - "type": "uint256" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "roundValidators", - "type": "address[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorVotesHash", - "type": "bytes32[]" - }, - { - "internalType": "enum ITransactions.VoteType[]", - "name": "validatorVotes", - "type": "uint8[]" - } - ], - "internalType": "struct ITransactions.RoundData", - "name": "lastRound", - "type": "tuple" - } - ], - "internalType": "struct ConsensusData.TransactionData", - "name": "txData", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "startIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pageSize", - "type": "uint256" - } - ], - "name": "getLatestFinalizedTransactions", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "numOfInitialValidators", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "createdTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastVoteTimestamp", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "randomSeed", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "txData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "txReceipt", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" - }, - { - "internalType": "enum IQueues.QueueType", - "name": "queueType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "queuePosition", - "type": "uint256" - }, - { - "internalType": "address", - "name": "activator", - "type": "address" - }, - { - "internalType": "address", - "name": "lastLeader", - "type": "address" - }, - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "activationBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "processingBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposalBlock", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "numOfRounds", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "round", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leaderIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesCommitted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesRevealed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "appealBond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rotationsLeft", - "type": "uint256" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "roundValidators", - "type": "address[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorVotesHash", - "type": "bytes32[]" - }, - { - "internalType": "enum ITransactions.VoteType[]", - "name": "validatorVotes", - "type": "uint8[]" - } - ], - "internalType": "struct ITransactions.RoundData", - "name": "lastRound", - "type": "tuple" - } - ], - "internalType": "struct ConsensusData.TransactionData[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "getLatestFinalizedTxCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "getLatestPendingTxCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "slot", - "type": "uint256" - } - ], - "name": "getLatestPendingTxId", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "getLatestUndeterminedTransaction", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "numOfInitialValidators", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "createdTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastVoteTimestamp", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "randomSeed", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "txData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "txReceipt", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" - }, - { - "internalType": "enum IQueues.QueueType", - "name": "queueType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "queuePosition", - "type": "uint256" - }, - { - "internalType": "address", - "name": "activator", - "type": "address" - }, - { - "internalType": "address", - "name": "lastLeader", - "type": "address" - }, - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "activationBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "processingBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposalBlock", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "numOfRounds", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "round", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leaderIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesCommitted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesRevealed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "appealBond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rotationsLeft", - "type": "uint256" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "roundValidators", - "type": "address[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorVotesHash", - "type": "bytes32[]" - }, - { - "internalType": "enum ITransactions.VoteType[]", - "name": "validatorVotes", - "type": "uint8[]" - } - ], - "internalType": "struct ITransactions.RoundData", - "name": "lastRound", - "type": "tuple" - } - ], - "internalType": "struct ConsensusData.TransactionData", - "name": "txData", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "getLatestUndeterminedTxCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_tx_id", - "type": "bytes32" - } - ], - "name": "getMessagesForTransaction", - "outputs": [ - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "ghostAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "numOfMessagesIssuedOnAcceptance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "numOfMessagesIssuedOnFinalization", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_tx_id", - "type": "bytes32" - } - ], - "name": "getReadStateBlockRangeForTransaction", - "outputs": [ - { - "internalType": "uint256", - "name": "activationBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "processingBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposalBlock", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "startIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "endIndex", - "type": "uint256" - } - ], - "name": "getRecipientQueues", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "head", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tail", - "type": "uint256" - }, - { - "internalType": "bytes32[]", - "name": "txIds", - "type": "bytes32[]" - } - ], - "internalType": "struct IQueues.QueueInfoView", - "name": "pending", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "head", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tail", - "type": "uint256" - }, - { - "internalType": "bytes32[]", - "name": "txIds", - "type": "bytes32[]" - } - ], - "internalType": "struct IQueues.QueueInfoView", - "name": "accepted", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "head", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tail", - "type": "uint256" - }, - { - "internalType": "bytes32[]", - "name": "txIds", - "type": "bytes32[]" - } - ], - "internalType": "struct IQueues.QueueInfoView", - "name": "undetermined", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "finalizedCount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "issuedTxCount", - "type": "uint256" - } - ], - "internalType": "struct IQueues.RecipientQueuesView", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getTotalNumOfTransactions", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_tx_id", - "type": "bytes32" - } - ], - "name": "getTransactionAllData", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "numOfInitialValidators", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - }, - { - "internalType": "address", - "name": "activator", - "type": "address" - }, - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "previousStatus", - "type": "uint8" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "created", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pending", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "activated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "committed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastVote", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "appealSubmitted", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.Timestamps", - "name": "timestamps", - "type": "tuple" - }, - { - "internalType": "bytes32", - "name": "randomSeed", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "onAcceptanceMessages", - "type": "bool" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "activationBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "processingBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposalBlock", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "txData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "txReceipt", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" - }, - { - "internalType": "address[]", - "name": "consumedValidators", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "round", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leaderIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesCommitted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesRevealed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "appealBond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rotationsLeft", - "type": "uint256" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "roundValidators", - "type": "address[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorVotesHash", - "type": "bytes32[]" - }, - { - "internalType": "enum ITransactions.VoteType[]", - "name": "validatorVotes", - "type": "uint8[]" - } - ], - "internalType": "struct ITransactions.RoundData[]", - "name": "roundData", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "numOfMessagesIssuedOnAcceptance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "numOfMessagesIssuedOnFinalization", - "type": "uint256" - }, - { - "internalType": "address", - "name": "txOrigin", - "type": "address" - }, - { - "internalType": "uint256", - "name": "initialRotations", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.Transaction", - "name": "transaction", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_tx_id", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_timestamp", - "type": "uint256" - } - ], - "name": "getTransactionData", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "numOfInitialValidators", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "createdTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastVoteTimestamp", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "randomSeed", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "txData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "txReceipt", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" - }, - { - "internalType": "enum IQueues.QueueType", - "name": "queueType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "queuePosition", - "type": "uint256" - }, - { - "internalType": "address", - "name": "activator", - "type": "address" - }, - { - "internalType": "address", - "name": "lastLeader", - "type": "address" - }, - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "activationBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "processingBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposalBlock", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "numOfRounds", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "round", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leaderIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesCommitted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesRevealed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "appealBond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rotationsLeft", - "type": "uint256" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "roundValidators", - "type": "address[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorVotesHash", - "type": "bytes32[]" - }, - { - "internalType": "enum ITransactions.VoteType[]", - "name": "validatorVotes", - "type": "uint8[]" - } - ], - "internalType": "struct ITransactions.RoundData", - "name": "lastRound", - "type": "tuple" - } - ], - "internalType": "struct ConsensusData.TransactionData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "startIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "endIndex", - "type": "uint256" - } - ], - "name": "getTransactionIndexToTxId", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_tx_id", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_timestamp", - "type": "uint256" - } - ], - "name": "getTransactionStatus", - "outputs": [ - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_tx_id", - "type": "bytes32" - } - ], - "name": "getValidatorsForLastAppeal", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_tx_id", - "type": "bytes32" - } - ], - "name": "getValidatorsForLastRound", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_tx_id", - "type": "bytes32" - } - ], - "name": "hasTransactionOnAcceptanceMessages", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_tx_id", - "type": "bytes32" - } - ], - "name": "hasTransactionOnFinalizationMessages", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensusMain", - "type": "address" - }, - { - "internalType": "address", - "name": "_transactions", - "type": "address" - }, - { - "internalType": "address", - "name": "_queues", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "queues", - "outputs": [ - { - "internalType": "contract IQueues", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "callerConfirmation", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensusMain", - "type": "address" - } - ], - "name": "setConsensusMain", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_queues", - "type": "address" - } - ], - "name": "setQueues", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_transactions", - "type": "address" - } - ], - "name": "setTransactions", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "transactions", - "outputs": [ - { - "internalType": "contract ITransactions", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] \ No newline at end of file + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AccessControlBadConfirmation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "neededRole", + "type": "bytes32" + } + ], + "name": "AccessControlUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTransactionStatus", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "status", + "type": "uint8" + } + ], + "name": "PhaseDeadlineNotInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrancyGuardReentrantCall", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "addressManager", + "outputs": [ + { + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_currentTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_expectedDecisionId", + "type": "uint256" + } + ], + "name": "canFinalize", + "outputs": [ + { + "internalType": "bool", + "name": "ready", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "evaluatedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealDeadline", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "estimateAppealBond", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "estimateLatestAppealCharge", + "outputs": [ + { + "internalType": "uint256", + "name": "decisionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "funding", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealDeadline", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getCurrentActivator", + "outputs": [ + { + "internalType": "address", + "name": "newActivator", + "type": "address" + }, + { + "internalType": "bool", + "name": "activatorIsIdle", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "slots", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "secondsUntilNextBoundary", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "currentStatus", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getCurrentLeader", + "outputs": [ + { + "internalType": "address", + "name": "newLeader", + "type": "address" + }, + { + "internalType": "bool", + "name": "leaderIsIdle", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "slots", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "secondsUntilNextBoundary", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "currentStatus", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getCurrentValidators", + "outputs": [ + { + "internalType": "address[]", + "name": "validators", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "idleIndexes", + "type": "uint256[]" + }, + { + "internalType": "bool", + "name": "leaderIsIdle", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "slots", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "secondsUntilNextBoundary", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "currentStatus", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestAcceptedTransaction", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "observedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "declaredBudget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "allocationSubtree", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "useBalance", + "type": "bool" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData", + "name": "inputData", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + } + ], + "name": "getLatestAcceptedTransactions", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "observedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "declaredBudget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "allocationSubtree", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "useBalance", + "type": "bool" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestAcceptedTxCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestFinalizedTransaction", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "observedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "declaredBudget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "allocationSubtree", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "useBalance", + "type": "bool" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData", + "name": "inputData", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + } + ], + "name": "getLatestFinalizedTransactions", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "observedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "declaredBudget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "allocationSubtree", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "useBalance", + "type": "bool" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestFinalizedTxCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getStoredTransactionData", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "observedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "declaredBudget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "allocationSubtree", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "useBalance", + "type": "bool" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getStoredTransactionStatus", + "outputs": [ + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getTransactionAllData", + "outputs": [ + { + "components": [ + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "txExecutionResult", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numOfInitialValidators", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "resultHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange[]", + "name": "readStateBlockRanges", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedStorageUnitPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "storageFeeUsed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedReceiptGasPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "txSigner", + "type": "address" + }, + { + "internalType": "enum ITransactions.QueueContext", + "name": "queueContext", + "type": "uint8" + } + ], + "internalType": "struct ITransactions.Transaction", + "name": "transaction", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData[]", + "name": "roundsData", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_timestamp", + "type": "uint256" + } + ], + "name": "getTransactionLifecycle", + "outputs": [ + { + "components": [ + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "storedStatus", + "type": "uint8" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "storedStatus", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "projectedStatus", + "type": "uint8" + }, + { + "internalType": "enum IIdlenessPhase.ResolutionAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "resultHash", + "type": "bytes32" + }, + { + "internalType": "enum ITransactionManager.ResolutionSource", + "name": "source", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "sourceRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sourceGeneration", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "sourceRoundContextHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "roundPlanHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "resultRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "resultGeneration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "basisDecisionId", + "type": "uint256" + }, + { + "internalType": "enum ITransactionManager.ResolutionContext", + "name": "context", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "attemptId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "boundaryAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "evaluatedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "snapshotBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "decisionWindow", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealDeadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "materializesDecision", + "type": "bool" + }, + { + "internalType": "bool", + "name": "actionOutcomeDeterministic", + "type": "bool" + }, + { + "internalType": "bool", + "name": "nonCurrentEvaluation", + "type": "bool" + } + ], + "internalType": "struct IIdlenessPhase.ResolutionPlan", + "name": "resolution", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "exists", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "decisionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "basisDecisionId", + "type": "uint256" + }, + { + "internalType": "enum ITransactionManager.ResolutionContext", + "name": "context", + "type": "uint8" + }, + { + "internalType": "enum ITransactionManager.ResolutionSource", + "name": "source", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "sourceAttemptId", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "sourceStatus", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "sourceRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sourceGeneration", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "sourceRoundContextHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "roundPlanHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "resultRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "resultGeneration", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "resultHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "effectiveAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "materializedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealDeadline", + "type": "uint256" + } + ], + "internalType": "struct ITransactionManager.DecisionRecord", + "name": "latestDecision", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "decisionActive", + "type": "bool" + } + ], + "internalType": "struct ConsensusData.TransactionLifecycle", + "name": "lifecycle", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getValidatorsForLastRound", + "outputs": [ + { + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "callerConfirmation", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "setAddressManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/genlayer_py/consensus/abi/consensus_data_abi_v06.json b/genlayer_py/consensus/abi/consensus_data_abi_v06.json index 60a382a..ef27aa5 100644 --- a/genlayer_py/consensus/abi/consensus_data_abi_v06.json +++ b/genlayer_py/consensus/abi/consensus_data_abi_v06.json @@ -1,1962 +1,2573 @@ [ - { - "inputs": [], - "name": "AccessControlBadConfirmation", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "neededRole", - "type": "bytes32" - } - ], - "name": "AccessControlUnauthorizedAccount", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnableInvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "OwnableUnauthorizedAccount", - "type": "error" - }, - { - "inputs": [], - "name": "ReentrancyGuardReentrantCall", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "addressManager", - "outputs": [ - { - "internalType": "contract IAddressManager", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_currentTimestamp", - "type": "uint256" - } - ], - "name": "canFinalize", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "getLatestAcceptedTransaction", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "initialRotations", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "createdTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastVoteTimestamp", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "randomSeed", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txExecutionHash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "txCalldata", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "eqBlocksOutputs", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "saltNonce", - "type": "uint256" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" - }, - { - "internalType": "enum IQueues.QueueType", - "name": "queueType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "queuePosition", - "type": "uint256" - }, - { - "internalType": "address", - "name": "activator", - "type": "address" - }, - { - "internalType": "address", - "name": "lastLeader", - "type": "address" - }, - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "activationBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "processingBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposalBlock", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "numOfRounds", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "round", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leaderIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesCommitted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesRevealed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "appealBond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rotationsLeft", - "type": "uint256" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "roundValidators", - "type": "address[]" - }, - { - "internalType": "enum ITransactions.VoteType[]", - "name": "validatorVotes", - "type": "uint8[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorVotesHash", - "type": "bytes32[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorResultHash", - "type": "bytes32[]" - } - ], - "internalType": "struct ITransactions.RoundData", - "name": "lastRound", - "type": "tuple" - }, - { - "internalType": "address[]", - "name": "consumedValidators", - "type": "address[]" - } - ], - "internalType": "struct ConsensusData.TransactionData", - "name": "inputData", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "startIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pageSize", - "type": "uint256" - } - ], - "name": "getLatestAcceptedTransactions", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "initialRotations", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "createdTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastVoteTimestamp", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "randomSeed", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txExecutionHash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "txCalldata", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "eqBlocksOutputs", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "saltNonce", - "type": "uint256" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" - }, - { - "internalType": "enum IQueues.QueueType", - "name": "queueType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "queuePosition", - "type": "uint256" - }, - { - "internalType": "address", - "name": "activator", - "type": "address" - }, - { - "internalType": "address", - "name": "lastLeader", - "type": "address" - }, - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "activationBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "processingBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposalBlock", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "numOfRounds", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "round", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leaderIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesCommitted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesRevealed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "appealBond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rotationsLeft", - "type": "uint256" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "roundValidators", - "type": "address[]" - }, - { - "internalType": "enum ITransactions.VoteType[]", - "name": "validatorVotes", - "type": "uint8[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorVotesHash", - "type": "bytes32[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorResultHash", - "type": "bytes32[]" - } - ], - "internalType": "struct ITransactions.RoundData", - "name": "lastRound", - "type": "tuple" - }, - { - "internalType": "address[]", - "name": "consumedValidators", - "type": "address[]" - } - ], - "internalType": "struct ConsensusData.TransactionData[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "getLatestAcceptedTxCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "getLatestFinalizedTransaction", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "initialRotations", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "createdTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastVoteTimestamp", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "randomSeed", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txExecutionHash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "txCalldata", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "eqBlocksOutputs", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "saltNonce", - "type": "uint256" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" - }, - { - "internalType": "enum IQueues.QueueType", - "name": "queueType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "queuePosition", - "type": "uint256" - }, - { - "internalType": "address", - "name": "activator", - "type": "address" - }, - { - "internalType": "address", - "name": "lastLeader", - "type": "address" - }, - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "activationBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "processingBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposalBlock", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "numOfRounds", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "round", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leaderIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesCommitted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesRevealed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "appealBond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rotationsLeft", - "type": "uint256" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "roundValidators", - "type": "address[]" - }, - { - "internalType": "enum ITransactions.VoteType[]", - "name": "validatorVotes", - "type": "uint8[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorVotesHash", - "type": "bytes32[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorResultHash", - "type": "bytes32[]" - } - ], - "internalType": "struct ITransactions.RoundData", - "name": "lastRound", - "type": "tuple" - }, - { - "internalType": "address[]", - "name": "consumedValidators", - "type": "address[]" - } - ], - "internalType": "struct ConsensusData.TransactionData", - "name": "inputData", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "startIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pageSize", - "type": "uint256" - } - ], - "name": "getLatestFinalizedTransactions", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "initialRotations", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "createdTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastVoteTimestamp", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "randomSeed", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txExecutionHash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "txCalldata", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "eqBlocksOutputs", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "saltNonce", - "type": "uint256" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" - }, - { - "internalType": "enum IQueues.QueueType", - "name": "queueType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "queuePosition", - "type": "uint256" - }, - { - "internalType": "address", - "name": "activator", - "type": "address" - }, - { - "internalType": "address", - "name": "lastLeader", - "type": "address" - }, - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "activationBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "processingBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposalBlock", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "numOfRounds", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "round", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leaderIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesCommitted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesRevealed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "appealBond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rotationsLeft", - "type": "uint256" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "roundValidators", - "type": "address[]" - }, - { - "internalType": "enum ITransactions.VoteType[]", - "name": "validatorVotes", - "type": "uint8[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorVotesHash", - "type": "bytes32[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorResultHash", - "type": "bytes32[]" - } - ], - "internalType": "struct ITransactions.RoundData", - "name": "lastRound", - "type": "tuple" - }, - { - "internalType": "address[]", - "name": "consumedValidators", - "type": "address[]" - } - ], - "internalType": "struct ConsensusData.TransactionData[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "getLatestFinalizedTxCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "getTransactionAllData", - "outputs": [ - { - "components": [ - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "enum ITransactions.VoteType", - "name": "txExecutionResult", - "type": "uint8" - }, - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "previousStatus", - "type": "uint8" - }, - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "address", - "name": "txOrigin", - "type": "address" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "address", - "name": "activator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialRotations", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "numOfInitialValidators", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "randomSeed", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "txExecutionHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "resultHash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "txCalldata", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "eqBlocksOutputs", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "activationBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "processingBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposalBlock", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.ReadStateBlockRange[]", - "name": "readStateBlockRanges", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "validUntil", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.Transaction", - "name": "transaction", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "round", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leaderIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesCommitted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesRevealed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "appealBond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rotationsLeft", - "type": "uint256" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "roundValidators", - "type": "address[]" - }, - { - "internalType": "enum ITransactions.VoteType[]", - "name": "validatorVotes", - "type": "uint8[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorVotesHash", - "type": "bytes32[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorResultHash", - "type": "bytes32[]" - } - ], - "internalType": "struct ITransactions.RoundData[]", - "name": "roundsData", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_timestamp", - "type": "uint256" - } - ], - "name": "getTransactionData", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "initialRotations", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "createdTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastVoteTimestamp", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "randomSeed", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txExecutionHash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "txCalldata", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "eqBlocksOutputs", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "saltNonce", - "type": "uint256" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" - }, - { - "internalType": "enum IQueues.QueueType", - "name": "queueType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "queuePosition", - "type": "uint256" - }, - { - "internalType": "address", - "name": "activator", - "type": "address" - }, - { - "internalType": "address", - "name": "lastLeader", - "type": "address" - }, - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "activationBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "processingBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposalBlock", - "type": "uint256" - } - ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "numOfRounds", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "round", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leaderIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesCommitted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "votesRevealed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "appealBond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rotationsLeft", - "type": "uint256" - }, - { - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "roundValidators", - "type": "address[]" - }, - { - "internalType": "enum ITransactions.VoteType[]", - "name": "validatorVotes", - "type": "uint8[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorVotesHash", - "type": "bytes32[]" - }, - { - "internalType": "bytes32[]", - "name": "validatorResultHash", - "type": "bytes32[]" - } - ], - "internalType": "struct ITransactions.RoundData", - "name": "lastRound", - "type": "tuple" - }, - { - "internalType": "address[]", - "name": "consumedValidators", - "type": "address[]" - } - ], - "internalType": "struct ConsensusData.TransactionData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_timestamp", - "type": "uint256" - } - ], - "name": "getTransactionStatus", - "outputs": [ - { - "internalType": "enum ITransactions.TransactionStatus", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "getValidatorsForLastRound", - "outputs": [ - { - "internalType": "address[]", - "name": "validators", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_addressManager", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "callerConfirmation", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_addressManager", - "type": "address" - } - ], - "name": "setAddressManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AccessControlBadConfirmation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "neededRole", + "type": "bytes32" + } + ], + "name": "AccessControlUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTransactionStatus", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "status", + "type": "uint8" + } + ], + "name": "PhaseDeadlineNotInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrancyGuardReentrantCall", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "addressManager", + "outputs": [ + { + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_currentTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_expectedDecisionId", + "type": "uint256" + } + ], + "name": "canFinalize", + "outputs": [ + { + "internalType": "bool", + "name": "ready", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "evaluatedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealDeadline", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "estimateAppealBond", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "estimateLatestAppealCharge", + "outputs": [ + { + "internalType": "uint256", + "name": "decisionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "funding", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealDeadline", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getCurrentActivator", + "outputs": [ + { + "internalType": "address", + "name": "newActivator", + "type": "address" + }, + { + "internalType": "bool", + "name": "activatorIsIdle", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "slots", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "secondsUntilNextBoundary", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "currentStatus", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getCurrentLeader", + "outputs": [ + { + "internalType": "address", + "name": "newLeader", + "type": "address" + }, + { + "internalType": "bool", + "name": "leaderIsIdle", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "slots", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "secondsUntilNextBoundary", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "currentStatus", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getCurrentValidators", + "outputs": [ + { + "internalType": "address[]", + "name": "validators", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "idleIndexes", + "type": "uint256[]" + }, + { + "internalType": "bool", + "name": "leaderIsIdle", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "slots", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "secondsUntilNextBoundary", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "currentStatus", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestAcceptedTransaction", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "observedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "declaredBudget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "allocationSubtree", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "useBalance", + "type": "bool" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData", + "name": "inputData", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + } + ], + "name": "getLatestAcceptedTransactions", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "observedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "declaredBudget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "allocationSubtree", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "useBalance", + "type": "bool" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestAcceptedTxCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestFinalizedTransaction", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "observedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "declaredBudget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "allocationSubtree", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "useBalance", + "type": "bool" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData", + "name": "inputData", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + } + ], + "name": "getLatestFinalizedTransactions", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "observedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "declaredBudget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "allocationSubtree", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "useBalance", + "type": "bool" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getLatestFinalizedTxCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getStoredTransactionData", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "observedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastVoteTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "declaredBudget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "allocationSubtree", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "useBalance", + "type": "bool" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + { + "internalType": "enum IQueues.QueueType", + "name": "queueType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "queuePosition", + "type": "uint256" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "address", + "name": "lastLeader", + "type": "address" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "numOfRounds", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "consumedValidators", + "type": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getStoredTransactionStatus", + "outputs": [ + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getTransactionAllData", + "outputs": [ + { + "components": [ + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "txExecutionResult", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "address", + "name": "activator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numOfInitialValidators", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "randomSeed", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "resultHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "eqBlocksOutputs", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "activationBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposalBlock", + "type": "uint256" + } + ], + "internalType": "struct ITransactions.ReadStateBlockRange[]", + "name": "readStateBlockRanges", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedStorageUnitPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "storageFeeUsed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedReceiptGasPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "txSigner", + "type": "address" + }, + { + "internalType": "enum ITransactions.QueueContext", + "name": "queueContext", + "type": "uint8" + } + ], + "internalType": "struct ITransactions.Transaction", + "name": "transaction", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "leaderIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesCommitted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "votesRevealed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealBond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rotationsLeft", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "roundValidators", + "type": "address[]" + }, + { + "internalType": "enum ITransactions.VoteType[]", + "name": "validatorVotes", + "type": "uint8[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorVotesHash", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "validatorResultHash", + "type": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData[]", + "name": "roundsData", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_timestamp", + "type": "uint256" + } + ], + "name": "getTransactionLifecycle", + "outputs": [ + { + "components": [ + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "storedStatus", + "type": "uint8" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "storedStatus", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "projectedStatus", + "type": "uint8" + }, + { + "internalType": "enum IIdlenessPhase.ResolutionAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "resultHash", + "type": "bytes32" + }, + { + "internalType": "enum ITransactionManager.ResolutionSource", + "name": "source", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "sourceRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sourceGeneration", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "sourceRoundContextHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "roundPlanHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "resultRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "resultGeneration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "basisDecisionId", + "type": "uint256" + }, + { + "internalType": "enum ITransactionManager.ResolutionContext", + "name": "context", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "attemptId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "boundaryAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "evaluatedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "snapshotBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "decisionWindow", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealDeadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "materializesDecision", + "type": "bool" + }, + { + "internalType": "bool", + "name": "actionOutcomeDeterministic", + "type": "bool" + }, + { + "internalType": "bool", + "name": "nonCurrentEvaluation", + "type": "bool" + } + ], + "internalType": "struct IIdlenessPhase.ResolutionPlan", + "name": "resolution", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "exists", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "decisionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "basisDecisionId", + "type": "uint256" + }, + { + "internalType": "enum ITransactionManager.ResolutionContext", + "name": "context", + "type": "uint8" + }, + { + "internalType": "enum ITransactionManager.ResolutionSource", + "name": "source", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "sourceAttemptId", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "sourceStatus", + "type": "uint8" + }, + { + "internalType": "enum ITransactions.TransactionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "sourceRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sourceGeneration", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "sourceRoundContextHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "roundPlanHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "resultRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "resultGeneration", + "type": "uint256" + }, + { + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "resultHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "effectiveAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "materializedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealDeadline", + "type": "uint256" + } + ], + "internalType": "struct ITransactionManager.DecisionRecord", + "name": "latestDecision", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "decisionActive", + "type": "bool" + } + ], + "internalType": "struct ConsensusData.TransactionLifecycle", + "name": "lifecycle", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getValidatorsForLastRound", + "outputs": [ + { + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "callerConfirmation", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "setAddressManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } ] diff --git a/genlayer_py/consensus/abi/consensus_data_big_rounds_abi.json b/genlayer_py/consensus/abi/consensus_data_big_rounds_abi.json new file mode 100644 index 0000000..b213b25 --- /dev/null +++ b/genlayer_py/consensus/abi/consensus_data_big_rounds_abi.json @@ -0,0 +1,115 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "getStoredTransactionDataLight", + "outputs": [ + { + "components": [ + {"internalType": "uint256", "name": "observedAt", "type": "uint256"}, + {"internalType": "address", "name": "sender", "type": "address"}, + {"internalType": "address", "name": "recipient", "type": "address"}, + {"internalType": "uint256", "name": "initialRotations", "type": "uint256"}, + {"internalType": "uint256", "name": "txSlot", "type": "uint256"}, + {"internalType": "uint256", "name": "createdTimestamp", "type": "uint256"}, + {"internalType": "uint256", "name": "lastVoteTimestamp", "type": "uint256"}, + {"internalType": "bytes32", "name": "randomSeed", "type": "bytes32"}, + {"internalType": "enum ITransactions.ResultType", "name": "result", "type": "uint8"}, + {"internalType": "bytes32", "name": "txExecutionHash", "type": "bytes32"}, + {"internalType": "bytes", "name": "txCalldata", "type": "bytes"}, + {"internalType": "bytes", "name": "eqBlocksOutputs", "type": "bytes"}, + { + "components": [ + {"internalType": "enum IMessages.MessageType", "name": "messageType", "type": "uint8"}, + {"internalType": "address", "name": "recipient", "type": "address"}, + {"internalType": "uint256", "name": "value", "type": "uint256"}, + {"internalType": "bytes", "name": "data", "type": "bytes"}, + {"internalType": "bool", "name": "onAcceptance", "type": "bool"}, + {"internalType": "uint256", "name": "saltNonce", "type": "uint256"}, + {"internalType": "bytes", "name": "feeParams", "type": "bytes"}, + {"internalType": "uint256", "name": "declaredBudget", "type": "uint256"}, + {"internalType": "bytes", "name": "allocationSubtree", "type": "bytes"}, + {"internalType": "bytes32", "name": "callKey", "type": "bytes32"}, + {"internalType": "bool", "name": "useBalance", "type": "bool"} + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + }, + {"internalType": "enum IQueues.QueueType", "name": "queueType", "type": "uint8"}, + {"internalType": "uint256", "name": "queuePosition", "type": "uint256"}, + {"internalType": "address", "name": "activator", "type": "address"}, + {"internalType": "address", "name": "lastLeader", "type": "address"}, + {"internalType": "enum ITransactions.TransactionStatus", "name": "status", "type": "uint8"}, + {"internalType": "bytes32", "name": "txId", "type": "bytes32"}, + { + "components": [ + {"internalType": "uint256", "name": "activationBlock", "type": "uint256"}, + {"internalType": "uint256", "name": "processingBlock", "type": "uint256"}, + {"internalType": "uint256", "name": "proposalBlock", "type": "uint256"} + ], + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" + }, + {"internalType": "uint256", "name": "numOfRounds", "type": "uint256"}, + { + "components": [ + {"internalType": "uint256", "name": "round", "type": "uint256"}, + {"internalType": "uint256", "name": "leaderIndex", "type": "uint256"}, + {"internalType": "uint256", "name": "votesCommitted", "type": "uint256"}, + {"internalType": "uint256", "name": "votesRevealed", "type": "uint256"}, + {"internalType": "uint256", "name": "appealBond", "type": "uint256"}, + {"internalType": "uint256", "name": "rotationsLeft", "type": "uint256"}, + {"internalType": "enum ITransactions.ResultType", "name": "result", "type": "uint8"}, + {"internalType": "uint256", "name": "validatorsCount", "type": "uint256"} + ], + "internalType": "struct ConsensusDataBigRounds.RoundDataLight", + "name": "lastRound", + "type": "tuple" + }, + {"internalType": "uint256", "name": "consumedValidatorsCount", "type": "uint256"} + ], + "internalType": "struct ConsensusDataBigRounds.TransactionDataLight", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "bytes32", "name": "_txId", "type": "bytes32"}, + {"internalType": "uint256", "name": "_round", "type": "uint256"}, + {"internalType": "uint256", "name": "_offset", "type": "uint256"}, + {"internalType": "uint256", "name": "_limit", "type": "uint256"} + ], + "name": "getRoundValidatorsPaged", + "outputs": [ + {"internalType": "address[]", "name": "page", "type": "address[]"}, + {"internalType": "uint256", "name": "total", "type": "uint256"} + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "bytes32", "name": "_txId", "type": "bytes32"}, + {"internalType": "uint256", "name": "_offset", "type": "uint256"}, + {"internalType": "uint256", "name": "_limit", "type": "uint256"} + ], + "name": "getConsumedValidatorsPaged", + "outputs": [ + {"internalType": "address[]", "name": "page", "type": "address[]"}, + {"internalType": "uint256", "name": "total", "type": "uint256"} + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/genlayer_py/consensus/abi/consensus_data_lifecycle_abi.json b/genlayer_py/consensus/abi/consensus_data_lifecycle_abi.json new file mode 100644 index 0000000..8a44d30 --- /dev/null +++ b/genlayer_py/consensus/abi/consensus_data_lifecycle_abi.json @@ -0,0 +1,103 @@ +[ + { + "inputs": [], + "name": "addressManager", + "outputs": [ + {"internalType": "contract IAddressManager", "name": "", "type": "address"} + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "bytes32", "name": "_txId", "type": "bytes32"}, + {"internalType": "uint256", "name": "_timestamp", "type": "uint256"} + ], + "name": "getTransactionLifecycle", + "outputs": [ + { + "components": [ + {"internalType": "enum ITransactions.TransactionStatus", "name": "storedStatus", "type": "uint8"}, + { + "components": [ + {"internalType": "bytes32", "name": "txId", "type": "bytes32"}, + {"internalType": "enum ITransactions.TransactionStatus", "name": "storedStatus", "type": "uint8"}, + {"internalType": "enum ITransactions.TransactionStatus", "name": "projectedStatus", "type": "uint8"}, + {"internalType": "enum IIdlenessPhase.ResolutionAction", "name": "action", "type": "uint8"}, + {"internalType": "enum ITransactions.ResultType", "name": "result", "type": "uint8"}, + {"internalType": "bytes32", "name": "resultHash", "type": "bytes32"}, + {"internalType": "enum ITransactionManager.ResolutionSource", "name": "source", "type": "uint8"}, + {"internalType": "uint256", "name": "sourceRound", "type": "uint256"}, + {"internalType": "uint256", "name": "sourceGeneration", "type": "uint256"}, + {"internalType": "bytes32", "name": "sourceRoundContextHash", "type": "bytes32"}, + {"internalType": "bytes32", "name": "roundPlanHash", "type": "bytes32"}, + {"internalType": "uint256", "name": "resultRound", "type": "uint256"}, + {"internalType": "uint256", "name": "resultGeneration", "type": "uint256"}, + {"internalType": "uint256", "name": "basisDecisionId", "type": "uint256"}, + {"internalType": "enum ITransactionManager.ResolutionContext", "name": "context", "type": "uint8"}, + {"internalType": "bytes32", "name": "attemptId", "type": "bytes32"}, + {"internalType": "uint256", "name": "boundaryAt", "type": "uint256"}, + {"internalType": "uint256", "name": "evaluatedAt", "type": "uint256"}, + {"internalType": "uint256", "name": "snapshotBlock", "type": "uint256"}, + {"internalType": "uint256", "name": "decisionWindow", "type": "uint256"}, + {"internalType": "uint256", "name": "appealDeadline", "type": "uint256"}, + {"internalType": "bool", "name": "materializesDecision", "type": "bool"}, + {"internalType": "bool", "name": "actionOutcomeDeterministic", "type": "bool"}, + {"internalType": "bool", "name": "nonCurrentEvaluation", "type": "bool"} + ], + "internalType": "struct IIdlenessPhase.ResolutionPlan", + "name": "resolution", + "type": "tuple" + }, + { + "components": [ + {"internalType": "bool", "name": "exists", "type": "bool"}, + {"internalType": "uint256", "name": "decisionId", "type": "uint256"}, + {"internalType": "uint256", "name": "basisDecisionId", "type": "uint256"}, + {"internalType": "enum ITransactionManager.ResolutionContext", "name": "context", "type": "uint8"}, + {"internalType": "enum ITransactionManager.ResolutionSource", "name": "source", "type": "uint8"}, + {"internalType": "bytes32", "name": "sourceAttemptId", "type": "bytes32"}, + {"internalType": "enum ITransactions.TransactionStatus", "name": "sourceStatus", "type": "uint8"}, + {"internalType": "enum ITransactions.TransactionStatus", "name": "status", "type": "uint8"}, + {"internalType": "uint256", "name": "sourceRound", "type": "uint256"}, + {"internalType": "uint256", "name": "sourceGeneration", "type": "uint256"}, + {"internalType": "bytes32", "name": "sourceRoundContextHash", "type": "bytes32"}, + {"internalType": "bytes32", "name": "roundPlanHash", "type": "bytes32"}, + {"internalType": "uint256", "name": "resultRound", "type": "uint256"}, + {"internalType": "uint256", "name": "resultGeneration", "type": "uint256"}, + {"internalType": "enum ITransactions.ResultType", "name": "result", "type": "uint8"}, + {"internalType": "bytes32", "name": "resultHash", "type": "bytes32"}, + {"internalType": "uint256", "name": "effectiveAt", "type": "uint256"}, + {"internalType": "uint256", "name": "materializedAt", "type": "uint256"}, + {"internalType": "uint256", "name": "appealDeadline", "type": "uint256"} + ], + "internalType": "struct ITransactionManager.DecisionRecord", + "name": "latestDecision", + "type": "tuple" + }, + {"internalType": "bool", "name": "decisionActive", "type": "bool"} + ], + "internalType": "struct ConsensusData.TransactionLifecycle", + "name": "lifecycle", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "bytes32", "name": "_txId", "type": "bytes32"}, + {"internalType": "uint256", "name": "_currentTimestamp", "type": "uint256"}, + {"internalType": "uint256", "name": "_expectedDecisionId", "type": "uint256"} + ], + "name": "canFinalize", + "outputs": [ + {"internalType": "bool", "name": "ready", "type": "bool"}, + {"internalType": "uint256", "name": "evaluatedAt", "type": "uint256"}, + {"internalType": "uint256", "name": "appealDeadline", "type": "uint256"} + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/genlayer_py/consensus/abi/consensus_data_train_reads_abi.json b/genlayer_py/consensus/abi/consensus_data_train_reads_abi.json new file mode 100644 index 0000000..104da96 --- /dev/null +++ b/genlayer_py/consensus/abi/consensus_data_train_reads_abi.json @@ -0,0 +1,4 @@ +[ + {"inputs":[{"internalType":"bytes32","name":"_txId","type":"bytes32"}],"name":"getStoredTransactionData","outputs":[{"components":[{"internalType":"uint256","name":"observedAt","type":"uint256"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"initialRotations","type":"uint256"},{"internalType":"uint256","name":"txSlot","type":"uint256"},{"internalType":"uint256","name":"createdTimestamp","type":"uint256"},{"internalType":"uint256","name":"lastVoteTimestamp","type":"uint256"},{"internalType":"bytes32","name":"randomSeed","type":"bytes32"},{"internalType":"enum ITransactions.ResultType","name":"result","type":"uint8"},{"internalType":"bytes32","name":"txExecutionHash","type":"bytes32"},{"internalType":"bytes","name":"txCalldata","type":"bytes"},{"internalType":"bytes","name":"eqBlocksOutputs","type":"bytes"},{"components":[{"internalType":"enum IMessages.MessageType","name":"messageType","type":"uint8"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bool","name":"onAcceptance","type":"bool"},{"internalType":"uint256","name":"saltNonce","type":"uint256"},{"internalType":"bytes","name":"feeParams","type":"bytes"},{"internalType":"uint256","name":"declaredBudget","type":"uint256"},{"internalType":"bytes","name":"allocationSubtree","type":"bytes"},{"internalType":"bytes32","name":"callKey","type":"bytes32"},{"internalType":"bool","name":"useBalance","type":"bool"}],"internalType":"struct IMessages.SubmittedMessage[]","name":"messages","type":"tuple[]"},{"internalType":"enum IQueues.QueueType","name":"queueType","type":"uint8"},{"internalType":"uint256","name":"queuePosition","type":"uint256"},{"internalType":"address","name":"activator","type":"address"},{"internalType":"address","name":"lastLeader","type":"address"},{"internalType":"enum ITransactions.TransactionStatus","name":"status","type":"uint8"},{"internalType":"bytes32","name":"txId","type":"bytes32"},{"components":[{"internalType":"uint256","name":"activationBlock","type":"uint256"},{"internalType":"uint256","name":"processingBlock","type":"uint256"},{"internalType":"uint256","name":"proposalBlock","type":"uint256"}],"internalType":"struct ITransactions.ReadStateBlockRange","name":"readStateBlockRange","type":"tuple"},{"internalType":"uint256","name":"numOfRounds","type":"uint256"},{"components":[{"internalType":"uint256","name":"round","type":"uint256"},{"internalType":"uint256","name":"leaderIndex","type":"uint256"},{"internalType":"uint256","name":"votesCommitted","type":"uint256"},{"internalType":"uint256","name":"votesRevealed","type":"uint256"},{"internalType":"uint256","name":"appealBond","type":"uint256"},{"internalType":"uint256","name":"rotationsLeft","type":"uint256"},{"internalType":"enum ITransactions.ResultType","name":"result","type":"uint8"},{"internalType":"address[]","name":"roundValidators","type":"address[]"},{"internalType":"enum ITransactions.VoteType[]","name":"validatorVotes","type":"uint8[]"},{"internalType":"bytes32[]","name":"validatorVotesHash","type":"bytes32[]"},{"internalType":"bytes32[]","name":"validatorResultHash","type":"bytes32[]"}],"internalType":"struct ITransactions.RoundData","name":"lastRound","type":"tuple"},{"internalType":"address[]","name":"consumedValidators","type":"address[]"}],"internalType":"struct ConsensusData.TransactionData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"}, + {"inputs":[{"internalType":"bytes32","name":"_txId","type":"bytes32"}],"name":"getTransactionAllData","outputs":[{"components":[{"internalType":"enum ITransactions.ResultType","name":"result","type":"uint8"},{"internalType":"enum ITransactions.VoteType","name":"txExecutionResult","type":"uint8"},{"internalType":"enum ITransactions.TransactionStatus","name":"status","type":"uint8"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"activator","type":"address"},{"internalType":"uint256","name":"txSlot","type":"uint256"},{"internalType":"uint256","name":"initialRotations","type":"uint256"},{"internalType":"uint256","name":"numOfInitialValidators","type":"uint256"},{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"bytes32","name":"randomSeed","type":"bytes32"},{"internalType":"bytes32","name":"txExecutionHash","type":"bytes32"},{"internalType":"bytes32","name":"resultHash","type":"bytes32"},{"internalType":"bytes","name":"txCalldata","type":"bytes"},{"internalType":"bytes","name":"eqBlocksOutputs","type":"bytes"},{"components":[{"internalType":"uint256","name":"activationBlock","type":"uint256"},{"internalType":"uint256","name":"processingBlock","type":"uint256"},{"internalType":"uint256","name":"proposalBlock","type":"uint256"}],"internalType":"struct ITransactions.ReadStateBlockRange[]","name":"readStateBlockRanges","type":"tuple[]"},{"internalType":"uint256","name":"validUntil","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"lockedStorageUnitPrice","type":"uint256"},{"internalType":"uint256","name":"storageFeeUsed","type":"uint256"},{"internalType":"uint256","name":"lockedReceiptGasPrice","type":"uint256"},{"internalType":"address","name":"txSigner","type":"address"},{"internalType":"enum ITransactions.QueueContext","name":"queueContext","type":"uint8"}],"internalType":"struct ITransactions.Transaction","name":"transaction","type":"tuple"},{"components":[{"internalType":"uint256","name":"round","type":"uint256"},{"internalType":"uint256","name":"leaderIndex","type":"uint256"},{"internalType":"uint256","name":"votesCommitted","type":"uint256"},{"internalType":"uint256","name":"votesRevealed","type":"uint256"},{"internalType":"uint256","name":"appealBond","type":"uint256"},{"internalType":"uint256","name":"rotationsLeft","type":"uint256"},{"internalType":"enum ITransactions.ResultType","name":"result","type":"uint8"},{"internalType":"address[]","name":"roundValidators","type":"address[]"},{"internalType":"enum ITransactions.VoteType[]","name":"validatorVotes","type":"uint8[]"},{"internalType":"bytes32[]","name":"validatorVotesHash","type":"bytes32[]"},{"internalType":"bytes32[]","name":"validatorResultHash","type":"bytes32[]"}],"internalType":"struct ITransactions.RoundData[]","name":"roundsData","type":"tuple[]"}],"stateMutability":"view","type":"function"} +] diff --git a/genlayer_py/consensus/abi/consensus_main_abi.json b/genlayer_py/consensus/abi/consensus_main_abi.json index d6f97c3..c63e61e 100644 --- a/genlayer_py/consensus/abi/consensus_main_abi.json +++ b/genlayer_py/consensus/abi/consensus_main_abi.json @@ -1,1114 +1,2361 @@ [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "oldActivator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newActivator", - "type": "address" - } - ], - "name": "ActivatorReplaced", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "addressManager", - "type": "address" - } - ], - "name": "AddressManagerSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "enum ITransactions.TransactionStatus", - "name": "newStatus", - "type": "uint8" - } - ], - "name": "AllVotesCommitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "appellant", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "bond", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "validators", - "type": "address[]" - } - ], - "name": "AppealStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "attempted", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "succeeded", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "failed", - "type": "uint256" - } - ], - "name": "BatchFinalizationCompleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - } - ], - "name": "CreatedTransaction", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "activator", - "type": "address" - } - ], - "name": "InternalMessageProcessed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "oldLeader", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newLeader", - "type": "address" - } - ], - "name": "LeaderIdlenessProcessed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "activator", - "type": "address" - } - ], - "name": "NewTransaction", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "ProcessIdlenessAccepted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "TransactionAccepted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "leader", - "type": "address" - } - ], - "name": "TransactionActivated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "cancelledBy", - "type": "address" - } - ], - "name": "TransactionCancelled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "TransactionFinalizationFailed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "TransactionFinalized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "TransactionLeaderRevealed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "newLeader", - "type": "address" - } - ], - "name": "TransactionLeaderRotated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "TransactionLeaderTimeout", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32[]", - "name": "txIds", - "type": "bytes32[]" - } - ], - "name": "TransactionNeedsRecomputation", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "validators", - "type": "address[]" - } - ], - "name": "TransactionReceiptProposed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "TransactionUndetermined", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tribunalIndex", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - } - ], - "name": "TribunalAppealVoteCommitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tribunalIndex", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "enum ITransactions.VoteType", - "name": "voteType", - "type": "uint8" - } - ], - "name": "TribunalAppealVoteRevealed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "oldValidator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newValidator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "validatorIndex", - "type": "uint256" - } - ], - "name": "ValidatorReplaced", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "ValueWithdrawalFailed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isLastVote", - "type": "bool" - } - ], - "name": "VoteCommitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "enum ITransactions.VoteType", - "name": "voteType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isLastVote", - "type": "bool" - }, - { - "indexed": false, - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - } - ], - "name": "VoteRevealed", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "_operator", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_vrfProof", - "type": "bytes" - } - ], - "name": "activateTransaction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_sender", - "type": "address" - }, - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_numOfInitialValidators", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxRotations", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "_validUntil", - "type": "uint256" - } - ], - "name": "addTransaction", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "cancelTransaction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_tribunalIndex", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "_commitHash", - "type": "bytes32" - } - ], - "name": "commitTribunalAppealVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_commitHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_validatorIndex", - "type": "uint256" - } - ], - "name": "commitVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_sender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_numOfInitialValidators", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxRotations", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "_saltNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_validUntil", - "type": "uint256" - } - ], - "name": "deploySalted", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "executeMessage", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32[]", - "name": "_txIds", - "type": "bytes32[]" - } - ], - "name": "finalizeIdlenessTxs", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "finalizeTransaction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "flushExternalMessages", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAddressManager", - "outputs": [ - { - "internalType": "contract IAddressManager", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "getPendingTransactionValue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "isGhostContract", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "leaderIdleness", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "saltAsAValidator", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "txExecutionHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "messagesAndOtherFieldsHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "otherExecutionFieldsHash", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.VoteType", - "name": "resultValue", - "type": "uint8" - }, - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "saltNonce", - "type": "uint256" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" - } - ], - "internalType": "struct IConsensusMain.LeaderRevealVoteParams", - "name": "leaderRevealVoteParams", - "type": "tuple" - } - ], - "name": "leaderRevealVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "processIdleness", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_txExecutionHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_processingBlock", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_operator", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_eqBlocksOutputs", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "_vrfProof", - "type": "bytes" - } - ], - "name": "proposeReceipt", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32[]", - "name": "_txIds", - "type": "bytes32[]" - } - ], - "name": "redButtonFinalize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ghost", - "type": "address" - } - ], - "name": "registerGhostContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_tribunalIndex", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "_voteHash", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.VoteType", - "name": "_voteType", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "_otherExecutionFieldsHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - } - ], - "name": "revealTribunalAppealVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_voteHash", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.VoteType", - "name": "_voteType", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "_otherExecutionFieldsHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_validatorIndex", - "type": "uint256" - } - ], - "name": "revealVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_addressManager", - "type": "address" - } - ], - "name": "setAddressManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "submitAppeal", - "outputs": [], - "stateMutability": "payable", - "type": "function" - } + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "CallerNotMessages", + "type": "error" + }, + { + "inputs": [], + "name": "CanNotAppeal", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "attemptedConsumption", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "budget", + "type": "uint256" + } + ], + "name": "ExecutionBudgetExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientFees", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDeploymentWithSalt", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidRevealLeaderData", + "type": "error" + }, + { + "inputs": [], + "name": "LegacyProposeReceiptRetired", + "type": "error" + }, + { + "inputs": [], + "name": "MessageFeesTotalMustBeNonZero", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrancyGuardReentrantCall", + "type": "error" + }, + { + "inputs": [], + "name": "RollupBudgetBelowFloor", + "type": "error" + }, + { + "inputs": [], + "name": "Unauthorized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldActivator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newActivator", + "type": "address" + } + ], + "name": "ActivatorReplaced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "addressManager", + "type": "address" + } + ], + "name": "AddressManagerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "enum ITransactions.TransactionStatus", + "name": "newStatus", + "type": "uint8" + } + ], + "name": "AllVotesCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "appealer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AppealBondReturned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "appellant", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "bond", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } + ], + "name": "AppealStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "appealer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "bondReturned", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "profitUnpaid", + "type": "uint256" + } + ], + "name": "AppealerProfitPayoutFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "uint8", + "name": "commandKind", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes4", + "name": "errorSelector", + "type": "bytes4" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "failureFingerprint", + "type": "bytes32" + } + ], + "name": "BatchCommandFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "attempted", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "finalized", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "progressed", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "failed", + "type": "uint256" + } + ], + "name": "BatchFinalizationCompleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "attempted", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "resolved", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "failed", + "type": "uint256" + } + ], + "name": "BatchResolutionCompleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + } + ], + "name": "CreatedTransaction", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "FeesRefunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "activator", + "type": "address" + } + ], + "name": "InternalMessageProcessed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldLeader", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newLeader", + "type": "address" + } + ], + "name": "LeaderIdlenessProcessed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "activator", + "type": "address" + } + ], + "name": "NewTransaction", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "firstAnnouncedAt", + "type": "uint256" + } + ], + "name": "NewTransactionAlreadyAnnounced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "ProcessIdlenessAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "receiptFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "gasPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "estimatedGas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "receiptBytes", + "type": "uint256" + } + ], + "name": "ReceiptFeeEstimated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "leader", + "type": "address" + } + ], + "name": "TransactionActivated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "cancelledBy", + "type": "address" + } + ], + "name": "TransactionCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionLeaderRevealed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "newLeader", + "type": "address" + } + ], + "name": "TransactionLeaderRotated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionLeaderTimeout", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32[]", + "name": "txIds", + "type": "bytes32[]" + } + ], + "name": "TransactionNeedsRecomputation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } + ], + "name": "TransactionReceiptProposed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionUndetermined", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tribunalIndex", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + } + ], + "name": "TribunalAppealVoteCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tribunalIndex", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ITransactions.VoteType", + "name": "voteType", + "type": "uint8" + } + ], + "name": "TribunalAppealVoteRevealed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "chunkIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "recipients", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "UnifiedFeesDistributed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "UserValueRefunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldValidator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newValidator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "validatorIndex", + "type": "uint256" + } + ], + "name": "ValidatorReplaced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "ValueWithdrawalFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLastVote", + "type": "bool" + } + ], + "name": "VoteCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ITransactions.VoteType", + "name": "voteType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLastVote", + "type": "bool" + }, + { + "indexed": false, + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + } + ], + "name": "VoteRevealed", + "type": "event" + }, + { + "inputs": [], + "name": "EVENTS_BATCH_SIZE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "activateTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "activatorIdleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "numOfInitialValidators", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userValue", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "leaderTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validatorTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealRounds", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionBudgetPerRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionConsumed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalMessageFees", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "rotations", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "maxPriceGenPerTimeUnit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "storageFeeMaxGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "receiptFeeMaxGasPrice", + "type": "uint256" + } + ], + "internalType": "struct IFeeManager.FeesDistribution", + "name": "feesDistribution", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "parentIndex", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "budget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + } + ], + "internalType": "struct IMessages.MessageFeeAllocationNode[]", + "name": "messageAllocations", + "type": "tuple[]" + } + ], + "internalType": "struct IConsensusMainWithFees.AddTransactionParams", + "name": "_params", + "type": "tuple" + } + ], + "name": "addTransaction", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "addressManager", + "outputs": [ + { + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "cancelTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_commitHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_validatorIndex", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "commitVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "numOfInitialValidators", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userValue", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "leaderTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validatorTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealRounds", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionBudgetPerRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionConsumed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalMessageFees", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "rotations", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "maxPriceGenPerTimeUnit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "storageFeeMaxGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "receiptFeeMaxGasPrice", + "type": "uint256" + } + ], + "internalType": "struct IFeeManager.FeesDistribution", + "name": "feesDistribution", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "parentIndex", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "budget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + } + ], + "internalType": "struct IMessages.MessageFeeAllocationNode[]", + "name": "messageAllocations", + "type": "tuple[]" + } + ], + "internalType": "struct IConsensusMainWithFees.AddTransactionParams", + "name": "_params", + "type": "tuple" + } + ], + "name": "deploySalted", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_expectedDecisionId", + "type": "uint256" + } + ], + "name": "estimateAppealCharge", + "outputs": [ + { + "internalType": "uint256", + "name": "bond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "funding", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_gasLimit", + "type": "uint256" + } + ], + "name": "executeMessage", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "expectedDecisionId", + "type": "uint256" + } + ], + "internalType": "struct IFinalizationPhase.FinalizeTransactionParams", + "name": "command", + "type": "tuple" + } + ], + "name": "finalizeDecisionBatchItem", + "outputs": [ + { + "internalType": "uint8", + "name": "outcome", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "expectedDecisionId", + "type": "uint256" + } + ], + "internalType": "struct IFinalizationPhase.FinalizeTransactionParams[]", + "name": "_commands", + "type": "tuple[]" + } + ], + "name": "finalizeDecisions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_expectedDecisionId", + "type": "uint256" + } + ], + "name": "finalizeTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "flushExternalMessages", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "flushInternalMessages", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAddressManager", + "outputs": [ + { + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "getPendingTransactionValue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "isAuthorizedGhostCaller", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isGhostContract", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "leaderIdleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "expectedAttemptId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "saltAsAValidator", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "messagesAndOtherFieldsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "otherExecutionFieldsHash", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "resultValue", + "type": "uint8" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "declaredBudget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "allocationSubtree", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "useBalance", + "type": "bool" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + } + ], + "internalType": "struct IConsensusMainWithFees.LeaderRevealVoteParams", + "name": "leaderRevealVoteParams", + "type": "tuple" + } + ], + "name": "leaderRevealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "processIdleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "recipients", + "type": "address[]" + } + ], + "name": "promoteNextPendingTransactions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "proposeReceipt", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_storageFeeUsed", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_eqBlocksOutputs", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "proposeReceipt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_processingBlock", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_eqBlocksOutputs", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "proposeReceipt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_storageFeeUsed", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_eqBlocksOutputs", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_reportedMessageFeesTotal", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "proposeReceiptWithMessages", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ghost", + "type": "address" + } + ], + "name": "registerGhostContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "expectedAttemptId", + "type": "bytes32" + } + ], + "internalType": "struct IIdlenessPhase.ProcessIdlenessParams", + "name": "command", + "type": "tuple" + } + ], + "name": "resolveTransactionBatchItem", + "outputs": [ + { + "internalType": "uint8", + "name": "outcome", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "expectedAttemptId", + "type": "bytes32" + } + ], + "internalType": "struct IIdlenessPhase.ProcessIdlenessParams[]", + "name": "_commands", + "type": "tuple[]" + } + ], + "name": "resolveTransactions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_voteHash", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "_voteType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_otherExecutionFieldsHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_validatorIndex", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "revealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "setAddressManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_expectedDecisionId", + "type": "uint256" + } + ], + "name": "submitAppeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_expectedDecisionId", + "type": "uint256" + } + ], + "name": "topUpAndProgressFinalization", + "outputs": [ + { + "internalType": "bool", + "name": "finalized", + "type": "bool" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_expectedDecisionId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "leaderTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validatorTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealRounds", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionBudgetPerRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionConsumed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalMessageFees", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "rotations", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "maxPriceGenPerTimeUnit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "storageFeeMaxGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "receiptFeeMaxGasPrice", + "type": "uint256" + } + ], + "internalType": "struct IFeeManager.FeesDistribution", + "name": "", + "type": "tuple" + } + ], + "name": "topUpAndSubmitAppeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "leaderTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validatorTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealRounds", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionBudgetPerRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionConsumed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalMessageFees", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "rotations", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "maxPriceGenPerTimeUnit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "storageFeeMaxGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "receiptFeeMaxGasPrice", + "type": "uint256" + } + ], + "internalType": "struct IFeeManager.FeesDistribution", + "name": "_feesDistribution", + "type": "tuple" + } + ], + "name": "topUpFees", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferEthOnBehalf", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } ] diff --git a/genlayer_py/consensus/abi/consensus_main_abi_v06.json b/genlayer_py/consensus/abi/consensus_main_abi_v06.json index 7b0b9dd..c63e61e 100644 --- a/genlayer_py/consensus/abi/consensus_main_abi_v06.json +++ b/genlayer_py/consensus/abi/consensus_main_abi_v06.json @@ -1,1346 +1,2361 @@ [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "CallerNotMessages", - "type": "error" - }, - { - "inputs": [], - "name": "CanNotAppeal", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidDeploymentWithSalt", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidGhostContract", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidRevealLeaderData", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidVote", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnableInvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "OwnableUnauthorizedAccount", - "type": "error" - }, - { - "inputs": [], - "name": "ReentrancyGuardReentrantCall", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "oldActivator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newActivator", - "type": "address" - } - ], - "name": "ActivatorReplaced", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "addressManager", - "type": "address" - } - ], - "name": "AddressManagerSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "enum ITransactions.TransactionStatus", - "name": "newStatus", - "type": "uint8" - } - ], - "name": "AllVotesCommitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "appellant", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "bond", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "validators", - "type": "address[]" - } - ], - "name": "AppealStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "attempted", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "succeeded", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "failed", - "type": "uint256" - } - ], - "name": "BatchFinalizationCompleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - } - ], - "name": "CreatedTransaction", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "activator", - "type": "address" - } - ], - "name": "InternalMessageProcessed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "oldLeader", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newLeader", - "type": "address" - } - ], - "name": "LeaderIdlenessProcessed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "activator", - "type": "address" - } - ], - "name": "NewTransaction", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "ProcessIdlenessAccepted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "TransactionAccepted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "leader", - "type": "address" - } - ], - "name": "TransactionActivated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "cancelledBy", - "type": "address" - } - ], - "name": "TransactionCancelled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "TransactionFinalizationFailed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "TransactionFinalized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "TransactionLeaderRevealed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "newLeader", - "type": "address" - } - ], - "name": "TransactionLeaderRotated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "TransactionLeaderTimeout", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32[]", - "name": "txIds", - "type": "bytes32[]" - } - ], - "name": "TransactionNeedsRecomputation", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "validators", - "type": "address[]" - } - ], - "name": "TransactionReceiptProposed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "TransactionUndetermined", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tribunalIndex", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - } - ], - "name": "TribunalAppealVoteCommitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tribunalIndex", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "enum ITransactions.VoteType", - "name": "voteType", - "type": "uint8" - } - ], - "name": "TribunalAppealVoteRevealed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "oldValidator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newValidator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "validatorIndex", - "type": "uint256" - } - ], - "name": "ValidatorReplaced", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "ValueWithdrawalFailed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isLastVote", - "type": "bool" - } - ], - "name": "VoteCommitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "enum ITransactions.VoteType", - "name": "voteType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bool", - "name": "isLastVote", - "type": "bool" - }, - { - "indexed": false, - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" - } - ], - "name": "VoteRevealed", - "type": "event" - }, - { - "inputs": [], - "name": "EVENTS_BATCH_SIZE", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "VERSION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "_operator", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_vrfProof", - "type": "bytes" - } - ], - "name": "activateTransaction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_sender", - "type": "address" - }, - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_numOfInitialValidators", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxRotations", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "_validUntil", - "type": "uint256" - } - ], - "name": "addTransaction", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "addressManager", - "outputs": [ - { - "internalType": "contract IAddressManager", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "cancelTransaction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_tribunalIndex", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "_commitHash", - "type": "bytes32" - } - ], - "name": "commitTribunalAppealVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_commitHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_validatorIndex", - "type": "uint256" - } - ], - "name": "commitVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_sender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_numOfInitialValidators", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxRotations", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "_saltNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_validUntil", - "type": "uint256" - } - ], - "name": "deploySalted", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "executeMessage", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32[]", - "name": "_txIds", - "type": "bytes32[]" - } - ], - "name": "finalizeIdlenessTxs", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "finalizeTransaction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "flushExternalMessages", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAddressManager", - "outputs": [ - { - "internalType": "contract IAddressManager", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "getPendingTransactionValue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_addressManager", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "isGhostContract", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "leaderIdleness", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "saltAsAValidator", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "txExecutionHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "messagesAndOtherFieldsHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "otherExecutionFieldsHash", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.VoteType", - "name": "resultValue", - "type": "uint8" - }, - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "saltNonce", - "type": "uint256" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" - } - ], - "internalType": "struct IConsensusMain.LeaderRevealVoteParams", - "name": "leaderRevealVoteParams", - "type": "tuple" - } - ], - "name": "leaderRevealVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "processIdleness", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_txExecutionHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_processingBlock", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_operator", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_eqBlocksOutputs", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "_vrfProof", - "type": "bytes" - } - ], - "name": "proposeReceipt", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32[]", - "name": "_txIds", - "type": "bytes32[]" - } - ], - "name": "redButtonFinalize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ghost", - "type": "address" - } - ], - "name": "registerGhostContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_tribunalIndex", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "_voteHash", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.VoteType", - "name": "_voteType", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "_otherExecutionFieldsHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - } - ], - "name": "revealTribunalAppealVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_voteHash", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.VoteType", - "name": "_voteType", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "_otherExecutionFieldsHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_validatorIndex", - "type": "uint256" - } - ], - "name": "revealVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_addressManager", - "type": "address" - } - ], - "name": "setAddressManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "submitAppeal", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "CallerNotMessages", + "type": "error" + }, + { + "inputs": [], + "name": "CanNotAppeal", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "attemptedConsumption", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "budget", + "type": "uint256" + } + ], + "name": "ExecutionBudgetExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientFees", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDeploymentWithSalt", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidRevealLeaderData", + "type": "error" + }, + { + "inputs": [], + "name": "LegacyProposeReceiptRetired", + "type": "error" + }, + { + "inputs": [], + "name": "MessageFeesTotalMustBeNonZero", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrancyGuardReentrantCall", + "type": "error" + }, + { + "inputs": [], + "name": "RollupBudgetBelowFloor", + "type": "error" + }, + { + "inputs": [], + "name": "Unauthorized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldActivator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newActivator", + "type": "address" + } + ], + "name": "ActivatorReplaced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "addressManager", + "type": "address" + } + ], + "name": "AddressManagerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "enum ITransactions.TransactionStatus", + "name": "newStatus", + "type": "uint8" + } + ], + "name": "AllVotesCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "appealer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AppealBondReturned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "appellant", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "bond", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } + ], + "name": "AppealStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "appealer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "bondReturned", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "profitUnpaid", + "type": "uint256" + } + ], + "name": "AppealerProfitPayoutFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "uint8", + "name": "commandKind", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes4", + "name": "errorSelector", + "type": "bytes4" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "failureFingerprint", + "type": "bytes32" + } + ], + "name": "BatchCommandFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "attempted", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "finalized", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "progressed", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "failed", + "type": "uint256" + } + ], + "name": "BatchFinalizationCompleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "attempted", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "resolved", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "failed", + "type": "uint256" + } + ], + "name": "BatchResolutionCompleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" + } + ], + "name": "CreatedTransaction", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "FeesRefunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "activator", + "type": "address" + } + ], + "name": "InternalMessageProcessed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldLeader", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newLeader", + "type": "address" + } + ], + "name": "LeaderIdlenessProcessed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "activator", + "type": "address" + } + ], + "name": "NewTransaction", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "firstAnnouncedAt", + "type": "uint256" + } + ], + "name": "NewTransactionAlreadyAnnounced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "ProcessIdlenessAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "receiptFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "gasPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "estimatedGas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "receiptBytes", + "type": "uint256" + } + ], + "name": "ReceiptFeeEstimated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "leader", + "type": "address" + } + ], + "name": "TransactionActivated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "cancelledBy", + "type": "address" + } + ], + "name": "TransactionCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionLeaderRevealed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "newLeader", + "type": "address" + } + ], + "name": "TransactionLeaderRotated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionLeaderTimeout", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32[]", + "name": "txIds", + "type": "bytes32[]" + } + ], + "name": "TransactionNeedsRecomputation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } + ], + "name": "TransactionReceiptProposed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "TransactionUndetermined", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tribunalIndex", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + } + ], + "name": "TribunalAppealVoteCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tribunalIndex", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ITransactions.VoteType", + "name": "voteType", + "type": "uint8" + } + ], + "name": "TribunalAppealVoteRevealed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "chunkIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "recipients", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "UnifiedFeesDistributed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "UserValueRefunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldValidator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newValidator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "validatorIndex", + "type": "uint256" + } + ], + "name": "ValidatorReplaced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "ValueWithdrawalFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLastVote", + "type": "bool" + } + ], + "name": "VoteCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ITransactions.VoteType", + "name": "voteType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isLastVote", + "type": "bool" + }, + { + "indexed": false, + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" + } + ], + "name": "VoteRevealed", + "type": "event" + }, + { + "inputs": [], + "name": "EVENTS_BATCH_SIZE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "activateTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "activatorIdleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "numOfInitialValidators", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userValue", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "leaderTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validatorTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealRounds", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionBudgetPerRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionConsumed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalMessageFees", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "rotations", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "maxPriceGenPerTimeUnit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "storageFeeMaxGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "receiptFeeMaxGasPrice", + "type": "uint256" + } + ], + "internalType": "struct IFeeManager.FeesDistribution", + "name": "feesDistribution", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "parentIndex", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "budget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + } + ], + "internalType": "struct IMessages.MessageFeeAllocationNode[]", + "name": "messageAllocations", + "type": "tuple[]" + } + ], + "internalType": "struct IConsensusMainWithFees.AddTransactionParams", + "name": "_params", + "type": "tuple" + } + ], + "name": "addTransaction", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "addressManager", + "outputs": [ + { + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "cancelTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_commitHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_validatorIndex", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "commitVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "numOfInitialValidators", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxRotations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validUntil", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "userValue", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "leaderTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validatorTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealRounds", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionBudgetPerRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionConsumed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalMessageFees", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "rotations", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "maxPriceGenPerTimeUnit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "storageFeeMaxGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "receiptFeeMaxGasPrice", + "type": "uint256" + } + ], + "internalType": "struct IFeeManager.FeesDistribution", + "name": "feesDistribution", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "txCalldata", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "parentIndex", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "budget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + } + ], + "internalType": "struct IMessages.MessageFeeAllocationNode[]", + "name": "messageAllocations", + "type": "tuple[]" + } + ], + "internalType": "struct IConsensusMainWithFees.AddTransactionParams", + "name": "_params", + "type": "tuple" + } + ], + "name": "deploySalted", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_expectedDecisionId", + "type": "uint256" + } + ], + "name": "estimateAppealCharge", + "outputs": [ + { + "internalType": "uint256", + "name": "bond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "funding", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_gasLimit", + "type": "uint256" + } + ], + "name": "executeMessage", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "expectedDecisionId", + "type": "uint256" + } + ], + "internalType": "struct IFinalizationPhase.FinalizeTransactionParams", + "name": "command", + "type": "tuple" + } + ], + "name": "finalizeDecisionBatchItem", + "outputs": [ + { + "internalType": "uint8", + "name": "outcome", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "expectedDecisionId", + "type": "uint256" + } + ], + "internalType": "struct IFinalizationPhase.FinalizeTransactionParams[]", + "name": "_commands", + "type": "tuple[]" + } + ], + "name": "finalizeDecisions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_expectedDecisionId", + "type": "uint256" + } + ], + "name": "finalizeTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "flushExternalMessages", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "flushInternalMessages", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAddressManager", + "outputs": [ + { + "internalType": "contract IAddressManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "getPendingTransactionValue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "isAuthorizedGhostCaller", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isGhostContract", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "leaderIdleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "expectedAttemptId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "saltAsAValidator", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "messagesAndOtherFieldsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "otherExecutionFieldsHash", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "resultValue", + "type": "uint8" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "declaredBudget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "allocationSubtree", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "useBalance", + "type": "bool" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + } + ], + "internalType": "struct IConsensusMainWithFees.LeaderRevealVoteParams", + "name": "leaderRevealVoteParams", + "type": "tuple" + } + ], + "name": "leaderRevealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "processIdleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "recipients", + "type": "address[]" + } + ], + "name": "promoteNextPendingTransactions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "proposeReceipt", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_storageFeeUsed", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_eqBlocksOutputs", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "proposeReceipt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_processingBlock", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_eqBlocksOutputs", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "proposeReceipt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_storageFeeUsed", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_eqBlocksOutputs", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_reportedMessageFeesTotal", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "proposeReceiptWithMessages", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ghost", + "type": "address" + } + ], + "name": "registerGhostContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "expectedAttemptId", + "type": "bytes32" + } + ], + "internalType": "struct IIdlenessPhase.ProcessIdlenessParams", + "name": "command", + "type": "tuple" + } + ], + "name": "resolveTransactionBatchItem", + "outputs": [ + { + "internalType": "uint8", + "name": "outcome", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "expectedAttemptId", + "type": "bytes32" + } + ], + "internalType": "struct IIdlenessPhase.ProcessIdlenessParams[]", + "name": "_commands", + "type": "tuple[]" + } + ], + "name": "resolveTransactions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_voteHash", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "_voteType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_otherExecutionFieldsHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_validatorIndex", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "revealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addressManager", + "type": "address" + } + ], + "name": "setAddressManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_expectedDecisionId", + "type": "uint256" + } + ], + "name": "submitAppeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_expectedDecisionId", + "type": "uint256" + } + ], + "name": "topUpAndProgressFinalization", + "outputs": [ + { + "internalType": "bool", + "name": "finalized", + "type": "bool" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_expectedDecisionId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "leaderTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validatorTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealRounds", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionBudgetPerRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionConsumed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalMessageFees", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "rotations", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "maxPriceGenPerTimeUnit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "storageFeeMaxGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "receiptFeeMaxGasPrice", + "type": "uint256" + } + ], + "internalType": "struct IFeeManager.FeesDistribution", + "name": "", + "type": "tuple" + } + ], + "name": "topUpAndSubmitAppeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "leaderTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validatorTimeunitsAllocation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "appealRounds", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionBudgetPerRound", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionConsumed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalMessageFees", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "rotations", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "maxPriceGenPerTimeUnit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "storageFeeMaxGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "receiptFeeMaxGasPrice", + "type": "uint256" + } + ], + "internalType": "struct IFeeManager.FeesDistribution", + "name": "_feesDistribution", + "type": "tuple" + } + ], + "name": "topUpFees", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferEthOnBehalf", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } ] diff --git a/genlayer_py/consensus/abi/rounds_storage_read_abi.json b/genlayer_py/consensus/abi/rounds_storage_read_abi.json new file mode 100644 index 0000000..5d84503 --- /dev/null +++ b/genlayer_py/consensus/abi/rounds_storage_read_abi.json @@ -0,0 +1,74 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + } + ], + "name": "getValidatorVotes", + "outputs": [ + { + "internalType": "enum ITransactions.VoteType[]", + "name": "votes", + "type": "uint8[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + } + ], + "name": "getValidatorVotesHash", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "hashes", + "type": "bytes32[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "round", + "type": "uint256" + } + ], + "name": "getValidatorResultHash", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "hashes", + "type": "bytes32[]" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/genlayer_py/consensus/abi/transaction_manager_read_abi.json b/genlayer_py/consensus/abi/transaction_manager_read_abi.json new file mode 100644 index 0000000..fc059f2 --- /dev/null +++ b/genlayer_py/consensus/abi/transaction_manager_read_abi.json @@ -0,0 +1,40 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "getTxExecutionResult", + "outputs": [ + { + "internalType": "enum ITransactions.VoteType", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "getNumOfInitialValidators", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/genlayer_py/consensus/consensus_main/decoder.py b/genlayer_py/consensus/consensus_main/decoder.py index b0fbea3..d2a62df 100644 --- a/genlayer_py/consensus/consensus_main/decoder.py +++ b/genlayer_py/consensus/consensus_main/decoder.py @@ -2,8 +2,11 @@ import rlp from web3 import Web3 from eth_abi import decode as abi_decode -from genlayer_py.consensus.abi import CONSENSUS_MAIN_ABI from genlayer_py.abi import calldata +from genlayer_py.consensus.consensus_main.legacy_abi import ( + LEGACY_ADD_TRANSACTION_ARGUMENT_TYPES, + LEGACY_ADD_TRANSACTION_SELECTOR, +) from genlayer_py.transactions.fees import ( ADD_TRANSACTION_WITH_FEES_ARGUMENT_TYPES, ADD_TRANSACTION_WITH_FEES_SELECTOR, @@ -24,10 +27,10 @@ def decode_add_transaction_data(encoded_data): ) return _format_fee_aware_add_transaction_data(abi_decoded[0]) - consensus_main_contract = w3.eth.contract(abi=CONSENSUS_MAIN_ABI) - contract_fn = consensus_main_contract.get_function_by_name("addTransaction") + if selector != LEGACY_ADD_TRANSACTION_SELECTOR: + raise ValueError(f"Unsupported addTransaction selector: 0x{selector}") abi_decoded = abi_decode( - contract_fn.argument_types, + LEGACY_ADD_TRANSACTION_ARGUMENT_TYPES, w3.to_bytes(hexstr=payload), ) encoded_tx_data_bytes = abi_decoded[4] @@ -64,8 +67,7 @@ def _format_fee_aware_add_transaction_data(params): "user_value": params[6], "fees_distribution": decode_fees_distribution_tuple(params[7]), "message_allocations": [ - decode_message_allocation_tuple(allocation) - for allocation in params[9] + decode_message_allocation_tuple(allocation) for allocation in params[9] ], } diff --git a/genlayer_py/consensus/consensus_main/encoder.py b/genlayer_py/consensus/consensus_main/encoder.py index 7332203..5df2b7f 100644 --- a/genlayer_py/consensus/consensus_main/encoder.py +++ b/genlayer_py/consensus/consensus_main/encoder.py @@ -7,8 +7,10 @@ from web3 import Web3 from eth_abi import encode as abi_encode from eth_typing import HexStr -import eth_utils -from genlayer_py.consensus.abi import CONSENSUS_MAIN_ABI +from genlayer_py.consensus.consensus_main.legacy_abi import ( + LEGACY_ADD_TRANSACTION_ARGUMENT_TYPES, + LEGACY_ADD_TRANSACTION_SELECTOR, +) from genlayer_py.transactions.fees import ( TransactionFeeOptions, encode_fee_aware_add_transaction_data, @@ -29,7 +31,6 @@ def encode_add_transaction_data( fee_aware: bool = False, ): w3 = Web3() - consensus_main_contract = w3.eth.contract(abi=CONSENSUS_MAIN_ABI) transaction_fees = normalize_transaction_fees(fees) if ( @@ -49,23 +50,20 @@ def encode_add_transaction_data( transaction_fees=transaction_fees, ) - contract_fn = consensus_main_contract.get_function_by_name("addTransaction") add_transaction_args = [ sender_address, recipient_address, num_of_initial_validators, max_rotations, w3.to_bytes(hexstr=tx_data), + valid_until, ] - if len(contract_fn.argument_types) >= 6: - add_transaction_args.append(valid_until) params = abi_encode( - contract_fn.argument_types, + LEGACY_ADD_TRANSACTION_ARGUMENT_TYPES, add_transaction_args, ) - function_selector = eth_utils.keccak(text=contract_fn.signature)[:4].hex() - encoded_data = "0x" + function_selector + params.hex() + encoded_data = "0x" + LEGACY_ADD_TRANSACTION_SELECTOR + params.hex() return encoded_data diff --git a/genlayer_py/consensus/consensus_main/legacy_abi.py b/genlayer_py/consensus/consensus_main/legacy_abi.py new file mode 100644 index 0000000..53f8171 --- /dev/null +++ b/genlayer_py/consensus/consensus_main/legacy_abi.py @@ -0,0 +1,23 @@ +"""Private codec constants for the pre-fee ConsensusMain call shape. + +The exported ConsensusMain ABI tracks the v0.6 train. These constants exist +only so the SDK can still decode or deliberately produce historical payloads +without letting an old selector leak back into the public contract surface. +""" + +import eth_utils + +LEGACY_ADD_TRANSACTION_ARGUMENT_TYPES = ( + "address", + "address", + "uint256", + "uint256", + "bytes", + "uint256", +) +LEGACY_ADD_TRANSACTION_SIGNATURE = ( + "addTransaction(address,address,uint256,uint256,bytes,uint256)" +) +LEGACY_ADD_TRANSACTION_SELECTOR = eth_utils.keccak( + text=LEGACY_ADD_TRANSACTION_SIGNATURE +)[:4].hex() diff --git a/genlayer_py/contracts/actions.py b/genlayer_py/contracts/actions.py index 1679443..a704421 100644 --- a/genlayer_py/contracts/actions.py +++ b/genlayer_py/contracts/actions.py @@ -72,7 +72,11 @@ def get_contract_schema_for_code( if self.chain.id != localnet.id: raise GenLayerError("Contract schema is not supported on this network") - code_bytes = contract_code.encode("utf-8") if isinstance(contract_code, str) else contract_code + code_bytes = ( + contract_code.encode("utf-8") + if isinstance(contract_code, str) + else contract_code + ) response = self.provider.make_request( method="gen_getContractSchemaForCode", params=[eth_utils.hexadecimal.encode_hex(code_bytes)], @@ -223,20 +227,49 @@ def appeal_transaction( transaction_id: HexStr, account: Optional[LocalAccount] = None, value: Optional[int] = None, + expected_decision_id: Optional[int] = None, ) -> HexStr: """Appeals a consensus transaction. Returns the original transaction_id. Appeals emit AppealStarted/TransactionActivated events (not NewTransaction), so we send the EVM tx directly instead of going through _send_transaction. + Deployed Consensus binds the appeal to the exact active decision. Current + Studio exposes its native ``submitAppeal(bytes32)`` entrypoint instead, so + callers must provide the value explicitly and cannot supply a decision id. """ sender_account = account if account is not None else self.local_account if sender_account is None: raise GenLayerError("No account set.") if self.chain.consensus_main_contract is None: raise GenLayerError("Consensus main contract not configured.") - resolved_value = _resolve_appeal_value(self, transaction_id, value) + if _is_studio_chain(self): + resolved_value = _resolve_studio_appeal_value(value, expected_decision_id) + encoded_data = _encode_submit_appeal_data( + self=self, + transaction_id=transaction_id, + studio_appeal_shape=True, + ) + _send_consensus_call( + self=self, + encoded_data=encoded_data, + sender_account=sender_account, + value=resolved_value, + operation_name="Appeal", + ) + return transaction_id + + expected_decision_id, resolved_value = _resolve_appeal_parameters( + self, + transaction_id, + expected_decision_id=expected_decision_id, + value=value, + ) - encoded_data = _encode_submit_appeal_data(self=self, transaction_id=transaction_id) + encoded_data = _encode_submit_appeal_data( + self=self, + transaction_id=transaction_id, + expected_decision_id=expected_decision_id, + ) _send_consensus_call( self=self, @@ -283,18 +316,45 @@ def top_up_and_submit_appeal( distribution: FeesDistributionInput, account: Optional[LocalAccount] = None, value: Optional[int] = None, + expected_decision_id: Optional[int] = None, ) -> HexStr: """Deposits appeal fee budget and submits an appeal in one consensus call. Returns the original GenLayer transaction id, matching appeal_transaction. + Current Studio exposes the native decision-free call shape. Deployed + Consensus uses the decision-bound train shape. """ sender_account = account if account is not None else self.local_account - resolved_value = _resolve_appeal_value(self, transaction_id, value) + if _is_studio_chain(self): + resolved_value = _resolve_studio_appeal_value(value, expected_decision_id) + encoded_data = _encode_fee_management_data( + self=self, + function_name="topUpAndSubmitAppeal", + transaction_id=transaction_id, + distribution=distribution, + studio_appeal_shape=True, + ) + _send_consensus_call( + self=self, + encoded_data=encoded_data, + sender_account=sender_account, + value=resolved_value, + operation_name="Top up and submit appeal", + ) + return transaction_id + + expected_decision_id, resolved_value = _resolve_appeal_parameters( + self, + transaction_id, + expected_decision_id=expected_decision_id, + value=value, + ) encoded_data = _encode_fee_management_data( self=self, function_name="topUpAndSubmitAppeal", transaction_id=transaction_id, distribution=distribution, + expected_decision_id=expected_decision_id, ) _send_consensus_call( self=self, @@ -314,7 +374,9 @@ def get_round_number( if self.chain.rounds_storage_contract is None: raise GenLayerError("rounds_storage_contract not configured for this chain") contract = self.w3.eth.contract( - address=self.w3.to_checksum_address(self.chain.rounds_storage_contract["address"]), + address=self.w3.to_checksum_address( + self.chain.rounds_storage_contract["address"] + ), abi=self.chain.rounds_storage_contract["abi"], ) tx_bytes = _to_bytes32(self, transaction_id) @@ -330,7 +392,9 @@ def get_round_data( if self.chain.rounds_storage_contract is None: raise GenLayerError("rounds_storage_contract not configured for this chain") contract = self.w3.eth.contract( - address=self.w3.to_checksum_address(self.chain.rounds_storage_contract["address"]), + address=self.w3.to_checksum_address( + self.chain.rounds_storage_contract["address"] + ), abi=self.chain.rounds_storage_contract["abi"], ) tx_bytes = _to_bytes32(self, transaction_id) @@ -345,7 +409,9 @@ def get_last_round_data( if self.chain.rounds_storage_contract is None: raise GenLayerError("rounds_storage_contract not configured for this chain") contract = self.w3.eth.contract( - address=self.w3.to_checksum_address(self.chain.rounds_storage_contract["address"]), + address=self.w3.to_checksum_address( + self.chain.rounds_storage_contract["address"] + ), abi=self.chain.rounds_storage_contract["abi"], ) tx_bytes = _to_bytes32(self, transaction_id) @@ -355,50 +421,165 @@ def get_last_round_data( def can_appeal( self: GenLayerClient, transaction_id: HexStr, + expected_decision_id: Optional[int] = None, ) -> bool: - """Checks if a transaction can be appealed.""" + """Checks whether the exact active decision can be appealed on a network. + + When no decision id is supplied, the latest active decision is read first. + The guarded on-chain call returns ``False`` if that decision changes before + it is evaluated. Current Studio does not expose this decision-bound read. + """ if self.chain.appeals_contract is None: raise GenLayerError("appeals_contract not configured for this chain") - contract = self.w3.eth.contract( - address=self.w3.to_checksum_address(self.chain.appeals_contract["address"]), - abi=self.chain.appeals_contract["abi"], - ) + if expected_decision_id is None: + expected_decision_id = _get_active_decision_id(self, transaction_id) + if expected_decision_id is None: + return False + contract = _appeals_contract(self) tx_bytes = _to_bytes32(self, transaction_id) - return contract.functions.canAppeal(tx_bytes).call() + return contract.functions.canAppeal(tx_bytes, expected_decision_id).call() + + +def get_appeal_quote( + self: GenLayerClient, + transaction_id: HexStr, +) -> Dict[str, int]: + """Returns the exact latest-decision appeal charge and race guard. + + ``total`` is the value to submit: the appeal bond plus induced-work + funding. Pass ``decision_id`` back to the decision-guarded appeal methods. + Current Studio exposes no authoritative decision-bound appeal quote. + """ + if _is_studio_chain(self): + raise GenLayerError(STUDIO_APPEAL_QUOTE_UNSUPPORTED) + contract = _consensus_data_contract(self) + decision_id, bond, funding, appeal_deadline = ( + contract.functions.estimateLatestAppealCharge( + _to_bytes32(self, transaction_id) + ).call() + ) + return { + "decision_id": int(decision_id), + "bond": int(bond), + "funding": int(funding), + "total": int(bond) + int(funding), + "appeal_deadline": int(appeal_deadline), + } + + +def get_appeal_charge( + self: GenLayerClient, + transaction_id: HexStr, +) -> int: + """Returns the full payment required to appeal the latest decision.""" + return get_appeal_quote(self, transaction_id)["total"] def get_min_appeal_bond( self: GenLayerClient, transaction_id: HexStr, ) -> int: - """Calculates the minimum bond required to appeal a transaction.""" - if self.chain.fee_manager_contract is None or self.chain.rounds_storage_contract is None: - raise GenLayerError("fee_manager_contract/rounds_storage_contract not configured for this chain") + """Deprecated alias for :func:`get_appeal_charge`. + + Despite its historical name, this returns bond plus induced-work funding. + """ + return get_appeal_charge(self, transaction_id) - round_number = get_round_number(self, transaction_id) - tx = self.get_transaction(transaction_id) - tx_status = int(tx["status"]) - fee_contract = self.w3.eth.contract( - address=self.w3.to_checksum_address(self.chain.fee_manager_contract["address"]), - abi=self.chain.fee_manager_contract["abi"], +def _consensus_data_contract(self: GenLayerClient): + if self.chain.consensus_data_contract is None: + raise GenLayerError("consensus_data_contract not configured for this chain") + return self.w3.eth.contract( + address=self.w3.to_checksum_address( + self.chain.consensus_data_contract["address"] + ), + abi=self.chain.consensus_data_contract["abi"], + ) + + +def _appeals_contract(self: GenLayerClient): + if self.chain.appeals_contract is None: + raise GenLayerError("appeals_contract not configured for this chain") + return self.w3.eth.contract( + address=self.w3.to_checksum_address(self.chain.appeals_contract["address"]), + abi=self.chain.appeals_contract["abi"], ) - tx_bytes = _to_bytes32(self, transaction_id) - return fee_contract.functions.calculateMinAppealBond(tx_bytes, round_number, tx_status).call() -def _resolve_appeal_value( +def _get_active_decision_id( self: GenLayerClient, transaction_id: HexStr, +) -> Optional[int]: + lifecycle = ( + _consensus_data_contract(self) + .functions.getTransactionLifecycle(_to_bytes32(self, transaction_id), 0) + .call() + ) + latest_decision = lifecycle[2] + decision_active = lifecycle[3] + return int(latest_decision[1]) if decision_active else None + + +def _resolve_appeal_parameters( + self: GenLayerClient, + transaction_id: HexStr, + expected_decision_id: Optional[int], value: Optional[int], -) -> int: - if value is not None: - return value - if self.chain.fee_manager_contract is None or self.chain.rounds_storage_contract is None: +) -> tuple[int, int]: + if expected_decision_id is not None and value is not None: + return expected_decision_id, value + + try: + quote = get_appeal_quote(self, transaction_id) + except Exception as exc: + raise GenLayerError( + "Cannot quote an active appeal decision. The transaction may not be " + "appealable yet; refresh its lifecycle and retry." + ) from exc + + if ( + expected_decision_id is not None + and expected_decision_id != quote["decision_id"] + ): raise GenLayerError( - "Cannot auto-resolve appeal bond: fee_manager_contract/rounds_storage_contract not configured for this chain." + f"Appeal decision {expected_decision_id} is stale; the latest active " + f"decision is {quote['decision_id']}. Refresh and retry." ) - return get_min_appeal_bond(self, transaction_id) + + return ( + quote["decision_id"] if expected_decision_id is None else expected_decision_id, + quote["total"] if value is None else value, + ) + + +STUDIO_APPEAL_QUOTE_UNSUPPORTED = ( + "Decision-bound appeal quotes are not available on current Studio." +) +STUDIO_APPEAL_VALUE_UNRESOLVABLE = ( + "Cannot auto-resolve the appeal payment on current Studio; pass value explicitly." +) +STUDIO_DECISION_GUARD_UNSUPPORTED = "expected_decision_id is not supported by current Studio's decision-free appeal methods." + + +def _is_studio_chain(self: GenLayerClient) -> bool: + """Reports whether the client targets the studio-embedded consensus. + + localnet and studionet share chain id 61999, the same check + ``transactions.actions.get_transaction`` uses to take its studio path. + """ + return self.chain.id == localnet.id + + +def _resolve_studio_appeal_value( + value: Optional[int], + expected_decision_id: Optional[int], +) -> int: + """Require the inputs that current Studio can faithfully honor.""" + if expected_decision_id is not None: + raise GenLayerError(STUDIO_DECISION_GUARD_UNSUPPORTED) + if value is None: + raise GenLayerError(STUDIO_APPEAL_VALUE_UNRESOLVABLE) + return value def _to_bytes32(self: GenLayerClient, hex_str: HexStr) -> bytes: @@ -477,17 +658,17 @@ def _json_safe_rpc_value(value): if isinstance(value, tuple): return [_json_safe_rpc_value(item) for item in value] if isinstance(value, dict): - return { - key: _json_safe_rpc_value(item) - for key, item in value.items() - } + return {key: _json_safe_rpc_value(item) for key, item in value.items()} return value def _encode_submit_appeal_data( self: GenLayerClient, transaction_id: HexStr, + expected_decision_id: Optional[int] = None, + studio_appeal_shape: bool = False, ): + """Encode the chain's native submitAppeal entrypoint.""" consensus_main_contract = self.w3.eth.contract( abi=self.chain.consensus_main_contract["abi"] ) @@ -496,16 +677,23 @@ def _encode_submit_appeal_data( transaction_id = transaction_id[2:] if len(transaction_id) > 64: raise ValueError("transaction_id too long for bytes32") - params = abi_encode( - contract_fn.argument_types, - [self.w3.to_bytes(hexstr=transaction_id)], - ) + arguments = [self.w3.to_bytes(hexstr=transaction_id)] + if not studio_appeal_shape: + if expected_decision_id is None: + raise ValueError("submitAppeal requires expected_decision_id") + arguments.append(expected_decision_id) + params = abi_encode(contract_fn.argument_types, arguments) function_selector = eth_utils.keccak(text=contract_fn.signature)[:4].hex() encoded_data = "0x" + function_selector + params.hex() return encoded_data FEE_MANAGEMENT_ARGUMENT_TYPES = ("bytes32", FEES_DISTRIBUTION_ABI_TYPE) +TOP_UP_AND_SUBMIT_APPEAL_ARGUMENT_TYPES = ( + "bytes32", + "uint256", + FEES_DISTRIBUTION_ABI_TYPE, +) def _encode_fee_management_data( @@ -513,20 +701,28 @@ def _encode_fee_management_data( function_name: str, transaction_id: HexStr, distribution: FeesDistributionInput, + expected_decision_id: Optional[int] = None, + studio_appeal_shape: bool = False, ): + """Encode the chain's native fee-management entrypoint.""" if function_name not in ("topUpFees", "topUpAndSubmitAppeal"): raise ValueError(f"Unsupported fee management function: {function_name}") tx_bytes = _to_bytes32(self, transaction_id) fees_distribution = create_fees_distribution(distribution) - params = abi_encode( - FEE_MANAGEMENT_ARGUMENT_TYPES, - [ - tx_bytes, - fees_distribution_to_abi_tuple(fees_distribution), - ], - ) - signature = f"{function_name}(bytes32,{FEES_DISTRIBUTION_ABI_TYPE})" + fees_tuple = fees_distribution_to_abi_tuple(fees_distribution) + if function_name == "topUpAndSubmitAppeal" and not studio_appeal_shape: + if expected_decision_id is None: + raise ValueError("topUpAndSubmitAppeal requires expected_decision_id") + argument_types = TOP_UP_AND_SUBMIT_APPEAL_ARGUMENT_TYPES + arguments = [tx_bytes, expected_decision_id, fees_tuple] + signature = f"{function_name}(bytes32,uint256,{FEES_DISTRIBUTION_ABI_TYPE})" + else: + argument_types = FEE_MANAGEMENT_ARGUMENT_TYPES + arguments = [tx_bytes, fees_tuple] + signature = f"{function_name}(bytes32,{FEES_DISTRIBUTION_ABI_TYPE})" + + params = abi_encode(argument_types, arguments) function_selector = eth_utils.keccak(text=signature)[:4].hex() return "0x" + function_selector + params.hex() @@ -614,9 +810,13 @@ def _get_default_valid_until() -> int: def get_current_fee_policy(self: GenLayerClient) -> FeePolicyQuote: - if self.chain.fee_manager_contract and self.chain.fee_manager_contract.get("address"): + if self.chain.fee_manager_contract and self.chain.fee_manager_contract.get( + "address" + ): fee_manager_contract = self.w3.eth.contract( - address=self.w3.to_checksum_address(self.chain.fee_manager_contract["address"]), + address=self.w3.to_checksum_address( + self.chain.fee_manager_contract["address"] + ), abi=FEE_MANAGER_CALCULATE_ROUND_FEES_ABI, ) gen_per_time_unit = fee_manager_contract.functions.GENPerTimeUnit().call() @@ -672,7 +872,11 @@ def estimate_fees_distribution( options: Optional[FeeEstimateOptions] = None, ) -> FeesDistribution: policy = get_current_fee_policy(self) - return build_estimated_fees_distribution(options, policy) + return build_estimated_fees_distribution( + options, + policy, + self.chain.default_consensus_max_rotations, + ) def estimate_transaction_fees( @@ -688,11 +892,19 @@ def _estimate_transaction_fees_with_policy( options: Optional[FeeEstimateOptions], policy: FeePolicyQuote, ) -> TransactionFeeEstimate: - distribution = build_estimated_fees_distribution(options, policy) + distribution = build_estimated_fees_distribution( + options, + policy, + self.chain.default_consensus_max_rotations, + ) - if self.chain.fee_manager_contract and self.chain.fee_manager_contract.get("address"): + if self.chain.fee_manager_contract and self.chain.fee_manager_contract.get( + "address" + ): fee_manager_contract = self.w3.eth.contract( - address=self.w3.to_checksum_address(self.chain.fee_manager_contract["address"]), + address=self.w3.to_checksum_address( + self.chain.fee_manager_contract["address"] + ), abi=FEE_MANAGER_CALCULATE_ROUND_FEES_ABI, ) round_fees = fee_manager_contract.functions.calculateRoundFees( @@ -825,14 +1037,17 @@ def _resolve_transaction_fees( num_of_initial_validators: int, ) -> NormalizedTransactionFees: transaction_fees = normalize_transaction_fees(fees) - if ( - transaction_fees["fee_value"] is not None - or not requires_fee_deposit_calculation(transaction_fees["distribution"]) + if transaction_fees[ + "fee_value" + ] is not None or not requires_fee_deposit_calculation( + transaction_fees["distribution"] ): transaction_fees["fee_value"] = transaction_fees["fee_value"] or 0 return transaction_fees - if not self.chain.fee_manager_contract or not self.chain.fee_manager_contract.get("address"): + if not self.chain.fee_manager_contract or not self.chain.fee_manager_contract.get( + "address" + ): try: policy = get_current_fee_policy(self) except GenLayerError as exc: @@ -880,7 +1095,9 @@ def _encode_add_transaction_data( abi=self.chain.consensus_main_contract["abi"] ) contract_fn = consensus_main_contract.get_function_by_name("addTransaction") - abi_version = _get_add_transaction_abi_version(self.chain.consensus_main_contract["abi"]) + abi_version = _get_add_transaction_abi_version( + self.chain.consensus_main_contract["abi"] + ) transaction_fees = transaction_fees or normalize_transaction_fees() use_fee_aware_transaction = ( transaction_fees["requires_fee_aware_transaction"] or abi_version == "fees" @@ -1029,7 +1246,9 @@ def _send_consensus_call( method="eth_sendRawTransaction", params=[serialized_transaction] )["result"] except Exception as exc: - raise GenLayerError(f"{operation_name} failed: {_format_rpc_error(exc)}") from exc + raise GenLayerError( + f"{operation_name} failed: {_format_rpc_error(exc)}" + ) from exc if self.chain.id == localnet.id: return tx_hash @@ -1055,7 +1274,7 @@ def _send_transaction( if self.chain.consensus_main_contract is None: raise GenLayerError( - f"Consensus main contract address not found in chain config for \"{self.chain.name}\".", + f'Consensus main contract address not found in chain config for "{self.chain.name}".', ) try: diff --git a/genlayer_py/staking/__init__.py b/genlayer_py/staking/__init__.py index d449eb4..c6de75f 100644 --- a/genlayer_py/staking/__init__.py +++ b/genlayer_py/staking/__init__.py @@ -5,6 +5,7 @@ validator_claim, validator_prime, set_operator, + get_validator_join_context, get_operator_transfer_context, initiate_operator_transfer, complete_operator_transfer, @@ -17,6 +18,8 @@ epoch, active_validators, active_validators_count, + joined_validators, + joined_validators_count, is_validator, get_validator_info, get_stake_info, @@ -24,6 +27,16 @@ validator_min_stake, delegator_min_stake, ) +from genlayer_py.staking.operator_registration import ( + OperatorPublicKey, + OperatorRegistrationContext, + OperatorRegistrationProof, + create_operator_registration, + operator_address_from_public_key, + operator_possession_message, + operator_public_key_from_private_key, + verify_operator_registration, +) __all__ = [ "validator_join", @@ -32,6 +45,7 @@ "validator_claim", "validator_prime", "set_operator", + "get_validator_join_context", "get_operator_transfer_context", "initiate_operator_transfer", "complete_operator_transfer", @@ -44,10 +58,20 @@ "epoch", "active_validators", "active_validators_count", + "joined_validators", + "joined_validators_count", "is_validator", "get_validator_info", "get_stake_info", "banned_validators", "validator_min_stake", "delegator_min_stake", + "OperatorPublicKey", + "OperatorRegistrationContext", + "OperatorRegistrationProof", + "create_operator_registration", + "operator_address_from_public_key", + "operator_possession_message", + "operator_public_key_from_private_key", + "verify_operator_registration", ] diff --git a/genlayer_py/staking/abi/staking_abi.json b/genlayer_py/staking/abi/staking_abi.json index fba7fd3..51dbdc5 100644 --- a/genlayer_py/staking/abi/staking_abi.json +++ b/genlayer_py/staking/abi/staking_abi.json @@ -1,4033 +1,6668 @@ [ - { - "inputs": [], - "name": "BurnTransferFailed", - "type": "error" - }, - { - "inputs": [], - "name": "DeepthoughtCallFailed", - "type": "error" - }, - { - "inputs": [], - "name": "DelegatorBelowMinimumStake", - "type": "error" - }, - { - "inputs": [], - "name": "DelegatorExitExceedsShares", - "type": "error" - }, - { - "inputs": [], - "name": "DelegatorExitWouldBeBelowMinimum", - "type": "error" - }, - { - "inputs": [], - "name": "DelegatorMayNotExitWithZeroShares", - "type": "error" - }, - { - "inputs": [], - "name": "DelegatorMayNotJoinTwoValidatorsSimultaneously", - "type": "error" - }, - { - "inputs": [], - "name": "DelegatorMayNotJoinWithZeroValue", - "type": "error" - }, - { - "inputs": [], - "name": "DelegatorMustExitAllWhenBelowMinimum", - "type": "error" - }, - { - "inputs": [], - "name": "EpochAdvanceNotReady", - "type": "error" - }, - { - "inputs": [], - "name": "EpochAlreadyFinalized", - "type": "error" - }, - { - "inputs": [], - "name": "EpochNotFinalized", - "type": "error" - }, - { - "inputs": [], - "name": "EpochNotFinished", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "validator", - "type": "address" - } - ], - "name": "FailedTransfer", - "type": "error" - }, - { - "inputs": [], - "name": "InflationAlreadyInitialized", - "type": "error" - }, - { - "inputs": [], - "name": "InflationAlreadyReceived", - "type": "error" - }, - { - "inputs": [], - "name": "InflationInvalidAmount", - "type": "error" - }, - { - "inputs": [], - "name": "InflationRequestFailed", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientInflationFunds", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidAtEpoch", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInflationThresholds", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidOperatorAddress", - "type": "error" - }, - { - "inputs": [], - "name": "MaxNumberOfValidatorsReached", - "type": "error" - }, - { - "inputs": [], - "name": "MaxValidatorsCannotBeZero", - "type": "error" - }, - { - "inputs": [], - "name": "NFTMinterCallFailed", - "type": "error" - }, - { - "inputs": [], - "name": "NFTMinterNotConfigured", - "type": "error" - }, - { - "inputs": [], - "name": "NoBurning", - "type": "error" - }, - { - "inputs": [], - "name": "NumberOfValidatorsExceedsAvailable", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyGEN", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyIdleness", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyIdlenessOrTribunal", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyTransactions", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyTransactionsOrTribunal", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyTribunal", - "type": "error" - }, - { - "inputs": [], - "name": "OperatorAlreadyAssigned", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - } - ], - "name": "PendingTribunals", - "type": "error" - }, - { - "inputs": [], - "name": "PreviousEpochNotFinalizable", - "type": "error" - }, - { - "inputs": [], - "name": "ReductionFactorCannotBeZero", - "type": "error" - }, - { - "inputs": [], - "name": "ValidatorAlreadyInTree", - "type": "error" - }, - { - "inputs": [], - "name": "ValidatorAlreadyJoined", - "type": "error" - }, - { - "inputs": [], - "name": "ValidatorBelowMinimumStake", - "type": "error" - }, - { - "inputs": [], - "name": "ValidatorExitExceedsShares", - "type": "error" - }, - { - "inputs": [], - "name": "ValidatorMayNotBeDelegator", - "type": "error" - }, - { - "inputs": [], - "name": "ValidatorMayNotDepositZeroValue", - "type": "error" - }, - { - "inputs": [], - "name": "ValidatorMayNotJoinWithZeroValue", - "type": "error" - }, - { - "inputs": [], - "name": "ValidatorMustNotBeDelegator", - "type": "error" - }, - { - "inputs": [], - "name": "ValidatorNotActive", - "type": "error" - }, - { - "inputs": [], - "name": "ValidatorNotInTree", - "type": "error" - }, - { - "inputs": [], - "name": "ValidatorNotJoined", - "type": "error" - }, - { - "inputs": [], - "name": "ValidatorWithdrawalExceedsStake", - "type": "error" - }, - { - "inputs": [], - "name": "ValidatorsConsumed", - "type": "error" - }, - { - "inputs": [], - "name": "ValidatorsUnavailable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [], - "name": "AllValidatorBansRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "BurnFailed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "BurnToL1", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "delegator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DelegatorClaim", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "delegator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DelegatorExit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "delegator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DelegatorJoin", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - } - ], - "name": "EpochAdvance", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - } - ], - "name": "EpochFinalize", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - } - ], - "name": "EpochHasPendingTribunals", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "EpochZeroEnded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "FeesReceived", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "InflationInitiated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - } - ], - "name": "InflationReceived", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "targetEpoch", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "l2GasPrice", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "l2GasLimit", - "type": "uint256" - } - ], - "name": "InflationRequestedFromL2", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "inflationRequestThreshold", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "inflationTargetAhead", - "type": "uint256" - } - ], - "name": "InflationThresholdsSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "l2GasPrice", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "l2GasLimit", - "type": "uint256" - } - ], - "name": "L1InflationGasParamsSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "startIndex", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "processedCount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nextIndex", - "type": "uint256" - } - ], - "name": "QuarantinesCleanedUp", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "deepthought", - "type": "address" - } - ], - "name": "SetDeepthought", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "delegatorMinStake", - "type": "uint256" - } - ], - "name": "SetDelegatorMinimumStake", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "epochExtraMinDuration", - "type": "uint256" - } - ], - "name": "SetEpochExtraMinDuration", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "epochMinDuration", - "type": "uint256" - } - ], - "name": "SetEpochMinDuration", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "epochMinDurationThreshold", - "type": "uint256" - } - ], - "name": "SetEpochMinDurationThreshold", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "epochZeroMinDuration", - "type": "uint256" - } - ], - "name": "SetEpochZeroMinDuration", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "gen", - "type": "address" - } - ], - "name": "SetGen", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "maxValidators", - "type": "uint256" - } - ], - "name": "SetMaxValidators", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "reductionFactor", - "type": "uint256" - } - ], - "name": "SetReductionFactor", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "stakingInvariant", - "type": "address" - } - ], - "name": "SetStakingInvariant", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "transactionFeesManager", - "type": "address" - } - ], - "name": "SetTransactionFeesManager", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "delegatorUnbondingPeriod", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "validatorUnbondingPeriod", - "type": "uint256" - } - ], - "name": "SetUnbondingPeriods", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "validatorMinStake", - "type": "uint256" - } - ], - "name": "SetValidatorMinimumStake", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "alpha", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "beta", - "type": "uint256" - } - ], - "name": "SetValidatorWeightParams", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "validator", - "type": "address" - } - ], - "name": "ValidatorBanRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "validator", - "type": "address" - } - ], - "name": "ValidatorBannedDeterministic", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "bannedAt", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "bannedUntil", - "type": "uint256" - } - ], - "name": "ValidatorBannedIdleness", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "ValidatorClaim", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "ValidatorDeposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "ValidatorExit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - } - ], - "name": "ValidatorIsAlreadyInTree", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - } - ], - "name": "ValidatorIsNotActive", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - } - ], - "name": "ValidatorIsNotInTree", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "ValidatorJoin", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "validatorRewards", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "delegatorRewards", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeRewards", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feePenalties", - "type": "uint256" - } - ], - "name": "ValidatorPrime", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "validator", - "type": "address" - } - ], - "name": "ValidatorQuarantineRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "validator", - "type": "address" - } - ], - "name": "ValidatorQuarantineRepealed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "quarantinedAt", - "type": "uint256" - } - ], - "name": "ValidatorQuarantined", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "validatorSlashing", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "delegatorSlashing", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - } - ], - "name": "ValidatorSlash", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "name": "ValidatorsRegistered", - "type": "event" - }, - { - "inputs": [], - "name": "BASE_TOKEN", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_DELEGATOR_MIN_STAKE", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_VALIDATOR_MIN_STAKE", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DELEGATOR_UNBONDING_PERIOD", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INFLATION_BASE", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INFLATION_DEEPTHOUGHT_BPS", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INFLATION_DEVELOPER_BPS", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INFLATION_FINAL", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INFLATION_INITIAL", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INFLATION_MID", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INFLATION_STAKER_BPS", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INFLATION_STEEPNESS", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INFLATION_VALIDATOR_BPS", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "QUARANTINE_MANAGER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "VALIDATOR_UNBONDING_PERIOD", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "activeValidators", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "activeValidatorsCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "activeWeights", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "addressManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "validatorAddresses", - "type": "address[]" - } - ], - "name": "adminRegisterValidators", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "burning", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "canAdvance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "deepthought", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_inflation", - "type": "uint256" - } - ], - "name": "deepthoughtInflation", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_delegator", - "type": "address" - }, - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "delegatorClaim", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_delegator", - "type": "address" - }, - { - "internalType": "address", - "name": "_validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_index", - "type": "uint256" - } - ], - "name": "delegatorDeposit", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "quantity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "commit", - "type": "uint256" - } - ], - "internalType": "struct IGenLayerStaking.Claim", - "name": "claim_", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "input", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "output", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "linkToNextCommit", - "type": "uint256" - } - ], - "internalType": "struct IGenLayerStaking.Commit", - "name": "commit_", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_delegator", - "type": "address" - }, - { - "internalType": "address", - "name": "_validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_epoch", - "type": "uint256" - } - ], - "name": "delegatorDepositByEpoch", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "input", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "output", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "linkToNextCommit", - "type": "uint256" - } - ], - "internalType": "struct IGenLayerStaking.Commit", - "name": "commit_", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_delegator", - "type": "address" - }, - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "delegatorDepositLen", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "delegatorExit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "delegatorJoin", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "delegatorMinStake", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_delegator", - "type": "address" - }, - { - "internalType": "address", - "name": "_validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_index", - "type": "uint256" - } - ], - "name": "delegatorWithdrawal", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "quantity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "commit", - "type": "uint256" - } - ], - "internalType": "struct IGenLayerStaking.Claim", - "name": "claim_", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "input", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "output", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "linkToNextCommit", - "type": "uint256" - } - ], - "internalType": "struct IGenLayerStaking.Commit", - "name": "commit_", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_delegator", - "type": "address" - }, - { - "internalType": "address", - "name": "_validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_epoch", - "type": "uint256" - } - ], - "name": "delegatorWithdrawalByEpoch", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "input", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "output", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "linkToNextCommit", - "type": "uint256" - } - ], - "internalType": "struct IGenLayerStaking.Commit", - "name": "commit_", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_delegator", - "type": "address" - }, - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "delegatorWithdrawalLen", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_inflation", - "type": "uint256" - } - ], - "name": "developerInflation", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "epoch", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "epochAdvance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "epochEven", - "outputs": [ - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inflation", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "weight", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "weightDeposit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "weightWithdrawal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vcount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "stakeDeposit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "stakeWithdrawal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "slashed", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "epochExtraMinDuration", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "epochFinalize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "epochFinalizeImmediate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_epoch", - "type": "uint256" - } - ], - "name": "epochInflation", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "epochMinDuration", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "epochMinDurationThreshold", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "epochOdd", - "outputs": [ - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inflation", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "weight", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "weightDeposit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "weightWithdrawal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vcount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "stakeDeposit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "stakeWithdrawal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "slashed", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "epochZeroMinDuration", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "finalizationPhaseAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "finalized", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_randomSeed", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_txCreatedTimestamp", - "type": "uint256" - } - ], - "name": "getActivatorForSeed", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_startIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_size", - "type": "uint256" - } - ], - "name": "getAllBannedValidators", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "untilEpochBanned", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "permanentlyBanned", - "type": "bool" - } - ], - "internalType": "struct IGenLayerStaking.BannedValidators[]", - "name": "validatorList", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_epoch", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_startIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_size", - "type": "uint256" - } - ], - "name": "getAllBannedValidatorsForEpoch", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "untilEpochBanned", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "permanentlyBanned", - "type": "bool" - } - ], - "internalType": "struct IGenLayerStaking.BannedValidators[]", - "name": "validatorList", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_startIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_size", - "type": "uint256" - } - ], - "name": "getAllQuarantinedValidators", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "untilEpochBanned", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "permanentlyBanned", - "type": "bool" - } - ], - "internalType": "struct IGenLayerStaking.BannedValidators[]", - "name": "validatorList", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_epoch", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_startIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_size", - "type": "uint256" - } - ], - "name": "getAllQuarantinedValidatorsForEpoch", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "untilEpochBanned", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "permanentlyBanned", - "type": "bool" - } - ], - "internalType": "struct IGenLayerStaking.BannedValidators[]", - "name": "validatorList", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_delegator", - "type": "address" - }, - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "getPendingDelegatorDeposits", - "outputs": [ - { - "internalType": "uint256", - "name": "total", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_delegator", - "type": "address" - }, - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "getPendingDelegatorWithdrawals", - "outputs": [ - { - "internalType": "uint256", - "name": "total", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "getPendingValidatorDeposits", - "outputs": [ - { - "internalType": "uint256", - "name": "total", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "getPendingValidatorWithdrawals", - "outputs": [ - { - "internalType": "uint256", - "name": "total", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "getValidatorDelegators", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_startIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_pageSize", - "type": "uint256" - } - ], - "name": "getValidatorDelegatorsInfo", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "delegator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "currentStake", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentShares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pendingDeposits", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pendingWithdrawals", - "type": "uint256" - } - ], - "internalType": "struct IGenLayerStaking.DelegatorInfo[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_startIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_pageSize", - "type": "uint256" - } - ], - "name": "getValidatorDelegatorsPaginated", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getValidatorQuarantineList", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_startIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_pageSize", - "type": "uint256" - } - ], - "name": "getValidatorsJoined", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_at", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_until", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "idlenessBan", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_validators", - "type": "address[]" - }, - { - "internalType": "uint256", - "name": "_quarantinedAt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_quarantinedUntil", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "idlenessBanBatch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "idlenessPhaseAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inflationEpoch", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_inflationOnset", - "type": "uint256" - } - ], - "name": "inflationInit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_epoch", - "type": "uint256" - } - ], - "name": "inflationReceive", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "inflationRequestThreshold", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inflationSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inflationTargetAhead", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - }, - { - "internalType": "address", - "name": "_delegator", - "type": "address" - } - ], - "name": "isDelegatorOfValidator", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "isValidator", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "isValidatorBanned", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "l2GasLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "l2GasPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxValidators", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "operatorsToValidators", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "reductionFactor", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "removeAllValidatorBans", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "removeValidatorBan", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "revealingPhaseAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address payable", - "name": "_deepthought", - "type": "address" - } - ], - "name": "setDeepthought", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_delegatorMinStake", - "type": "uint256" - } - ], - "name": "setDelegatorMinimumStake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_epochExtraMinDuration", - "type": "uint256" - } - ], - "name": "setEpochExtraMinDuration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_epochMinDuration", - "type": "uint256" - } - ], - "name": "setEpochMinDuration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_epochMinDurationThreshold", - "type": "uint256" - } - ], - "name": "setEpochMinDurationThreshold", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_epochZeroMinDuration", - "type": "uint256" - } - ], - "name": "setEpochZeroMinDuration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_finalizationPhase", - "type": "address" - } - ], - "name": "setFinalizationPhase", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_gen", - "type": "address" - } - ], - "name": "setGen", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_idlenessPhase", - "type": "address" - } - ], - "name": "setIdlenessPhase", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_inflationRequestThreshold", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_inflationTargetAhead", - "type": "uint256" - } - ], - "name": "setInflationThresholds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_l2GasPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_l2GasLimit", - "type": "uint256" - } - ], - "name": "setL1InflationGasParams", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_maxValidators", - "type": "uint256" - } - ], - "name": "setMaxValidators", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_reductionFactor", - "type": "uint256" - } - ], - "name": "setReductionFactor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_revealingPhase", - "type": "address" - } - ], - "name": "setRevealingPhase", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_stakingInvariant", - "type": "address" - } - ], - "name": "setStakingInvariant", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_transactionFeesManager", - "type": "address" - } - ], - "name": "setTransactionFeesManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_delegatorUnbondingPeriod", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_validatorUnbondingPeriod", - "type": "uint256" - } - ], - "name": "setUnbondingPeriods", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_validatorMinStake", - "type": "uint256" - } - ], - "name": "setValidatorMinimumStake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_alpha", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_beta", - "type": "uint256" - } - ], - "name": "setValidatorWeightParams", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_delegator", - "type": "address" - }, - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "sharesOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_delegator", - "type": "address" - }, - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "stakeOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stakingInvariant", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "transactionFeesManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "validatorBanDeterministic", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "validatorBanned", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "untilEpochBanned", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "permanentlyBanned", - "type": "bool" - } - ], - "internalType": "struct IGenLayerStaking.BannedValidators", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "validatorClaim", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "validatorDelegatorCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_index", - "type": "uint256" - } - ], - "name": "validatorDeposit", - "outputs": [ - { - "internalType": "uint256", - "name": "epoch_", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "input", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "output", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "linkToNextCommit", - "type": "uint256" - } - ], - "internalType": "struct IGenLayerStaking.Commit", - "name": "commit_", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "validatorDeposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_epoch", - "type": "uint256" - } - ], - "name": "validatorDepositByEpoch", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "input", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "output", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "linkToNextCommit", - "type": "uint256" - } - ], - "internalType": "struct IGenLayerStaking.Commit", - "name": "commit_", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "validatorDepositLen", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "validatorExit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_operator", - "type": "address" - } - ], - "name": "validatorJoin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "validatorJoin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "validatorMinStake", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "validatorPrime", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_at", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "validatorQuarantine", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "validatorQuarantineCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "validatorQuarantineRepeal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_seed", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_slot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_epoch", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_txCreatedTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_number", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_weighted", - "type": "bool" - }, - { - "internalType": "address[]", - "name": "_consumed", - "type": "address[]" - } - ], - "name": "validatorSelection", - "outputs": [ - { - "internalType": "uint256", - "name": "leader_", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "validators_", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "penalized_", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_seed", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_slot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_txCreatedTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_number", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "_weighted", - "type": "bool" - }, - { - "internalType": "address[]", - "name": "_consumed", - "type": "address[]" - } - ], - "name": "validatorSelection", - "outputs": [ - { - "internalType": "uint256", - "name": "leader_", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "validators_", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "penalized_", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "validatorView", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "left", - "type": "address" - }, - { - "internalType": "address", - "name": "right", - "type": "address" - }, - { - "internalType": "address", - "name": "parent", - "type": "address" - }, - { - "internalType": "uint256", - "name": "eBanned", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ePrimed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vStake", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vShares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "dStake", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "dShares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vDeposit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vWithdrawal", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "live", - "type": "bool" - } - ], - "internalType": "struct IGenLayerStaking.ValidatorView", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "validatorViewPrePrimed", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "left", - "type": "address" - }, - { - "internalType": "address", - "name": "right", - "type": "address" - }, - { - "internalType": "address", - "name": "parent", - "type": "address" - }, - { - "internalType": "uint256", - "name": "eBanned", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ePrimed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vStake", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vShares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "dStake", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "dShares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vDeposit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vWithdrawal", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "live", - "type": "bool" - } - ], - "internalType": "struct IGenLayerStaking.ValidatorView", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "validatorViewPrimed", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "left", - "type": "address" - }, - { - "internalType": "address", - "name": "right", - "type": "address" - }, - { - "internalType": "address", - "name": "parent", - "type": "address" - }, - { - "internalType": "uint256", - "name": "eBanned", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ePrimed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vStake", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vShares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "dStake", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "dShares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vDeposit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vWithdrawal", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "live", - "type": "bool" - } - ], - "internalType": "struct IGenLayerStaking.ValidatorView", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_index", - "type": "uint256" - } - ], - "name": "validatorWithdrawal", - "outputs": [ - { - "internalType": "uint256", - "name": "epoch_", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "input", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "output", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "linkToNextCommit", - "type": "uint256" - } - ], - "internalType": "struct IGenLayerStaking.Commit", - "name": "commit_", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_epoch", - "type": "uint256" - } - ], - "name": "validatorWithdrawalByEpoch", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "input", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "output", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epoch", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "linkToNextCommit", - "type": "uint256" - } - ], - "internalType": "struct IGenLayerStaking.Commit", - "name": "commit_", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_validator", - "type": "address" - } - ], - "name": "validatorWithdrawalLen", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "validatorsCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "validatorsEven", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "validatorsJoined", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "validatorsJoinedCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "validatorsOdd", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "validatorsRoot", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "weightsEven", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "weightsOdd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } + { + "inputs": [], + "name": "ArrayLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "BurnTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "DeepthoughtCallFailed", + "type": "error" + }, + { + "inputs": [], + "name": "DelegatorBelowMinimumStake", + "type": "error" + }, + { + "inputs": [], + "name": "DelegatorExitExceedsShares", + "type": "error" + }, + { + "inputs": [], + "name": "DelegatorExitUnrepresentableShares", + "type": "error" + }, + { + "inputs": [], + "name": "DelegatorExitWouldBeBelowMinimum", + "type": "error" + }, + { + "inputs": [], + "name": "DelegatorMayNotExitWithZeroShares", + "type": "error" + }, + { + "inputs": [], + "name": "DelegatorMayNotJoinTwoValidatorsSimultaneously", + "type": "error" + }, + { + "inputs": [], + "name": "DelegatorMayNotJoinWithZeroValue", + "type": "error" + }, + { + "inputs": [], + "name": "DelegatorMustExitAllWhenBelowMinimum", + "type": "error" + }, + { + "inputs": [], + "name": "EpochAdvanceNotReady", + "type": "error" + }, + { + "inputs": [], + "name": "EpochAlreadyFinalized", + "type": "error" + }, + { + "inputs": [], + "name": "EpochDurationCannotBeZero", + "type": "error" + }, + { + "inputs": [], + "name": "EpochDurationOverflow", + "type": "error" + }, + { + "inputs": [], + "name": "EpochNotFinalized", + "type": "error" + }, + { + "inputs": [], + "name": "EpochNotFinished", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "validator", + "type": "address" + } + ], + "name": "FailedTransfer", + "type": "error" + }, + { + "inputs": [], + "name": "IncentivePercentageTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "InflationAlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "InflationAlreadyReceived", + "type": "error" + }, + { + "inputs": [], + "name": "InflationInvalidAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InflationRequestFailed", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientInflationFunds", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidAtEpoch", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInflationThresholds", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidOperatorAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidPageSize", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidPrimingSelfStakeBps", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidWeightParams", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "validator", + "type": "address" + } + ], + "name": "JudicialCapacityReservationActive", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "validator", + "type": "address" + } + ], + "name": "JudicialCapacityReservationMissing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "validator", + "type": "address" + } + ], + "name": "JudicialQuarantineCauseActive", + "type": "error" + }, + { + "inputs": [], + "name": "MaxNumberOfValidatorsReached", + "type": "error" + }, + { + "inputs": [], + "name": "MaxValidatorsCannotBeZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requested", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maximum", + "type": "uint256" + } + ], + "name": "MaxValidatorsExceedsSafeLimit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "attemptId", + "type": "uint64" + } + ], + "name": "MinimumStakeTransitionActive", + "type": "error" + }, + { + "inputs": [], + "name": "MinimumStakeTransitionConfigLocked", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint24", + "name": "expectedCursor", + "type": "uint24" + }, + { + "internalType": "uint24", + "name": "actualCursor", + "type": "uint24" + } + ], + "name": "MinimumStakeTransitionCursorMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "expectedAttemptId", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "actualAttemptId", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "expectedAttemptHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actualAttemptHash", + "type": "bytes32" + } + ], + "name": "MinimumStakeTransitionIdentityMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IGenLayerStaking.MinimumStakeTransitionStatus", + "name": "status", + "type": "uint8" + } + ], + "name": "MinimumStakeTransitionInvalidStatus", + "type": "error" + }, + { + "inputs": [], + "name": "MinimumStakeTransitionNotActive", + "type": "error" + }, + { + "inputs": [], + "name": "MirrorFieldOverflow", + "type": "error" + }, + { + "inputs": [], + "name": "NFTMinterCallFailed", + "type": "error" + }, + { + "inputs": [], + "name": "NFTMinterNotConfigured", + "type": "error" + }, + { + "inputs": [], + "name": "NoBurning", + "type": "error" + }, + { + "inputs": [], + "name": "NumberOfValidatorsExceedsAvailable", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyGEN", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyIdleness", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyIdlenessOrTribunal", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyStakingRouter", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyTransactions", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyTransactionsOrTribunal", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyTribunal", + "type": "error" + }, + { + "inputs": [], + "name": "OperatorAlreadyAssigned", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + } + ], + "name": "PendingTribunals", + "type": "error" + }, + { + "inputs": [], + "name": "PermanentQuarantineNeedsOwnerPardon", + "type": "error" + }, + { + "inputs": [], + "name": "PreviousEpochNotFinalizable", + "type": "error" + }, + { + "inputs": [], + "name": "ReductionFactorCannotBeZero", + "type": "error" + }, + { + "inputs": [], + "name": "RegistryFull", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + } + ], + "name": "SelectionAuthorityPinned", + "type": "error" + }, + { + "inputs": [], + "name": "UnauthorizedDelegatorClaim", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requested", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "cap", + "type": "uint256" + } + ], + "name": "UnbanCapExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "ValidatorAlreadyInTree", + "type": "error" + }, + { + "inputs": [], + "name": "ValidatorAlreadyJoined", + "type": "error" + }, + { + "inputs": [], + "name": "ValidatorBelowMinimumStake", + "type": "error" + }, + { + "inputs": [], + "name": "ValidatorDoesNotExist", + "type": "error" + }, + { + "inputs": [], + "name": "ValidatorExitExceedsShares", + "type": "error" + }, + { + "inputs": [], + "name": "ValidatorMayNotBeDelegator", + "type": "error" + }, + { + "inputs": [], + "name": "ValidatorMayNotDepositZeroValue", + "type": "error" + }, + { + "inputs": [], + "name": "ValidatorMayNotJoinWithZeroValue", + "type": "error" + }, + { + "inputs": [], + "name": "ValidatorMustNotBeDelegator", + "type": "error" + }, + { + "inputs": [], + "name": "ValidatorNotActive", + "type": "error" + }, + { + "inputs": [], + "name": "ValidatorNotInTree", + "type": "error" + }, + { + "inputs": [], + "name": "ValidatorNotJoined", + "type": "error" + }, + { + "inputs": [], + "name": "ValidatorWithdrawalExceedsStake", + "type": "error" + }, + { + "inputs": [], + "name": "ValidatorsConsumed", + "type": "error" + }, + { + "inputs": [], + "name": "ValidatorsUnavailable", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "recordX", + "type": "bool" + } + ], + "name": "AdminStakeCorrected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "AllValidatorBansRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGenLayerStaking.BurnSource", + "name": "source", + "type": "uint8" + } + ], + "name": "BurnAccrued", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "burnThreshold", + "type": "uint256" + } + ], + "name": "BurnThresholdSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BurnToL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "epochNumber", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "priorWeight", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epochWeight", + "type": "uint256" + } + ], + "name": "CorruptedEpochWeight", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DelegationToBelowMinimumValidator", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DelegatorClaim", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DelegatorExit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DelegatorJoin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + } + ], + "name": "EpochAdvance", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + } + ], + "name": "EpochFinalize", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "FeesReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "incentivePercentage", + "type": "uint256" + } + ], + "name": "IncentivePercentageSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "InflationInitiated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + } + ], + "name": "InflationReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "targetEpoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "l2GasPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "l2GasLimit", + "type": "uint256" + } + ], + "name": "InflationRequestedFromL2", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "inflationRequestThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "inflationTargetAhead", + "type": "uint256" + } + ], + "name": "InflationThresholdsSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "restored", + "type": "bool" + } + ], + "name": "JudicialCapacityReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + } + ], + "name": "JudicialCapacityReserved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "JudicialConvictionMaterialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + } + ], + "name": "JudicialConvictionQueued", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + } + ], + "name": "JudicialSuspensionSettled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "accusedAtEpoch", + "type": "uint256" + } + ], + "name": "JudiciallySuspended", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "l2GasPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "l2GasLimit", + "type": "uint256" + } + ], + "name": "L1InflationGasParamsSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "maxPerEpoch", + "type": "uint256" + } + ], + "name": "MaxUnbansPerEpochSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "startIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "processedCount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nextIndex", + "type": "uint256" + } + ], + "name": "QuarantinesCleanedUp", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "count", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "snapshotHash", + "type": "bytes32" + } + ], + "name": "SelectionPoolSnapshotSealed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "daoFeeBps", + "type": "uint256" + } + ], + "name": "SetDaoFeeBps", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "deepthought", + "type": "address" + } + ], + "name": "SetDeepthought", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "delegatorMinStake", + "type": "uint256" + } + ], + "name": "SetDelegatorMinimumStake", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epochExtraMinDuration", + "type": "uint256" + } + ], + "name": "SetEpochExtraMinDurationOverride", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "epochMinDuration", + "type": "uint256" + } + ], + "name": "SetEpochMinDuration", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "epochMinDurationThreshold", + "type": "uint256" + } + ], + "name": "SetEpochMinDurationThreshold", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "epochZeroMinDuration", + "type": "uint256" + } + ], + "name": "SetEpochZeroMinDuration", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "gen", + "type": "address" + } + ], + "name": "SetGen", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "maxValidators", + "type": "uint256" + } + ], + "name": "SetMaxValidators", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "bps", + "type": "uint256" + } + ], + "name": "SetPrimingSelfStakeBps", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "reductionFactor", + "type": "uint256" + } + ], + "name": "SetReductionFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "transactionFeesManager", + "type": "address" + } + ], + "name": "SetTransactionFeesManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "delegatorUnbondingPeriod", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "validatorUnbondingPeriod", + "type": "uint256" + } + ], + "name": "SetUnbondingPeriods", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "validatorMinStake", + "type": "uint256" + } + ], + "name": "SetValidatorMinimumStake", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "beta", + "type": "uint256" + } + ], + "name": "SetValidatorWeightParams", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "SharelessFeesBurned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "SharelessStakeZeroed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "removed", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "remaining", + "type": "uint256" + } + ], + "name": "TemporaryValidatorBansRemovalProgress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "validator", + "type": "address" + } + ], + "name": "ValidatorBanRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "bannedAt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "bannedUntil", + "type": "uint256" + } + ], + "name": "ValidatorBannedIdleness", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ValidatorClaim", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ValidatorDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ValidatorExit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ValidatorFeePenaltyBurned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ValidatorJoin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "attemptId", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "attemptHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMinimum", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposedMinimum", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint24", + "name": "worksetCount", + "type": "uint24" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "worksetHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "baseGeneration", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "candidateGeneration", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "targetEpoch", + "type": "uint256" + } + ], + "name": "ValidatorMinimumStakeTransitionBegun", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "attemptId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint24", + "name": "oldCursor", + "type": "uint24" + }, + { + "indexed": false, + "internalType": "uint24", + "name": "newCursor", + "type": "uint24" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "candidateWrites", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "revision", + "type": "uint64" + } + ], + "name": "ValidatorMinimumStakeTransitionProgressed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "attemptId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "enum IGenLayerStaking.MinimumStakeTransitionStatus", + "name": "status", + "type": "uint8" + } + ], + "name": "ValidatorMinimumStakeTransitionStatusUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "validatorRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "delegatorRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feePenalties", + "type": "uint256" + } + ], + "name": "ValidatorPrime", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "validator", + "type": "address" + } + ], + "name": "ValidatorQuarantineRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quarantinedAt", + "type": "uint256" + } + ], + "name": "ValidatorQuarantined", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ValidatorSelfStakeBonus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "validatorSlashing", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "delegatorSlashing", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + } + ], + "name": "ValidatorSlash", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "predicted", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "actual", + "type": "uint256" + } + ], + "name": "VcountShadowMismatch", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "epochNumber", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxWeight", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "weightWithdrawal", + "type": "uint256" + } + ], + "name": "WeightWithdrawalOverflow", + "type": "event" + }, + { + "inputs": [], + "name": "BASE_TOKEN", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_DELEGATOR_MIN_STAKE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_VALIDATOR_MIN_STAKE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DELEGATOR_UNBONDING_PERIOD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INFLATION_BASE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INFLATION_DEEPTHOUGHT_BPS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INFLATION_DEVELOPER_BPS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INFLATION_FINAL", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INFLATION_INITIAL", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INFLATION_MID", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INFLATION_STAKER_BPS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INFLATION_STEEPNESS", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INFLATION_VALIDATOR_BPS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "QUARANTINE_MANAGER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "VALIDATOR_UNBONDING_PERIOD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "enum IGenLayerStaking.BurnSource", + "name": "source", + "type": "uint8" + } + ], + "name": "accrueBurn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "addressManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_validatorMinStake", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "_expectedPublishedVersion", + "type": "uint64" + } + ], + "name": "beginValidatorMinimumStakeTransition", + "outputs": [ + { + "internalType": "uint64", + "name": "attemptId", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "attemptHash", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "burnThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "burnedDevInflationSurplus", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "burnedStrandedFees", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "burning", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "canAdvance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "canFinalize", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_attemptId", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_attemptHash", + "type": "bytes32" + } + ], + "name": "cancelValidatorMinimumStakeTransition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "clearEpochExtraMinDurationOverride", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "convictJudicially", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "daoFeeBps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "deepthought", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_inflation", + "type": "uint256" + } + ], + "name": "deepthoughtInflation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "delegatorClaim", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "delegatorDeposit", + "outputs": [ + { + "components": [ + { + "internalType": "uint120", + "name": "quantity", + "type": "uint120" + }, + { + "internalType": "uint120", + "name": "offset", + "type": "uint120" + }, + { + "internalType": "uint256", + "name": "commit", + "type": "uint256" + } + ], + "internalType": "struct IGenLayerStaking.Claim", + "name": "claim_", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "input", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "output", + "type": "uint256" + }, + { + "internalType": "uint120", + "name": "outstanding", + "type": "uint120" + }, + { + "internalType": "uint64", + "name": "epoch", + "type": "uint64" + }, + { + "internalType": "uint56", + "name": "linkToNextCommit", + "type": "uint56" + }, + { + "internalType": "bool", + "name": "priced", + "type": "bool" + }, + { + "internalType": "bool", + "name": "fragmented", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.Commit", + "name": "commit_", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "delegatorDepositByEpoch", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "input", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "output", + "type": "uint256" + }, + { + "internalType": "uint120", + "name": "outstanding", + "type": "uint120" + }, + { + "internalType": "uint64", + "name": "epoch", + "type": "uint64" + }, + { + "internalType": "uint56", + "name": "linkToNextCommit", + "type": "uint56" + }, + { + "internalType": "bool", + "name": "priced", + "type": "bool" + }, + { + "internalType": "bool", + "name": "fragmented", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.Commit", + "name": "commit_", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "delegatorDepositLen", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "delegatorExit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "delegatorJoin", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "delegatorMinStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "delegatorWithdrawal", + "outputs": [ + { + "components": [ + { + "internalType": "uint120", + "name": "quantity", + "type": "uint120" + }, + { + "internalType": "uint120", + "name": "offset", + "type": "uint120" + }, + { + "internalType": "uint256", + "name": "commit", + "type": "uint256" + } + ], + "internalType": "struct IGenLayerStaking.Claim", + "name": "claim_", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "input", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "output", + "type": "uint256" + }, + { + "internalType": "uint120", + "name": "outstanding", + "type": "uint120" + }, + { + "internalType": "uint64", + "name": "epoch", + "type": "uint64" + }, + { + "internalType": "uint56", + "name": "linkToNextCommit", + "type": "uint56" + }, + { + "internalType": "bool", + "name": "priced", + "type": "bool" + }, + { + "internalType": "bool", + "name": "fragmented", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.Commit", + "name": "commit_", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "delegatorWithdrawalByEpoch", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "input", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "output", + "type": "uint256" + }, + { + "internalType": "uint120", + "name": "outstanding", + "type": "uint120" + }, + { + "internalType": "uint64", + "name": "epoch", + "type": "uint64" + }, + { + "internalType": "uint56", + "name": "linkToNextCommit", + "type": "uint56" + }, + { + "internalType": "bool", + "name": "priced", + "type": "bool" + }, + { + "internalType": "bool", + "name": "fragmented", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.Commit", + "name": "commit_", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "delegatorWithdrawalLen", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_inflation", + "type": "uint256" + } + ], + "name": "developerInflation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "economicEpochValidatorCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "effectiveValidatorOccupancy", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "seed", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "slot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "number", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "generation", + "type": "uint64" + }, + { + "internalType": "address", + "name": "pointer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "runtimeCodeHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "snapshotHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "maxUtil", + "type": "uint256" + }, + { + "internalType": "uint256[7]", + "name": "temporaryUnavailableBits", + "type": "uint256[7]" + }, + { + "internalType": "uint256[]", + "name": "consumedRegistryIndexes", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "priorSlotPenalizedRegistryIndexes", + "type": "uint256[]" + } + ], + "internalType": "struct IGenLayerStaking.SnapshotSelectionRequest", + "name": "_request", + "type": "tuple" + } + ], + "name": "eligibleRegistryIndexesFromSnapshotAuthority", + "outputs": [ + { + "internalType": "uint256[]", + "name": "indexes", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epoch", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochAdvance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "epochEven", + "outputs": [ + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "inflation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "weight", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "weightDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "weightWithdrawal", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vcount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakeDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakeWithdrawal", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "slashed", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochExtraMinDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochExtraMinDurationOverride", + "outputs": [ + { + "internalType": "bool", + "name": "enabled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochFinalize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "epochFinalizeImmediate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "epochInflation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochMinDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochMinDurationThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochOdd", + "outputs": [ + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "inflation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "weight", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "weightDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "weightWithdrawal", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vcount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakeDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakeWithdrawal", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "slashed", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochZeroMinDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "expectedClaimableInflation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "seed", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "slot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "number", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "generation", + "type": "uint64" + }, + { + "internalType": "address", + "name": "pointer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "runtimeCodeHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "snapshotHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "maxUtil", + "type": "uint256" + }, + { + "internalType": "uint256[7]", + "name": "temporaryUnavailableBits", + "type": "uint256[7]" + }, + { + "internalType": "uint256[]", + "name": "consumedRegistryIndexes", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "priorSlotPenalizedRegistryIndexes", + "type": "uint256[]" + } + ], + "internalType": "struct IGenLayerStaking.SnapshotSelectionRequest", + "name": "_request", + "type": "tuple" + }, + { + "internalType": "uint256[]", + "name": "_candidateIndexes", + "type": "uint256[]" + } + ], + "name": "filterEligibleRegistryIndexesFromSnapshotAuthority", + "outputs": [ + { + "internalType": "uint256[]", + "name": "indexes", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "finalizationPhaseAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_attemptId", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_attemptHash", + "type": "bytes32" + } + ], + "name": "finalizeValidatorMinimumStakeTransition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "finalized", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_randomSeed", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_txCreatedTimestamp", + "type": "uint256" + } + ], + "name": "getActivatorForSeed", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_size", + "type": "uint256" + } + ], + "name": "getAllBannedValidators", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "untilEpochBanned", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "permanentlyBanned", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.BannedValidators[]", + "name": "validatorList", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_size", + "type": "uint256" + } + ], + "name": "getAllBannedValidatorsForEpoch", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "untilEpochBanned", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "permanentlyBanned", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.BannedValidators[]", + "name": "validatorList", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_size", + "type": "uint256" + } + ], + "name": "getAllQuarantinedValidators", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "untilEpochBanned", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "permanentlyBanned", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.BannedValidators[]", + "name": "validatorList", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_size", + "type": "uint256" + } + ], + "name": "getAllQuarantinedValidatorsForEpoch", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "untilEpochBanned", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "permanentlyBanned", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.BannedValidators[]", + "name": "validatorList", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getEpochExtraMinDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "getPendingDelegatorDeposits", + "outputs": [ + { + "internalType": "uint256", + "name": "total", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "getPendingDelegatorWithdrawals", + "outputs": [ + { + "internalType": "uint256", + "name": "total", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxItems", + "type": "uint256" + } + ], + "name": "getPendingJudicialConvictions", + "outputs": [ + { + "internalType": "address[]", + "name": "validators", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "getPendingValidatorDeposits", + "outputs": [ + { + "internalType": "uint256", + "name": "total", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "getPendingValidatorWithdrawals", + "outputs": [ + { + "internalType": "uint256", + "name": "total", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_txCreatedTimestamp", + "type": "uint256" + } + ], + "name": "getUnavailableQuarantinedValidators", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "getValidatorDelegators", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_pageSize", + "type": "uint256" + } + ], + "name": "getValidatorDelegatorsInfo", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "currentStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentShares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingDeposits", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingWithdrawals", + "type": "uint256" + } + ], + "internalType": "struct IGenLayerStaking.DelegatorInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_pageSize", + "type": "uint256" + } + ], + "name": "getValidatorDelegatorsPaginated", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getValidatorQuarantineList", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_pageSize", + "type": "uint256" + } + ], + "name": "getValidatorsJoined", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_at", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_until", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "idlenessBan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_validators", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "_quarantinedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_quarantinedUntil", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "idlenessBanBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "idlenessPhaseAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "_registryIndexes", + "type": "uint256[]" + } + ], + "name": "idlenessRestrictionEndEpochs", + "outputs": [ + { + "internalType": "uint256[]", + "name": "endEpochs", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "incentivePercentage", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inflationEpoch", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epochTo", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_inauguralTimestamp", + "type": "uint256" + } + ], + "name": "inflationInit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "inflationInitDone", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "inflationReceive", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "inflationRequestThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "inflationRequested", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inflationSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inflationTargetAhead", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_inauguralTimestamp", + "type": "uint256" + } + ], + "name": "initializeEpochStart", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "address", + "name": "_delegator", + "type": "address" + } + ], + "name": "isDelegatorOfValidator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "isSelectableValidatorAtRegistryIndex", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "isTribunalVoterLiveAvailableAtRegistryIndex", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "isValidator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "isValidatorBanned", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "judicialCapacityReservationCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "judicialCapacityReserved", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "judicialConvictionPending", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "judicialSelectionRestricted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "judicialSelectionRestrictedCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "judicialSelectionRestrictionVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "judicialSuspended", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2GasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2GasPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxUnbansPerEpoch", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxValidators", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "operatorsToValidators", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingJudicialConvictionCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingRequestInflationFromL1", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "permanentRestrictionVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "registryIndex", + "type": "uint256" + } + ], + "name": "preparedEconomicCohortContains", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "preparedEconomicCohortCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "preparedSelectionRosterCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "primingSelfStakeBps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_attemptId", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_attemptHash", + "type": "bytes32" + }, + { + "internalType": "uint24", + "name": "_expectedCursor", + "type": "uint24" + } + ], + "name": "processValidatorMinimumStakeTransition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "quarantineHistoryVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "recountVcount", + "outputs": [ + { + "internalType": "uint256", + "name": "counted", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "reductionFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "refreshEpochExtraMinDuration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "registryIndexPlus1", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_validators", + "type": "address[]" + } + ], + "name": "registryIndexesOf", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "remainingUnbanAllowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "removeAllValidatorBansExceptPermanent", + "outputs": [ + { + "internalType": "uint256", + "name": "removedCount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "remainingTemporary", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "removeValidatorBan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "removeValidatorQuarantine", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "requestInflationIfNeeded", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "_indexes", + "type": "uint256[]" + } + ], + "name": "resolveRegistryIndexes", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revealingPhaseAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_randomSeed", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_slot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_txCreatedTimestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_excludedActivator", + "type": "address" + } + ], + "name": "selectPendingActivator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "selectableValidators", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "selectableValidatorsCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "_registryIndexes", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "_quarantineVersion", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_judicialSelectionVersion", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_verdictEpoch", + "type": "uint256" + } + ], + "name": "selectionBarredAtVersions", + "outputs": [ + { + "internalType": "uint256", + "name": "barredBits", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "judiciallyBarredBits", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "selectionEconomicUnavailableBitmap", + "outputs": [ + { + "internalType": "uint256[7]", + "name": "bitmap", + "type": "uint256[7]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "selectionEpochParameters", + "outputs": [ + { + "internalType": "uint256", + "name": "minimumStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxUtil", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "selectionPoolSnapshot", + "outputs": [ + { + "internalType": "uint256[]", + "name": "indexes", + "type": "uint256[]" + }, + { + "internalType": "bytes32", + "name": "snapshotHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "selectionPoolSnapshotAuthority", + "outputs": [ + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "generation", + "type": "uint64" + }, + { + "internalType": "address", + "name": "pointer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "runtimeCodeHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "snapshotHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_count", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "_generation", + "type": "uint64" + }, + { + "internalType": "address", + "name": "_pointer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_runtimeCodeHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_snapshotHash", + "type": "bytes32" + } + ], + "name": "selectionPoolSnapshotFromAuthority", + "outputs": [ + { + "internalType": "uint256[]", + "name": "indexes", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "frozenUtilities", + "type": "uint256[]" + }, + { + "internalType": "uint256[7]", + "name": "liveUnavailableBits", + "type": "uint256[7]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_txCreatedTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_sortedConsumedRegistryIndexes", + "type": "uint256[]" + } + ], + "name": "selectionPoolUnavailableCount", + "outputs": [ + { + "internalType": "uint256", + "name": "poolCount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "unavailableCount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "seed", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "slot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "number", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "generation", + "type": "uint64" + }, + { + "internalType": "address", + "name": "pointer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "runtimeCodeHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "snapshotHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "maxUtil", + "type": "uint256" + }, + { + "internalType": "uint256[7]", + "name": "temporaryUnavailableBits", + "type": "uint256[7]" + }, + { + "internalType": "uint256[]", + "name": "consumedRegistryIndexes", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "priorSlotPenalizedRegistryIndexes", + "type": "uint256[]" + } + ], + "internalType": "struct IGenLayerStaking.SnapshotSelectionRequest", + "name": "_request", + "type": "tuple" + } + ], + "name": "selectionPoolUnavailableCountFromSnapshotAuthority", + "outputs": [ + { + "internalType": "uint256", + "name": "poolCount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "unavailableCount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "seed", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "slot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "number", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "generation", + "type": "uint64" + }, + { + "internalType": "address", + "name": "pointer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "runtimeCodeHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "snapshotHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "maxUtil", + "type": "uint256" + }, + { + "internalType": "uint256[7]", + "name": "temporaryUnavailableBits", + "type": "uint256[7]" + }, + { + "internalType": "uint256[]", + "name": "consumedRegistryIndexes", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "priorSlotPenalizedRegistryIndexes", + "type": "uint256[]" + } + ], + "internalType": "struct IGenLayerStaking.SnapshotSelectionRequest", + "name": "_request", + "type": "tuple" + }, + { + "internalType": "uint256[]", + "name": "_registryIndexes", + "type": "uint256[]" + } + ], + "name": "selectionSnapshotPositionsFromAuthority", + "outputs": [ + { + "internalType": "uint256[]", + "name": "positions", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "foundBits", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_quarantineHistoryVersion", + "type": "uint256" + } + ], + "name": "selectionTemporaryUnavailableBitmap", + "outputs": [ + { + "internalType": "uint256[7]", + "name": "bitmap", + "type": "uint256[7]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_burnThreshold", + "type": "uint256" + } + ], + "name": "setBurnThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_daoFeeBps", + "type": "uint256" + } + ], + "name": "setDaoFeeBps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_deepthought", + "type": "address" + } + ], + "name": "setDeepthought", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_delegatorMinStake", + "type": "uint256" + } + ], + "name": "setDelegatorMinimumStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epochExtraMinDuration", + "type": "uint256" + } + ], + "name": "setEpochExtraMinDurationOverride", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epochMinDuration", + "type": "uint256" + } + ], + "name": "setEpochMinDuration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epochMinDurationThreshold", + "type": "uint256" + } + ], + "name": "setEpochMinDurationThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epochZeroMinDuration", + "type": "uint256" + } + ], + "name": "setEpochZeroMinDuration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_finalizationPhase", + "type": "address" + } + ], + "name": "setFinalizationPhase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_gen", + "type": "address" + } + ], + "name": "setGen", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_idlenessPhase", + "type": "address" + } + ], + "name": "setIdlenessPhase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_incentivePercentage", + "type": "uint256" + } + ], + "name": "setIncentivePercentage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_inflationRequestThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_inflationTargetAhead", + "type": "uint256" + } + ], + "name": "setInflationThresholds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_l2GasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_l2GasLimit", + "type": "uint256" + } + ], + "name": "setL1InflationGasParams", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_max", + "type": "uint256" + } + ], + "name": "setMaxUnbansPerEpoch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxValidators", + "type": "uint256" + } + ], + "name": "setMaxValidators", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_bps", + "type": "uint256" + } + ], + "name": "setPrimingSelfStakeBps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_reductionFactor", + "type": "uint256" + } + ], + "name": "setReductionFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_revealingPhase", + "type": "address" + } + ], + "name": "setRevealingPhase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_transactionFeesManager", + "type": "address" + } + ], + "name": "setTransactionFeesManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_delegatorUnbondingPeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_validatorUnbondingPeriod", + "type": "uint256" + } + ], + "name": "setUnbondingPeriods", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_beta", + "type": "uint256" + } + ], + "name": "setValidatorWeightParams", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "enum IGenLayerStaking.JudicialCapacityDisposition", + "name": "_disposition", + "type": "uint8" + } + ], + "name": "settleJudicialSuspension", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "sharesOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_accusedAtEpoch", + "type": "uint256" + } + ], + "name": "suspendJudicially", + "outputs": [ + { + "internalType": "enum IGenLayerStaking.JudicialCapacityDisposition", + "name": "disposition", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "transactionFeesManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tribunalEligibleRegistryIndexes", + "outputs": [ + { + "internalType": "uint256[]", + "name": "indexes", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "seed", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "slot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "number", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "generation", + "type": "uint64" + }, + { + "internalType": "address", + "name": "pointer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "runtimeCodeHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "snapshotHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "maxUtil", + "type": "uint256" + }, + { + "internalType": "uint256[7]", + "name": "temporaryUnavailableBits", + "type": "uint256[7]" + }, + { + "internalType": "uint256[]", + "name": "consumedRegistryIndexes", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "priorSlotPenalizedRegistryIndexes", + "type": "uint256[]" + } + ], + "internalType": "struct IGenLayerStaking.SnapshotSelectionRequest", + "name": "_request", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_quarantineHistoryVersion", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_judicialSelectionVersion", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_creationEpoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_offset", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_pageSize", + "type": "uint256" + } + ], + "name": "tribunalEligibleRegistryIndexesPageFromSnapshotAuthority", + "outputs": [ + { + "internalType": "uint256[]", + "name": "indexes", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unbanCapConfigured", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "unbansInEpoch", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "validatorBanCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "validatorBanned", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "untilEpochBanned", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "permanentlyBanned", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.BannedValidators", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "validatorClaim", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "validatorDelegatorCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "validatorDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "epoch_", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "input", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "output", + "type": "uint256" + }, + { + "internalType": "uint120", + "name": "outstanding", + "type": "uint120" + }, + { + "internalType": "uint64", + "name": "epoch", + "type": "uint64" + }, + { + "internalType": "uint56", + "name": "linkToNextCommit", + "type": "uint56" + }, + { + "internalType": "bool", + "name": "priced", + "type": "bool" + }, + { + "internalType": "bool", + "name": "fragmented", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.Commit", + "name": "commit_", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "validatorDeposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "validatorDepositByEpoch", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "input", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "output", + "type": "uint256" + }, + { + "internalType": "uint120", + "name": "outstanding", + "type": "uint120" + }, + { + "internalType": "uint64", + "name": "epoch", + "type": "uint64" + }, + { + "internalType": "uint56", + "name": "linkToNextCommit", + "type": "uint56" + }, + { + "internalType": "bool", + "name": "priced", + "type": "bool" + }, + { + "internalType": "bool", + "name": "fragmented", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.Commit", + "name": "commit_", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "validatorDepositLen", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "validatorExit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[2]", + "name": "_operatorPubKey", + "type": "uint256[2]" + }, + { + "internalType": "bytes", + "name": "_possessionProof", + "type": "bytes" + } + ], + "name": "validatorJoin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "validatorMinStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "validatorMinimumStakePublishedVersion", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "validatorMinimumStakeTransition", + "outputs": [ + { + "components": [ + { + "internalType": "enum IGenLayerStaking.MinimumStakeTransitionStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint64", + "name": "id", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "fromPublishedVersion", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "baseGeneration", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "candidateGeneration", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "capacityVersion", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "weightVersion", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "revision", + "type": "uint64" + }, + { + "internalType": "uint24", + "name": "worksetCount", + "type": "uint24" + }, + { + "internalType": "uint24", + "name": "cursor", + "type": "uint24" + }, + { + "internalType": "uint24", + "name": "grandfatheredOccupancy", + "type": "uint24" + }, + { + "internalType": "address", + "name": "worksetPointer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "targetEpoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "oldMinimum", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "proposedMinimum", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "weightDelta", + "type": "int256" + }, + { + "internalType": "int256", + "name": "vcountDelta", + "type": "int256" + }, + { + "internalType": "bytes32", + "name": "worksetRuntimeCodeHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "worksetHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "attemptHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "candidateAccountingFingerprint", + "type": "bytes32" + } + ], + "internalType": "struct IGenLayerStaking.MinimumStakeTransition", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "validatorPermanentlyBanned", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "validatorPrime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_at", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + } + ], + "name": "validatorQuarantine", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "validatorQuarantineCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_seed", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_slot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_txCreatedTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_number", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_weighted", + "type": "bool" + }, + { + "internalType": "address[]", + "name": "_consumed", + "type": "address[]" + } + ], + "name": "validatorSelection", + "outputs": [ + { + "internalType": "uint256", + "name": "leader_", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "validators_", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "penalized_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_seed", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_slot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_txCreatedTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_number", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_weighted", + "type": "bool" + }, + { + "internalType": "address[]", + "name": "_consumed", + "type": "address[]" + } + ], + "name": "validatorSelection", + "outputs": [ + { + "internalType": "uint256", + "name": "leader_", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "validators_", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "penalized_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_seed", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_number", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_candidateIndexes", + "type": "uint256[]" + } + ], + "name": "validatorSelectionFromExactIndexes", + "outputs": [ + { + "internalType": "uint256[]", + "name": "selectedIndexes", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "rand", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_seed", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_number", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_txCreatedTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_consumedRegistryIndexes", + "type": "uint256[]" + } + ], + "name": "validatorSelectionFromList", + "outputs": [ + { + "internalType": "uint256[]", + "name": "selectedIndexes", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "rand_", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "seed", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "slot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "number", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "generation", + "type": "uint64" + }, + { + "internalType": "address", + "name": "pointer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "runtimeCodeHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "snapshotHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "maxUtil", + "type": "uint256" + }, + { + "internalType": "uint256[7]", + "name": "temporaryUnavailableBits", + "type": "uint256[7]" + }, + { + "internalType": "uint256[]", + "name": "consumedRegistryIndexes", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "priorSlotPenalizedRegistryIndexes", + "type": "uint256[]" + } + ], + "internalType": "struct IGenLayerStaking.SnapshotSelectionRequest", + "name": "_request", + "type": "tuple" + } + ], + "name": "validatorSelectionFromSnapshotAuthority", + "outputs": [ + { + "internalType": "uint256", + "name": "leader", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "validators", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "penalized", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "validatorView", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "eBanned", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ePrimed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vShares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "dStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "dShares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vWithdrawal", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "live", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.ValidatorView", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "validatorViewPrePrimed", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "eBanned", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ePrimed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vShares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "dStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "dShares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vWithdrawal", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "live", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.ValidatorView", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "validatorViewPrimed", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "eBanned", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ePrimed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vShares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "dStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "dShares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vWithdrawal", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "live", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.ValidatorView", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "validatorWithdrawal", + "outputs": [ + { + "internalType": "uint256", + "name": "epoch_", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "input", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "output", + "type": "uint256" + }, + { + "internalType": "uint120", + "name": "outstanding", + "type": "uint120" + }, + { + "internalType": "uint64", + "name": "epoch", + "type": "uint64" + }, + { + "internalType": "uint56", + "name": "linkToNextCommit", + "type": "uint56" + }, + { + "internalType": "bool", + "name": "priced", + "type": "bool" + }, + { + "internalType": "bool", + "name": "fragmented", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.Commit", + "name": "commit_", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "validatorWithdrawalByEpoch", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "input", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "output", + "type": "uint256" + }, + { + "internalType": "uint120", + "name": "outstanding", + "type": "uint120" + }, + { + "internalType": "uint64", + "name": "epoch", + "type": "uint64" + }, + { + "internalType": "uint56", + "name": "linkToNextCommit", + "type": "uint56" + }, + { + "internalType": "bool", + "name": "priced", + "type": "bool" + }, + { + "internalType": "bool", + "name": "fragmented", + "type": "bool" + } + ], + "internalType": "struct IGenLayerStaking.Commit", + "name": "commit_", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validator", + "type": "address" + } + ], + "name": "validatorWithdrawalLen", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "validatorsJoined", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "validatorsJoinedCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } ] diff --git a/genlayer_py/staking/abi/validator_wallet_abi.json b/genlayer_py/staking/abi/validator_wallet_abi.json index df1cd5c..c7aa641 100644 --- a/genlayer_py/staking/abi/validator_wallet_abi.json +++ b/genlayer_py/staking/abi/validator_wallet_abi.json @@ -1,1052 +1,1391 @@ [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "address", - "name": "_staking", - "type": "address" - }, - { - "internalType": "address", - "name": "_consensus", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "AccessControlBadConfirmation", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "neededRole", - "type": "bytes32" - } - ], - "name": "AccessControlUnauthorizedAccount", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [], - "name": "NotOperator", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnableInvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "OwnableUnauthorizedAccount", - "type": "error" - }, - { - "inputs": [], - "name": "ReentrancyGuardReentrantCall", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - } - ], - "name": "ValidatorIdentitySet", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "_vrfProof", - "type": "bytes" - } - ], - "name": "activateTransaction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_tribunalIndex", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "_commitHash", - "type": "bytes32" - } - ], - "name": "commitTribunalAppealVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_commitHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_validatorIndex", - "type": "uint256" - } - ], - "name": "commitVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "consensus", - "outputs": [ - { - "internalType": "contract IConsensusMain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "consensusWithFees", - "outputs": [ - { - "internalType": "contract IConsensusMainWithFees", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getIdentity", - "outputs": [ - { - "components": [ - { - "internalType": "string", - "name": "moniker", - "type": "string" - }, - { - "internalType": "string", - "name": "logoUri", - "type": "string" - }, - { - "internalType": "string", - "name": "website", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "string", - "name": "email", - "type": "string" - }, - { - "internalType": "string", - "name": "twitter", - "type": "string" - }, - { - "internalType": "string", - "name": "telegram", - "type": "string" - }, - { - "internalType": "string", - "name": "github", - "type": "string" - }, - { - "internalType": "bytes", - "name": "extraCid", - "type": "bytes" - } - ], - "internalType": "struct ValidatorIdentity", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getOperator", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "identity", - "outputs": [ - { - "internalType": "string", - "name": "moniker", - "type": "string" - }, - { - "internalType": "string", - "name": "logoUri", - "type": "string" - }, - { - "internalType": "string", - "name": "website", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "string", - "name": "email", - "type": "string" - }, - { - "internalType": "string", - "name": "twitter", - "type": "string" - }, - { - "internalType": "string", - "name": "telegram", - "type": "string" - }, - { - "internalType": "string", - "name": "github", - "type": "string" - }, - { - "internalType": "bytes", - "name": "extraCid", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "saltAsAValidator", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "txExecutionHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "messagesAndOtherFieldsHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "otherExecutionFieldsHash", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.VoteType", - "name": "resultValue", - "type": "uint8" - }, - { - "components": [ - { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "saltNonce", - "type": "uint256" - } - ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" - } - ], - "internalType": "struct IConsensusMain.LeaderRevealVoteParams", - "name": "_leaderRevealVoteParams", - "type": "tuple" - } - ], - "name": "leaderRevealVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "operator", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_txExecutionHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_processingBlock", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_eqBlocksOutputs", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "_vrfProof", - "type": "bytes" - } - ], - "name": "proposeReceipt", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_txExecutionHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_processingBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_storageFeeUsed", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_eqBlocksOutputs", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "_vrfProof", - "type": "bytes" - } - ], - "name": "proposeReceiptWithFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "callerConfirmation", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_tribunalIndex", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "_voteHash", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.VoteType", - "name": "_voteType", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "_otherExecutionFieldsHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - } - ], - "name": "revealTribunalAppealVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_voteHash", - "type": "bytes32" - }, - { - "internalType": "enum ITransactions.VoteType", - "name": "_voteType", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "_otherExecutionFieldsHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_validatorIndex", - "type": "uint256" - } - ], - "name": "revealVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_consensus", - "type": "address" - }, - { - "internalType": "address", - "name": "_consensusWithFees", - "type": "address" - }, - { - "internalType": "address", - "name": "_staking", - "type": "address" - } - ], - "name": "setExternalAddresses", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "moniker", - "type": "string" - }, - { - "internalType": "string", - "name": "logoUri", - "type": "string" - }, - { - "internalType": "string", - "name": "website", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "string", - "name": "email", - "type": "string" - }, - { - "internalType": "string", - "name": "twitter", - "type": "string" - }, - { - "internalType": "string", - "name": "telegram", - "type": "string" - }, - { - "internalType": "string", - "name": "github", - "type": "string" - }, - { - "internalType": "bytes", - "name": "extraCid", - "type": "bytes" - } - ], - "name": "setIdentity", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_operator", - "type": "address" - } - ], - "name": "setOperator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "staking", - "outputs": [ - { - "internalType": "contract IGenLayerStaking", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "validatorClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "validatorDeposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_shares", - "type": "uint256" - } - ], - "name": "validatorExit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - }, - { - "name": "initiateOperatorTransfer", - "type": "function", - "stateMutability": "nonpayable", - "inputs": [ - { - "name": "_newOperatorPubKey", - "type": "uint256[2]", - "internalType": "uint256[2]" - }, - { - "name": "_possessionProof", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [] - }, - { - "name": "completeOperatorTransfer", - "type": "function", - "stateMutability": "nonpayable", - "inputs": [], - "outputs": [] - }, - { - "name": "cancelOperatorTransfer", - "type": "function", - "stateMutability": "nonpayable", - "inputs": [], - "outputs": [] - }, - { - "name": "getPendingOperator", - "type": "function", - "stateMutability": "view", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ] - } + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AccessControlBadConfirmation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "neededRole", + "type": "bytes32" + } + ], + "name": "AccessControlUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidPossessionProof", + "type": "error" + }, + { + "inputs": [], + "name": "NoPendingOperator", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "NotOperator", + "type": "error" + }, + { + "inputs": [], + "name": "OperatorTransferNotReady", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "PubKeyIsZero", + "type": "error" + }, + { + "inputs": [], + "name": "PubKeyNotOnCurve", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrancyGuardReentrantCall", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFailed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newOperator", + "type": "address" + } + ], + "name": "OperatorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "by", + "type": "address" + } + ], + "name": "OperatorTransferCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "OperatorTransferCompleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "transferableAt", + "type": "uint256" + } + ], + "name": "OperatorTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ValidatorClaimProcessed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ValidatorDepositMade", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "ValidatorExitInitiated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + } + ], + "name": "ValidatorIdentitySet", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "OPERATOR_TRANSFER_DELAY", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "activateTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "cancelOperatorTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tribunalIndex", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_commitHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_activeIndex", + "type": "uint256" + } + ], + "name": "commitTribunalAppealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_commitHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_validatorIndex", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "commitVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "completeOperatorTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "consensus", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "consensusWithFees", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "factory", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getIdentity", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "moniker", + "type": "string" + }, + { + "internalType": "string", + "name": "logoUri", + "type": "string" + }, + { + "internalType": "string", + "name": "website", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "string", + "name": "email", + "type": "string" + }, + { + "internalType": "string", + "name": "twitter", + "type": "string" + }, + { + "internalType": "string", + "name": "telegram", + "type": "string" + }, + { + "internalType": "string", + "name": "github", + "type": "string" + }, + { + "internalType": "bytes", + "name": "extraCid", + "type": "bytes" + } + ], + "internalType": "struct IValidatorWallet.ValidatorIdentity", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getOperator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getOperatorPubKey", + "outputs": [ + { + "internalType": "uint256[2]", + "name": "", + "type": "uint256[2]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPendingOperator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "identity", + "outputs": [ + { + "internalType": "string", + "name": "moniker", + "type": "string" + }, + { + "internalType": "string", + "name": "logoUri", + "type": "string" + }, + { + "internalType": "string", + "name": "website", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "string", + "name": "email", + "type": "string" + }, + { + "internalType": "string", + "name": "twitter", + "type": "string" + }, + { + "internalType": "string", + "name": "telegram", + "type": "string" + }, + { + "internalType": "string", + "name": "github", + "type": "string" + }, + { + "internalType": "bytes", + "name": "extraCid", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_factory", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_staking", + "type": "address" + }, + { + "internalType": "address", + "name": "_consensus", + "type": "address" + }, + { + "internalType": "uint256[2]", + "name": "_operatorPubKey", + "type": "uint256[2]" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[2]", + "name": "_newOperatorPubKey", + "type": "uint256[2]" + }, + { + "internalType": "bytes", + "name": "_possessionProof", + "type": "bytes" + } + ], + "name": "initiateOperatorTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "expectedAttemptId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "saltAsAValidator", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "messagesAndOtherFieldsHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "otherExecutionFieldsHash", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "resultValue", + "type": "uint8" + }, + { + "components": [ + { + "internalType": "enum IMessages.MessageType", + "name": "messageType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "onAcceptance", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeParams", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "declaredBudget", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "allocationSubtree", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "callKey", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "useBalance", + "type": "bool" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" + } + ], + "internalType": "struct IConsensusMain.LeaderRevealVoteParams", + "name": "_params", + "type": "tuple" + } + ], + "name": "leaderRevealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "operator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "operatorPubKey", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "operatorTransferInitiated", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOperator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "pendingOperatorPubKey", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_processingBlock", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_eqBlocksOutputs", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "proposeReceipt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_storageFeeUsed", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_eqBlocksOutputs", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "proposeReceiptWithFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_txExecutionHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_processingBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_storageFeeUsed", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_eqBlocksOutputs", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_vrfProof", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_reportedMessageFeesTotal", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "proposeReceiptWithMessages", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "callerConfirmation", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_tribunalIndex", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_voteHash", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "_voteType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_otherExecutionFieldsHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_activeIndex", + "type": "uint256" + } + ], + "name": "revealTribunalAppealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_txId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_voteHash", + "type": "bytes32" + }, + { + "internalType": "enum ITransactions.VoteType", + "name": "_voteType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_otherExecutionFieldsHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_validatorIndex", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_expectedAttemptId", + "type": "bytes32" + } + ], + "name": "revealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_consensus", + "type": "address" + }, + { + "internalType": "address", + "name": "_consensusWithFees", + "type": "address" + }, + { + "internalType": "address", + "name": "_staking", + "type": "address" + } + ], + "name": "setExternalAddresses", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "moniker", + "type": "string" + }, + { + "internalType": "string", + "name": "logoUri", + "type": "string" + }, + { + "internalType": "string", + "name": "website", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "string", + "name": "email", + "type": "string" + }, + { + "internalType": "string", + "name": "twitter", + "type": "string" + }, + { + "internalType": "string", + "name": "telegram", + "type": "string" + }, + { + "internalType": "string", + "name": "github", + "type": "string" + }, + { + "internalType": "bytes", + "name": "extraCid", + "type": "bytes" + } + ], + "name": "setIdentity", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[2]", + "name": "_operatorPubKey", + "type": "uint256[2]" + }, + { + "internalType": "bytes", + "name": "_possessionProof", + "type": "bytes" + } + ], + "name": "setOperatorPubKey", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "staking", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "validatorClaim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "validatorDeposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_shares", + "type": "uint256" + } + ], + "name": "validatorExit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } ] diff --git a/genlayer_py/staking/actions.py b/genlayer_py/staking/actions.py index c3a9a64..09f383e 100644 --- a/genlayer_py/staking/actions.py +++ b/genlayer_py/staking/actions.py @@ -15,6 +15,7 @@ from eth_typing import Address, ChecksumAddress from hexbytes import HexBytes +from genlayer_py.consensus.abi import ADDRESS_MANAGER_ABI from genlayer_py.exceptions import GenLayerError from genlayer_py.staking.abi import STAKING_ABI, VALIDATOR_WALLET_ABI from genlayer_py.staking.operator_registration import ( @@ -29,6 +30,14 @@ AddressLike = Union[Address, ChecksumAddress, str] +ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" + +# The joined validator registry is only readable in slices: committee capacity +# is 1,543 and an address[] that long overruns the return-size limit. 64 is the +# size the paged reads are written around, and the one genlayer-node uses for +# the same walk. +VALIDATORS_JOINED_PAGE_SIZE = 64 + def _require_staking(self: "GenLayerClient") -> ChecksumAddress: if self.chain.staking_contract is None: @@ -48,9 +57,7 @@ def _wallet(self: "GenLayerClient", validator: AddressLike): ) -def _sender( - self: "GenLayerClient", account: Optional[LocalAccount] -) -> LocalAccount: +def _sender(self: "GenLayerClient", account: Optional[LocalAccount]) -> LocalAccount: acct = account or self.local_account if acct is None: raise GenLayerError("No account provided and client has no local_account") @@ -97,11 +104,38 @@ def epoch(self: "GenLayerClient") -> int: def active_validators(self: "GenLayerClient") -> List[ChecksumAddress]: - return _staking(self).functions.activeValidators().call() + """Return validators that are currently eligible for protocol duties.""" + return _staking(self).functions.selectableValidators().call() def active_validators_count(self: "GenLayerClient") -> int: - return _staking(self).functions.activeValidatorsCount().call() + """Return the number of validators currently eligible for duties.""" + return _staking(self).functions.selectableValidatorsCount().call() + + +def joined_validators(self: "GenLayerClient") -> List[ChecksumAddress]: + """Return every validator wallet in the append-only joined registry.""" + # The joined registry can contain 1,543 entries, so read it in slices. The + # count is read first so a registry that grows underneath the walk cannot + # spin forever, and an empty page lets a shrinking walk stop safely. + staking = _staking(self) + total = staking.functions.validatorsJoinedCount().call() + + validators: List[ChecksumAddress] = [] + for start in range(0, total, VALIDATORS_JOINED_PAGE_SIZE): + page = staking.functions.getValidatorsJoined( + start, VALIDATORS_JOINED_PAGE_SIZE + ).call() + if not page: + break + validators.extend(page) + + return [v for v in validators if v != ZERO_ADDRESS] + + +def joined_validators_count(self: "GenLayerClient") -> int: + """Return the size of the append-only joined validator registry.""" + return _staking(self).functions.validatorsJoinedCount().call() def is_validator(self: "GenLayerClient", address: AddressLike) -> bool: @@ -152,25 +186,62 @@ def delegator_min_stake(self: "GenLayerClient") -> int: # ─── write methods ──────────────────────────────────────────────────── +def get_validator_join_context( + self: "GenLayerClient", + account: Optional[LocalAccount] = None, +) -> OperatorRegistrationContext: + """Return the factory-bound context required for a validator join proof.""" + sender = _sender(self, account) + address_manager_address = _staking(self).functions.addressManager().call() + address_manager = self.w3.eth.contract( + address=self.w3.to_checksum_address(address_manager_address), + abi=ADDRESS_MANAGER_ABI, + ) + factory = address_manager.functions.getAddressNonZero( + "ValidatorWalletFactory" + ).call() + return OperatorRegistrationContext( + registrar=self.w3.to_checksum_address(factory), + owner=self.w3.to_checksum_address(sender.address), + chain_id=self.w3.eth.chain_id, + ) + + def validator_join( self: "GenLayerClient", amount: int, - operator: Optional[AddressLike] = None, + registration: Optional[OperatorRegistrationProof] = None, account: Optional[LocalAccount] = None, + operator: Optional[AddressLike] = None, ) -> HexBytes: - """Joins as a validator with `amount` GEN stake. Deploys a new - ValidatorWallet. Returns the tx hash — call get_validator_info on - the resulting wallet address to discover it (or parse the receipt - for the ValidatorJoin event).""" + """Join with a proof-bound operator key and deploy a ValidatorWallet. + + Build ``registration`` with :func:`get_validator_join_context` and + ``create_operator_registration``. The legacy address-only overloads do not + exist on the train. + """ + if operator is not None or not isinstance(registration, OperatorRegistrationProof): + raise GenLayerError( + "validator_join now requires an OperatorRegistrationProof; call " + "get_validator_join_context(), create_operator_registration(), then " + "pass the resulting registration. An operator address alone is not " + "accepted by the train contract." + ) + sender = _sender(self, account) + context = get_validator_join_context(self, account) + if not verify_operator_registration(registration, context): + raise GenLayerError( + "Operator registration proof does not match the validator wallet " + "factory, owner, chain, or public key. Build a fresh proof from " + "get_validator_join_context()." + ) + contract = _staking(self) - # Staking.validatorJoin has two overloads — () and (address) — so - # web3.py needs the full signature, not the name alone. - if operator is not None: - op = self.w3.to_checksum_address(operator) - data = contract.encode_abi("validatorJoin(address)", args=[op]) - else: - data = contract.encode_abi("validatorJoin()", args=[]) + data = contract.encode_abi( + "validatorJoin", + args=[list(registration.operator_pub_key), registration.possession_proof], + ) tx = _build(self, sender, _require_staking(self), data, value=amount) return _send(self, sender, tx) @@ -186,7 +257,9 @@ def validator_deposit( sender = _sender(self, account) wallet = _wallet(self, validator) data = wallet.encode_abi("validatorDeposit", args=[]) - tx = _build(self, sender, self.w3.to_checksum_address(validator), data, value=amount) + tx = _build( + self, sender, self.w3.to_checksum_address(validator), data, value=amount + ) return _send(self, sender, tx) @@ -241,20 +314,13 @@ def set_operator( operator: AddressLike, account: Optional[LocalAccount] = None, ) -> HexBytes: - """Rotates the operator for an existing ValidatorWallet. Only the - wallet owner (the EOA that called validator_join) may do this. - - CON-715 removed this single call in favour of the two-step transfer - below; against a deployment carrying that change it reverts with no - decodable reason, because the selector no longer exists. Prefer - initiate_operator_transfer + complete_operator_transfer.""" - sender = _sender(self, account) - wallet = _wallet(self, validator) - data = wallet.encode_abi( - "setOperator", args=[self.w3.to_checksum_address(operator)] + """Explain how to migrate from the removed address-only rotation call.""" + raise GenLayerError( + "set_operator(address) was removed from the train contract and no " + "transaction was sent. Build a proof with " + "get_operator_transfer_context(), call initiate_operator_transfer(), " + "then complete_operator_transfer() after the transfer delay." ) - tx = _build(self, sender, self.w3.to_checksum_address(validator), data) - return _send(self, sender, tx) def get_operator_transfer_context( diff --git a/genlayer_py/transactions/actions.py b/genlayer_py/transactions/actions.py index 826ee91..021d9fc 100644 --- a/genlayer_py/transactions/actions.py +++ b/genlayer_py/transactions/actions.py @@ -2,21 +2,32 @@ from genlayer_py.logging import logger import json -import warnings from typing import Any, Dict, List, Literal, Optional from web3 import Web3 from web3.types import _Hash32 -from eth_typing import HexStr +from eth_typing import Address, HexStr from web3.logs import DISCARD from genlayer_py.config import transaction_config from genlayer_py.types import ( - TransactionStatus, ExecutionResult, EXECUTION_RESULT_NUMBER_TO_NAME, - TRANSACTION_STATUS_NAME_TO_NUMBER, - TRANSACTION_STATUS_NUMBER_TO_NAME, - is_decided_state, +) +from genlayer_py.types.transactions import ( + PROTOCOL_TRANSACTION_STATUS_NAME_TO_NUMBER, + PROTOCOL_TRANSACTION_STATUS_NUMBER_TO_NAME, + RESOLUTION_ACTION_NUMBER_TO_NAME, + RESOLUTION_SOURCE_NUMBER_TO_NAME, + ProtocolTransactionLifecycle, + ProtocolTransactionStatus, + transaction_lifecycle_from_protocol_status, + transaction_outcome_from_protocol_result, +) +from genlayer_py.consensus.abi import ( + ADDRESS_MANAGER_ABI, + CONSENSUS_DATA_BIG_ROUNDS_ABI, + ROUNDS_STORAGE_READ_ABI, + TRANSACTION_MANAGER_READ_ABI, ) from genlayer_py.exceptions import GenLayerError from typing import TYPE_CHECKING @@ -69,65 +80,7 @@ from genlayer_py.client import GenLayerClient -_did_warn_wait_for_transaction_receipt_status = False - - -def _warn_deprecated_receipt_status() -> None: - global _did_warn_wait_for_transaction_receipt_status - if _did_warn_wait_for_transaction_receipt_status: - return - _did_warn_wait_for_transaction_receipt_status = True - warnings.warn( - "wait_for_transaction_receipt(status=...) is deprecated; use " - "wait_until='decided' or wait_until='finalized' instead.", - DeprecationWarning, - stacklevel=3, - ) - - -def _resolve_wait_target( - status: Optional[TransactionStatus], - wait_until: Optional[Literal["decided", "finalized"]], -) -> dict: - if wait_until is not None: - if wait_until not in ("decided", "finalized"): - raise ValueError("wait_until must be 'decided' or 'finalized'.") - return {"wait_until": wait_until, "legacy_status": None, "label": wait_until} - if status is None: - return {"wait_until": "decided", "legacy_status": None, "label": "decided"} - - _warn_deprecated_receipt_status() - if status == TransactionStatus.ACCEPTED: - return {"wait_until": "decided", "legacy_status": None, "label": "decided"} - if status == TransactionStatus.FINALIZED: - return {"wait_until": "finalized", "legacy_status": None, "label": "finalized"} - return {"wait_until": None, "legacy_status": status, "label": status.value} - - -def _has_reached_wait_target(transaction_status: str, target: dict) -> bool: - if target["wait_until"] == "decided": - return is_decided_state(transaction_status) - if target["wait_until"] == "finalized": - return transaction_status == TRANSACTION_STATUS_NAME_TO_NUMBER[ - TransactionStatus.FINALIZED - ] - legacy_status = target["legacy_status"] - return ( - legacy_status is not None - and transaction_status == TRANSACTION_STATUS_NAME_TO_NUMBER[legacy_status] - ) - - -def _normalize_status_name(value: Any) -> Optional[TransactionStatus]: - if isinstance(value, TransactionStatus): - return value - if isinstance(value, str): - if value in TransactionStatus._value2member_map_: - return TransactionStatus(value) - return TRANSACTION_STATUS_NUMBER_TO_NAME.get(value) - if value is None: - return None - return TRANSACTION_STATUS_NUMBER_TO_NAME.get(str(value)) +TRANSACTION_ARRAY_PAGE_SIZE = 64 def _normalize_execution_result_name(value: Any) -> Optional[ExecutionResult]: @@ -141,9 +94,14 @@ def _normalize_execution_result_name(value: Any) -> Optional[ExecutionResult]: def is_successful(transaction: GenLayerTransaction) -> bool: - status_name = _normalize_status_name( - transaction.get("status_name", transaction.get("status")) - ) + lifecycle = transaction.get("lifecycle") + if not isinstance(lifecycle, dict): + return False + lifecycle_state = lifecycle.get("state") + successful_lifecycle = ( + lifecycle_state == "finalized" + and lifecycle.get("outcome") in (None, "accepted") + ) or (lifecycle_state == "decided" and lifecycle.get("outcome") == "accepted") execution_result_name = _normalize_execution_result_name( transaction.get( "tx_execution_result_name", @@ -164,53 +122,563 @@ def is_successful(transaction: GenLayerTransaction) -> bool: execution_result_name = ExecutionResult.FINISHED_WITH_RETURN return ( - status_name in (TransactionStatus.ACCEPTED, TransactionStatus.FINALIZED) + successful_lifecycle and execution_result_name == ExecutionResult.FINISHED_WITH_RETURN ) -def wait_for_transaction_receipt( +def _wait_for_transaction( self: GenLayerClient, transaction_hash: _Hash32, - status: Optional[TransactionStatus] = None, - wait_until: Optional[Literal["decided", "finalized"]] = None, + wait_until: Literal["decided", "finalized"], interval: int = transaction_config.wait_interval, retries: int = transaction_config.retries, full_transaction: bool = False, ) -> GenLayerTransaction: - attempts = 0 - target = _resolve_wait_target(status, wait_until) transaction = None - last_status = None + last_state = None while attempts < retries: transaction = self.get_transaction(transaction_hash=transaction_hash) if transaction is None: raise GenLayerError(f"Transaction {transaction_hash} not found") - transaction_status = str(transaction["status"]) - last_status = TRANSACTION_STATUS_NUMBER_TO_NAME.get(transaction_status) + lifecycle = transaction.get("lifecycle") + if not isinstance(lifecycle, dict) or not isinstance( + lifecycle.get("state"), str + ): + raise GenLayerError( + f"Transaction {transaction_hash} has no valid lifecycle" + ) + last_state = lifecycle["state"] + reached_target = ( + last_state in ("decided", "finalized", "canceled") + if wait_until == "decided" + else last_state == "finalized" + ) - if _has_reached_wait_target(transaction_status, target): + if wait_until == "finalized" and last_state == "canceled": + raise GenLayerError( + f"Transaction {transaction_hash} was canceled before finalization" + ) + + if reached_target: if not full_transaction: return _simplify_transaction_receipt(transaction) return transaction time.sleep(interval / 1000) attempts += 1 - last_status_label = ( - last_status.value - if isinstance(last_status, TransactionStatus) - else str(transaction["status"]) if transaction else "" - ) raise GenLayerError( - f"Transaction {transaction_hash} did not reach desired status '{target['label']}' after {retries} attempts " + f"Transaction {transaction_hash} did not reach '{wait_until}' after {retries} attempts " f"(polling every {interval}ms for a total of {retries * interval / 1000:.1f}s). " - f"Last observed status: '{last_status_label}'. " + f"Last observed lifecycle state: '{last_state or ''}'. " f"This may indicate the transaction is still processing, or the network is experiencing delays. " f"Consider increasing 'retries' or 'interval' parameters.\n" f"Transaction object simplified: {json.dumps(_simplify_transaction_receipt(transaction), indent=2, default=str)}" ) +def wait_for_decision( + self: GenLayerClient, + transaction_hash: _Hash32, + interval: int = transaction_config.wait_interval, + retries: int = transaction_config.retries, + full_transaction: bool = False, +) -> GenLayerTransaction: + """Poll until the stored transaction state is decided or terminal.""" + + return _wait_for_transaction( + self, + transaction_hash, + "decided", + interval, + retries, + full_transaction, + ) + + +def wait_for_finalization( + self: GenLayerClient, + transaction_hash: _Hash32, + interval: int = transaction_config.wait_interval, + retries: int = transaction_config.retries, + full_transaction: bool = False, +) -> GenLayerTransaction: + """Poll until the stored transaction state is finalized.""" + + return _wait_for_transaction( + self, + transaction_hash, + "finalized", + interval, + retries, + full_transaction, + ) + + +def wait_for_transaction_receipt( + self: GenLayerClient, + transaction_hash: _Hash32, + wait_until: Literal["decided", "finalized"] = "decided", + interval: int = transaction_config.wait_interval, + retries: int = transaction_config.retries, + full_transaction: bool = False, +) -> GenLayerTransaction: + """Poll for a stored decision (default) or stored finalization.""" + + if wait_until == "decided": + return wait_for_decision( + self, transaction_hash, interval, retries, full_transaction + ) + if wait_until == "finalized": + return wait_for_finalization( + self, transaction_hash, interval, retries, full_transaction + ) + raise ValueError("wait_until must be 'decided' or 'finalized'.") + + +def _call_at_block(contract_function, block_number: int): + return contract_function.call(block_identifier=block_number) + + +def _address_manager( + self: GenLayerClient, + consensus_data_contract, + block_number: int, +): + address_manager_address = _call_at_block( + consensus_data_contract.functions.addressManager(), block_number + ) + return self.w3.eth.contract( + address=address_manager_address, abi=ADDRESS_MANAGER_ABI + ) + + +def _resolve_contract( + self: GenLayerClient, + address_manager, + name: str, + abi: List[dict], + block_number: int, +): + contract_address = _call_at_block( + address_manager.functions.getAddressNonZero(name), block_number + ) + return self.w3.eth.contract(address=contract_address, abi=abi) + + +def _read_round_validators( + big_rounds_contract, + transaction_hash: _Hash32, + round_number: int, + validators_count: int, + block_number: int, +) -> List[Address]: + validators: List[Address] = [] + for offset in range(0, validators_count, TRANSACTION_ARRAY_PAGE_SIZE): + page, total = _call_at_block( + big_rounds_contract.functions.getRoundValidatorsPaged( + transaction_hash, + round_number, + offset, + TRANSACTION_ARRAY_PAGE_SIZE, + ), + block_number, + ) + if total != validators_count: + raise GenLayerError( + "Inconsistent transaction committee size at fixed block " + f"{block_number}: expected {validators_count}, got {total}" + ) + validators.extend(page) + + if len(validators) != validators_count: + raise GenLayerError( + "Incomplete transaction committee at fixed block " + f"{block_number}: expected {validators_count}, got {len(validators)}" + ) + return validators + + +def _read_consumed_validators( + big_rounds_contract, + transaction_hash: _Hash32, + validators_count: int, + block_number: int, +) -> List[Address]: + validators: List[Address] = [] + for offset in range(0, validators_count, TRANSACTION_ARRAY_PAGE_SIZE): + page, total = _call_at_block( + big_rounds_contract.functions.getConsumedValidatorsPaged( + transaction_hash, + offset, + TRANSACTION_ARRAY_PAGE_SIZE, + ), + block_number, + ) + if total != validators_count: + raise GenLayerError( + "Inconsistent consumed-validator count at fixed block " + f"{block_number}: expected {validators_count}, got {total}" + ) + validators.extend(page) + + if len(validators) != validators_count: + raise GenLayerError( + "Incomplete consumed-validator set at fixed block " + f"{block_number}: expected {validators_count}, got {len(validators)}" + ) + return validators + + +def _read_train_transaction_data( + self: GenLayerClient, + consensus_data_contract, + transaction_hash: _Hash32, + block_number: int, +): + """Compose one bounded transaction snapshot from train read surfaces.""" + address_manager = _address_manager(self, consensus_data_contract, block_number) + big_rounds = _resolve_contract( + self, + address_manager, + "ConsensusDataBigRounds", + CONSENSUS_DATA_BIG_ROUNDS_ABI, + block_number, + ) + transaction_manager = _resolve_contract( + self, + address_manager, + "TransactionManager", + TRANSACTION_MANAGER_READ_ABI, + block_number, + ) + rounds_storage = _resolve_contract( + self, + address_manager, + "RoundsStorage", + ROUNDS_STORAGE_READ_ABI, + block_number, + ) + + tx_data = _call_at_block( + big_rounds.functions.getStoredTransactionDataLight(transaction_hash), + block_number, + ) + last_round = tx_data[21] + round_number = last_round[0] + validators_count = last_round[7] + validators = _read_round_validators( + big_rounds, + transaction_hash, + round_number, + validators_count, + block_number, + ) + consumed_validators = _read_consumed_validators( + big_rounds, + transaction_hash, + tx_data[22], + block_number, + ) + validator_votes = _call_at_block( + rounds_storage.functions.getValidatorVotes(transaction_hash, round_number), + block_number, + ) + validator_votes_hash = _call_at_block( + rounds_storage.functions.getValidatorVotesHash(transaction_hash, round_number), + block_number, + ) + validator_result_hash = _call_at_block( + rounds_storage.functions.getValidatorResultHash(transaction_hash, round_number), + block_number, + ) + tx_execution_result = _call_at_block( + transaction_manager.functions.getTxExecutionResult(transaction_hash), + block_number, + ) + num_of_initial_validators = _call_at_block( + transaction_manager.functions.getNumOfInitialValidators(transaction_hash), + block_number, + ) + + for label, values in ( + ("validator votes", validator_votes), + ("validator vote hashes", validator_votes_hash), + ("validator result hashes", validator_result_hash), + ): + if len(values) != validators_count: + raise GenLayerError( + f"Incomplete {label} at fixed block {block_number}: " + f"expected {validators_count}, got {len(values)}" + ) + + return ( + tx_data, + validators, + validator_votes, + validator_votes_hash, + validator_result_hash, + consumed_validators, + tx_execution_result, + num_of_initial_validators, + ) + + +def _read_transaction_lifecycle( + consensus_data_contract, + transaction_hash: _Hash32, + block_number: int, + timestamp: int = 0, +) -> ProtocolTransactionLifecycle: + lifecycle = _call_at_block( + consensus_data_contract.functions.getTransactionLifecycle( + transaction_hash, timestamp + ), + block_number, + ) + stored_status, resolution, latest_decision, decision_active = lifecycle + projected_status = resolution[2] + resolution_action = resolution[3] + resolution_source = resolution[6] + return { + "stored_status": int(stored_status), + "stored_status_name": PROTOCOL_TRANSACTION_STATUS_NUMBER_TO_NAME[ + str(stored_status) + ], + "projected_status": int(projected_status), + "projected_status_name": PROTOCOL_TRANSACTION_STATUS_NUMBER_TO_NAME[ + str(projected_status) + ], + "resolution_action": int(resolution_action), + "resolution_action_name": RESOLUTION_ACTION_NUMBER_TO_NAME[ + str(resolution_action) + ], + "resolution_source": int(resolution_source), + "resolution_source_name": RESOLUTION_SOURCE_NUMBER_TO_NAME[ + str(resolution_source) + ], + "decision_id": str(latest_decision[1]) if decision_active else None, + "decision_active": bool(decision_active), + "evaluated_at": int(resolution[17]), + } + + +def _decode_rpc_transaction_lifecycle(result: Any) -> ProtocolTransactionLifecycle: + if not isinstance(result, dict): + raise GenLayerError("gen_getTransactionLifecycle returned no lifecycle object") + + def code(key: str) -> int: + value = result.get(key) + if isinstance(value, bool) or not isinstance(value, int): + raise GenLayerError( + f"gen_getTransactionLifecycle returned invalid {key}: {value!r}" + ) + return value + + stored_status = code("storedStatusCode") + projected_status = code("projectedStatusCode") + resolution_action = code("resolutionActionCode") + resolution_source = code("resolutionSourceCode") + try: + stored_status_name = PROTOCOL_TRANSACTION_STATUS_NUMBER_TO_NAME[ + str(stored_status) + ] + projected_status_name = PROTOCOL_TRANSACTION_STATUS_NUMBER_TO_NAME[ + str(projected_status) + ] + resolution_action_name = RESOLUTION_ACTION_NUMBER_TO_NAME[ + str(resolution_action) + ] + resolution_source_name = RESOLUTION_SOURCE_NUMBER_TO_NAME[ + str(resolution_source) + ] + except KeyError as exc: + raise GenLayerError( + f"gen_getTransactionLifecycle returned unknown protocol ordinal: {exc.args[0]}" + ) from exc + + wire_names = { + "storedStatus": stored_status_name.value, + "projectedStatus": projected_status_name.value, + "resolutionAction": resolution_action_name.value, + "resolutionSource": resolution_source_name.value, + } + for key, enum_value in wire_names.items(): + expected = enum_value + if result.get(key) != expected: + raise GenLayerError( + f"gen_getTransactionLifecycle returned inconsistent {key}: " + f"expected {expected!r}, got {result.get(key)!r}" + ) + + decision_active = result.get("decisionActive") + if not isinstance(decision_active, bool): + raise GenLayerError( + "gen_getTransactionLifecycle returned invalid decisionActive" + ) + decision_id = result.get("decisionId") + if decision_id is not None and ( + not isinstance(decision_id, str) or not decision_id.isdigit() + ): + raise GenLayerError("gen_getTransactionLifecycle returned invalid decisionId") + if decision_active != (decision_id is not None): + raise GenLayerError( + "gen_getTransactionLifecycle returned inconsistent decision identity" + ) + evaluated_at = result.get("evaluatedAt") + if isinstance(evaluated_at, bool) or not isinstance(evaluated_at, int): + raise GenLayerError("gen_getTransactionLifecycle returned invalid evaluatedAt") + + return { + "stored_status": stored_status, + "stored_status_name": stored_status_name, + "projected_status": projected_status, + "projected_status_name": projected_status_name, + "resolution_action": resolution_action, + "resolution_action_name": resolution_action_name, + "resolution_source": resolution_source, + "resolution_source_name": resolution_source_name, + "decision_id": decision_id, + "decision_active": decision_active, + "evaluated_at": evaluated_at, + } + + +_METHOD_NOT_FOUND_CODE = -32601 +_METHOD_NOT_FOUND_MESSAGES = ( + "method not found", + "does not exist", + "method not supported", +) + + +def _is_method_not_found_error(error: Any) -> bool: + """Recognize only an explicit JSON-RPC missing-method response.""" + seen = set() + current = error + while current is not None and id(current) not in seen: + seen.add(id(current)) + if isinstance(current, dict): + code = current.get("code") + message = current.get("message") + current = current.get("error") or current.get("cause") + else: + code = getattr(current, "code", None) + message = getattr(current, "message", None) or str(current) + current = getattr(current, "__cause__", None) + if code == _METHOD_NOT_FOUND_CODE: + return True + if isinstance(message, str) and any( + marker in message.lower() for marker in _METHOD_NOT_FOUND_MESSAGES + ): + return True + return False + + +def _studio_protocol_status(value: Any) -> ProtocolTransactionStatus: + """Normalize the stored status exposed by the current Studio transaction.""" + if value == "ACTIVATED": + return ProtocolTransactionStatus.PENDING + if isinstance(value, ProtocolTransactionStatus): + return value + if isinstance(value, int) or (isinstance(value, str) and value.isdigit()): + return PROTOCOL_TRANSACTION_STATUS_NUMBER_TO_NAME[str(value)] + if isinstance(value, str) and value in ProtocolTransactionStatus.__members__: + return ProtocolTransactionStatus[value] + return ProtocolTransactionStatus(value) + + +def _studio_transaction_lifecycle_fallback( + self: GenLayerClient, + transaction_hash: _Hash32, + timestamp: Optional[int], + cause: Any, +) -> ProtocolTransactionLifecycle: + """Expose only the lifecycle facts current Studio can prove.""" + try: + response = self.provider.make_request( + method="eth_getTransactionByHash", params=[transaction_hash] + ) + transaction = response.get("result") if isinstance(response, dict) else None + if not isinstance(transaction, dict): + raise ValueError("missing transaction") + status_name = _studio_protocol_status(transaction.get("status")) + status_code = int(PROTOCOL_TRANSACTION_STATUS_NAME_TO_NUMBER[status_name]) + except Exception as exc: + if isinstance(cause, BaseException): + raise cause + raise GenLayerError( + "gen_getTransactionLifecycle is unavailable and Studio did not return " + "a readable stored transaction status" + ) from exc + + return { + "stored_status": status_code, + "stored_status_name": status_name, + "projected_status": status_code, + "projected_status_name": status_name, + "resolution_action": 0, + "resolution_action_name": RESOLUTION_ACTION_NUMBER_TO_NAME["0"], + "resolution_source": 0, + "resolution_source_name": RESOLUTION_SOURCE_NUMBER_TO_NAME["0"], + "decision_id": None, + "decision_active": False, + "evaluated_at": timestamp if timestamp is not None else int(time.time()), + } + + +def get_transaction_lifecycle( + self: GenLayerClient, + transaction_hash: _Hash32, + timestamp: Optional[int] = None, +) -> ProtocolTransactionLifecycle: + """Return the raw stored/projected resolution-kernel view. + + This is an advanced protocol API. Ordinary consumers should use the + discriminated ``lifecycle`` returned by :func:`get_transaction`. + """ + + if self.chain.id == localnet.id: + tx_id = ( + Web3.to_hex(transaction_hash) + if isinstance(transaction_hash, bytes) + else transaction_hash + ) + params: Dict[str, Any] = {"txId": tx_id} + if timestamp is not None: + params["timestamp"] = timestamp + try: + response = self.provider.make_request( + method="gen_getTransactionLifecycle", params=[params] + ) + except Exception as exc: + if _is_method_not_found_error(exc): + return _studio_transaction_lifecycle_fallback( + self, tx_id, timestamp, exc + ) + raise + error = response.get("error") if isinstance(response, dict) else None + if error is not None: + if _is_method_not_found_error(error): + return _studio_transaction_lifecycle_fallback( + self, tx_id, timestamp, error + ) + raise GenLayerError(f"gen_getTransactionLifecycle failed: {error}") + return _decode_rpc_transaction_lifecycle(response.get("result")) + + consensus_data_contract = self.w3.eth.contract( + address=self.chain.consensus_data_contract["address"], + abi=self.chain.consensus_data_contract["abi"], + ) + block_number = self.w3.eth.block_number + return _read_transaction_lifecycle( + consensus_data_contract, + transaction_hash, + block_number, + timestamp if timestamp is not None else 0, + ) + + def get_transaction( self: GenLayerClient, transaction_hash: _Hash32, @@ -219,27 +687,54 @@ def get_transaction( transaction = self.provider.make_request( method="eth_getTransactionByHash", params=[transaction_hash] )["result"] - localnet_status = ( - TransactionStatus.PENDING + protocol_status = ( + ProtocolTransactionStatus.PENDING if transaction["status"] == "ACTIVATED" else transaction["status"] ) - transaction["status"] = int(TRANSACTION_STATUS_NAME_TO_NUMBER[localnet_status]) - transaction["status_name"] = localnet_status + lifecycle = transaction_lifecycle_from_protocol_status(protocol_status) + if lifecycle["state"] == "finalized": + outcome = transaction_outcome_from_protocol_result( + transaction.get("result_name", transaction.get("result", 0)) + ) + if outcome is not None: + lifecycle["outcome"] = outcome + transaction["lifecycle"] = lifecycle + transaction.pop("status", None) + transaction.pop("status_name", None) return _decode_localnet_transaction(transaction) - # Decode for testnet — call both to get messages + txExecutionResult + # Decode one fixed-block train snapshot. The light record and split array + # reads avoid the oversized aggregate getTransactionAllData response. consensus_data_contract = self.w3.eth.contract( address=self.chain.consensus_data_contract["address"], abi=self.chain.consensus_data_contract["abi"], ) - tx_data = consensus_data_contract.functions.getTransactionData( - transaction_hash, int(time.time()) - ).call() - tx_all_data, rounds_data = consensus_data_contract.functions.getTransactionAllData( - transaction_hash - ).call() - raw_transaction = GenLayerRawTransaction.from_transaction_data(tx_data) - raw_transaction.tx_execution_result = tx_all_data[1] + block_number = self.w3.eth.block_number + ( + tx_data, + validators, + validator_votes, + validator_votes_hash, + validator_result_hash, + consumed_validators, + tx_execution_result, + num_of_initial_validators, + ) = _read_train_transaction_data( + self, + consensus_data_contract, + transaction_hash, + block_number, + ) + raw_transaction = GenLayerRawTransaction.from_transaction_data_light( + tx_data, + validators, + validator_votes, + validator_votes_hash, + validator_result_hash, + consumed_validators, + tx_execution_result, + num_of_initial_validators, + ) decoded_transaction = raw_transaction.decode() decoded_transaction["triggered_transactions"] = _decode_triggered_txs( self, decoded_transaction @@ -250,20 +745,20 @@ def get_transaction( def _decode_triggered_txs( self: GenLayerClient, tx: GenLayerTransaction ) -> List[HexStr]: - status = TRANSACTION_STATUS_NUMBER_TO_NAME[tx["status"]] - if status not in [TransactionStatus.FINALIZED, TransactionStatus.ACCEPTED]: + lifecycle = tx["lifecycle"] + state = lifecycle["state"] + accepted = state == "decided" and lifecycle.get("outcome") == "accepted" + if not accepted and state != "finalized": return [] event_hashes_by_status = { - TransactionStatus.FINALIZED: self.w3.keccak( - text="TransactionFinalized(bytes32)" - ).hex(), - TransactionStatus.ACCEPTED: self.w3.keccak( - text="TransactionAccepted(bytes32)" - ).hex(), + "finalized": self.w3.keccak(text="TransactionFinalized(bytes32)").hex(), + "accepted": self.w3.keccak(text="TransactionAccepted(bytes32)").hex(), } - def process_events_for_status(event_status: TransactionStatus) -> List[HexStr]: + def process_events_for_status( + event_status: Literal["accepted", "finalized"], + ) -> List[HexStr]: """Helper function to process events for a given status.""" event_signature_hash = event_hashes_by_status[event_status] from_block = int(tx["read_state_block_range"]["proposal_block"]) @@ -295,11 +790,11 @@ def process_events_for_status(event_status: TransactionStatus) -> List[HexStr]: triggered_txs = [] # Triggered transactions can happen on ACCEPTED or FINALIZED statuses - if status in [TransactionStatus.ACCEPTED, TransactionStatus.FINALIZED]: - triggered_txs.extend(process_events_for_status(TransactionStatus.ACCEPTED)) + if accepted or state == "finalized": + triggered_txs.extend(process_events_for_status("accepted")) - if status == TransactionStatus.FINALIZED: - triggered_txs.extend(process_events_for_status(TransactionStatus.FINALIZED)) + if state == "finalized": + triggered_txs.extend(process_events_for_status("finalized")) return triggered_txs @@ -323,7 +818,16 @@ def debug_trace_transaction( ) -> Dict[str, Any]: response = self.provider.make_request( method="gen_dbg_traceTransaction", - params=[{"txID": Web3.to_hex(transaction_hash) if isinstance(transaction_hash, bytes) else transaction_hash, "round": round}], + params=[ + { + "txID": ( + Web3.to_hex(transaction_hash) + if isinstance(transaction_hash, bytes) + else transaction_hash + ), + "round": round, + } + ], ) return response.get("result", {}) @@ -333,7 +837,7 @@ def _simplify_transaction_receipt(tx: GenLayerTransaction) -> GenLayerTransactio Simplify transaction receipt by removing non-essential fields while preserving functionality. Removes: Binary data, internal timestamps, appeal fields, processing details, historical data - Preserves: Transaction IDs, status, execution results, node configs, readable data + Preserves: Transaction IDs, lifecycle, execution results, node configs, readable data """ simplified_tx = tx.copy() diff --git a/genlayer_py/transactions/fees.py b/genlayer_py/transactions/fees.py index 5780aad..59037c9 100644 --- a/genlayer_py/transactions/fees.py +++ b/genlayer_py/transactions/fees.py @@ -1081,6 +1081,7 @@ def build_estimated_fees_options_from_simulation( def build_estimated_fees_distribution( options: Optional[FeeEstimateOptions], policy: FeePolicyQuote, + default_consensus_max_rotations: BigNumberish, ) -> FeesDistribution: headroom_bps = to_uint( _get(options, "priceCapHeadroomBps", "price_cap_headroom_bps"), @@ -1119,6 +1120,17 @@ def build_estimated_fees_distribution( if emits_messages else base_execution_budget_default ) + appeal_rounds = to_uint( + _get(options, "appealRounds", "appeal_rounds"), + "appealRounds", + ) + rotations = _get(options, "rotations") + if rotations is None: + default_rotations = to_uint( + default_consensus_max_rotations, + "defaultConsensusMaxRotations", + ) + rotations = [default_rotations] * (appeal_rounds + 1) return create_fees_distribution( { @@ -1138,7 +1150,7 @@ def build_estimated_fees_distribution( if policy["enabled"] else 0, ), - "appealRounds": _get(options, "appealRounds", "appeal_rounds"), + "appealRounds": appeal_rounds, "executionBudgetPerRound": _get( options, "executionBudgetPerRound", @@ -1151,7 +1163,7 @@ def build_estimated_fees_distribution( "execution_consumed", ), "totalMessageFees": total_message_fees, - "rotations": _get(options, "rotations"), + "rotations": rotations, "maxPriceGenPerTimeUnit": _get( options, "maxPriceGenPerTimeUnit", diff --git a/genlayer_py/types/__init__.py b/genlayer_py/types/__init__.py index 04e4a64..f7021f9 100644 --- a/genlayer_py/types/__init__.py +++ b/genlayer_py/types/__init__.py @@ -2,18 +2,27 @@ from .transactions import ( GenLayerTransaction, GenLayerRawTransaction, - TransactionStatus, + TransactionLifecycle, + TransactionProcessingPhase, + TransactionDecisionOutcome, + ProcessingTransactionLifecycle, + DecidedTransactionLifecycle, + FinalizedTransactionLifecycle, + CanceledTransactionLifecycle, TransactionHashVariant, TRANSACTION_RESULT_NAME_TO_NUMBER, TRANSACTION_RESULT_NUMBER_TO_NAME, ExecutionResult, + VoteType, EXECUTION_RESULT_NUMBER_TO_NAME, - TRANSACTION_STATUS_NAME_TO_NUMBER, - TRANSACTION_STATUS_NUMBER_TO_NAME, VOTE_TYPE_NAME_TO_NUMBER, VOTE_TYPE_NUMBER_TO_NAME, - DECIDED_STATES, - is_decided_state, ) -from .chain import Chain, NativeCurrency, ContractInfo, SimpleContractInfo, GenLayerChain +from .chain import ( + Chain, + NativeCurrency, + ContractInfo, + SimpleContractInfo, + GenLayerChain, +) from .contracts import ContractSchema, SimConfig diff --git a/genlayer_py/types/transactions.py b/genlayer_py/types/transactions.py index 43623cc..01e489f 100644 --- a/genlayer_py/types/transactions.py +++ b/genlayer_py/types/transactions.py @@ -3,7 +3,17 @@ import base64 from genlayer_py.abi import calldata from enum import Enum -from typing import Dict, Optional, Any, TypedDict, List, Tuple, Literal, Union +from typing import ( + Dict, + Optional, + Any, + TypedDict, + List, + Tuple, + Literal, + Union, + NotRequired, +) from eth_typing import Address, HexStr from web3 import Web3 from dataclasses import dataclass @@ -11,76 +21,215 @@ from genlayer_py.consensus.consensus_main import decode_tx_data -class TransactionStatus(str, Enum): - """Status of a GenLayer transaction in the consensus lifecycle.""" - UNINITIALIZED = "UNINITIALIZED" - PENDING = "PENDING" - PROPOSING = "PROPOSING" - COMMITTING = "COMMITTING" - REVEALING = "REVEALING" - ACCEPTED = "ACCEPTED" - UNDETERMINED = "UNDETERMINED" - FINALIZED = "FINALIZED" - CANCELED = "CANCELED" - APPEAL_REVEALING = "APPEAL_REVEALING" - APPEAL_COMMITTING = "APPEAL_COMMITTING" - READY_TO_FINALIZE = "READY_TO_FINALIZE" - VALIDATORS_TIMEOUT = "VALIDATORS_TIMEOUT" - LEADER_TIMEOUT = "LEADER_TIMEOUT" - LEADER_REVEALING = "LEADER_REVEALING" - - -TRANSACTION_STATUS_NUMBER_TO_NAME = { - "0": TransactionStatus.UNINITIALIZED, - "1": TransactionStatus.PENDING, - "2": TransactionStatus.PROPOSING, - "3": TransactionStatus.COMMITTING, - "4": TransactionStatus.REVEALING, - "5": TransactionStatus.ACCEPTED, - "6": TransactionStatus.UNDETERMINED, - "7": TransactionStatus.FINALIZED, - "8": TransactionStatus.CANCELED, - "9": TransactionStatus.APPEAL_REVEALING, - "10": TransactionStatus.APPEAL_COMMITTING, - "11": TransactionStatus.READY_TO_FINALIZE, - "12": TransactionStatus.VALIDATORS_TIMEOUT, - "13": TransactionStatus.LEADER_TIMEOUT, - "14": TransactionStatus.LEADER_REVEALING, +class ProtocolTransactionStatus(str, Enum): + """Raw transaction status stored by the consensus contracts. + + This protocol enum is intentionally advanced API. Consumer-facing + transactions expose a small ``lifecycle`` value discriminated by ``state`` + instead. + """ + + UNINITIALIZED = "Uninitialized" + PENDING = "Pending" + PROPOSING = "Proposing" + COMMITTING = "Committing" + REVEALING = "Revealing" + ACCEPTED = "Accepted" + UNDETERMINED = "Undetermined" + FINALIZED = "Finalized" + CANCELED = "Canceled" + APPEAL_REVEALING = "AppealRevealing" + APPEAL_COMMITTING = "AppealCommitting" + VALIDATORS_TIMEOUT = "ValidatorsTimeout" + LEADER_TIMEOUT = "LeaderTimeout" + LEADER_REVEALING = "LeaderRevealing" + + +class ResolutionAction(str, Enum): + """Action projected by the transaction lifecycle resolution kernel.""" + + NO_OP = "NoOp" + CANCEL = "Cancel" + REPLACE_ACTOR = "ReplaceActor" + ROTATE_LEADER = "RotateLeader" + RESOLVE_APPEAL = "ResolveAppeal" + MATERIALIZE_DECISION = "MaterializeDecision" + FINALIZE = "Finalize" + + +class ResolutionSource(str, Enum): + """Protocol trigger that produced a transaction resolution plan.""" + + UNSPECIFIED = "Unspecified" + ACTIVATION_INSUFFICIENT_VALIDATORS = "ActivationInsufficientValidators" + PROPOSAL_HANGING = "ProposalHanging" + LEADER_RECEIPT_TIMEOUT = "LeaderReceiptTimeout" + COMMIT_HANGING = "CommitHanging" + LEADER_REVEAL_HANGING = "LeaderRevealHanging" + FULL_REVEAL = "FullReveal" + REVEAL_DEADLINE = "RevealDeadline" + APPEAL_COMMIT_HANGING = "AppealCommitHanging" + APPEAL_FULL_REVEAL = "AppealFullReveal" + APPEAL_REVEAL_DEADLINE = "AppealRevealDeadline" + SELECTION_DEPLETED = "SelectionDepleted" + + +RESOLUTION_ACTION_NUMBER_TO_NAME = { + "0": ResolutionAction.NO_OP, + "1": ResolutionAction.CANCEL, + "2": ResolutionAction.REPLACE_ACTOR, + "3": ResolutionAction.ROTATE_LEADER, + "4": ResolutionAction.RESOLVE_APPEAL, + "5": ResolutionAction.MATERIALIZE_DECISION, + "6": ResolutionAction.FINALIZE, } -TRANSACTION_STATUS_NAME_TO_NUMBER = { - TransactionStatus.UNINITIALIZED: "0", - TransactionStatus.PENDING: "1", - TransactionStatus.PROPOSING: "2", - TransactionStatus.COMMITTING: "3", - TransactionStatus.REVEALING: "4", - TransactionStatus.ACCEPTED: "5", - TransactionStatus.UNDETERMINED: "6", - TransactionStatus.FINALIZED: "7", - TransactionStatus.CANCELED: "8", - TransactionStatus.APPEAL_REVEALING: "9", - TransactionStatus.APPEAL_COMMITTING: "10", - TransactionStatus.READY_TO_FINALIZE: "11", - TransactionStatus.VALIDATORS_TIMEOUT: "12", - TransactionStatus.LEADER_TIMEOUT: "13", - TransactionStatus.LEADER_REVEALING: "14", +RESOLUTION_SOURCE_NUMBER_TO_NAME = { + str(number): source for number, source in enumerate(ResolutionSource) } -DECIDED_STATES = [ - TransactionStatus.ACCEPTED, - TransactionStatus.UNDETERMINED, - TransactionStatus.LEADER_TIMEOUT, - TransactionStatus.VALIDATORS_TIMEOUT, - TransactionStatus.CANCELED, - TransactionStatus.FINALIZED + +TransactionProcessingPhase = Literal[ + "uninitialized", + "pending", + "proposing", + "committing", + "revealing", + "appeal_revealing", + "appeal_committing", + "leader_revealing", +] +TransactionDecisionOutcome = Literal[ + "accepted", "undetermined", "validators_timeout", "leader_timeout" ] -def is_decided_state(status: str) -> bool: - return status in [TRANSACTION_STATUS_NAME_TO_NUMBER[state] for state in DECIDED_STATES] + +class ProcessingTransactionLifecycle(TypedDict): + state: Literal["processing"] + phase: TransactionProcessingPhase + + +class DecidedTransactionLifecycle(TypedDict): + state: Literal["decided"] + outcome: TransactionDecisionOutcome + + +class FinalizedTransactionLifecycle(TypedDict): + state: Literal["finalized"] + outcome: NotRequired[TransactionDecisionOutcome] + + +class CanceledTransactionLifecycle(TypedDict): + state: Literal["canceled"] + + +TransactionLifecycle = Union[ + ProcessingTransactionLifecycle, + DecidedTransactionLifecycle, + FinalizedTransactionLifecycle, + CanceledTransactionLifecycle, +] + + +class ProtocolTransactionLifecycle(TypedDict): + """Advanced resolution-kernel view for one fixed block snapshot.""" + + stored_status: int + stored_status_name: ProtocolTransactionStatus + projected_status: int + projected_status_name: ProtocolTransactionStatus + resolution_action: int + resolution_action_name: ResolutionAction + resolution_source: int + resolution_source_name: ResolutionSource + decision_id: Optional[str] + decision_active: bool + evaluated_at: int + + +# Current train protocol ordinals. Finalization readiness is a resolution +# verdict, not a stored or projected transaction status. +PROTOCOL_TRANSACTION_STATUS_NUMBER_TO_NAME = { + "0": ProtocolTransactionStatus.UNINITIALIZED, + "1": ProtocolTransactionStatus.PENDING, + "2": ProtocolTransactionStatus.PROPOSING, + "3": ProtocolTransactionStatus.COMMITTING, + "4": ProtocolTransactionStatus.REVEALING, + "5": ProtocolTransactionStatus.ACCEPTED, + "6": ProtocolTransactionStatus.UNDETERMINED, + "7": ProtocolTransactionStatus.FINALIZED, + "8": ProtocolTransactionStatus.CANCELED, + "9": ProtocolTransactionStatus.APPEAL_REVEALING, + "10": ProtocolTransactionStatus.APPEAL_COMMITTING, + "11": ProtocolTransactionStatus.VALIDATORS_TIMEOUT, + "12": ProtocolTransactionStatus.LEADER_TIMEOUT, + "13": ProtocolTransactionStatus.LEADER_REVEALING, +} + +PROTOCOL_TRANSACTION_STATUS_NAME_TO_NUMBER = { + status: str(number) for number, status in enumerate(ProtocolTransactionStatus) +} + +_PROCESSING_PHASE_BY_PROTOCOL_STATUS: Dict[ + ProtocolTransactionStatus, TransactionProcessingPhase +] = { + ProtocolTransactionStatus.UNINITIALIZED: "uninitialized", + ProtocolTransactionStatus.PENDING: "pending", + ProtocolTransactionStatus.PROPOSING: "proposing", + ProtocolTransactionStatus.COMMITTING: "committing", + ProtocolTransactionStatus.REVEALING: "revealing", + ProtocolTransactionStatus.APPEAL_REVEALING: "appeal_revealing", + ProtocolTransactionStatus.APPEAL_COMMITTING: "appeal_committing", + ProtocolTransactionStatus.LEADER_REVEALING: "leader_revealing", +} + + +def transaction_lifecycle_from_protocol_status( + status: Union[int, str, ProtocolTransactionStatus], +) -> TransactionLifecycle: + """Map every stored protocol status to the stable consumer lifecycle.""" + + if isinstance(status, ProtocolTransactionStatus): + protocol_status = status + elif isinstance(status, int) or (isinstance(status, str) and status.isdigit()): + try: + protocol_status = PROTOCOL_TRANSACTION_STATUS_NUMBER_TO_NAME[str(status)] + except KeyError as exc: + raise ValueError(f"Unknown protocol transaction status: {status}") from exc + else: + try: + status_text = str(status) + protocol_status = ( + ProtocolTransactionStatus[status_text] + if status_text in ProtocolTransactionStatus.__members__ + else ProtocolTransactionStatus(status_text) + ) + except ValueError as exc: + raise ValueError(f"Unknown protocol transaction status: {status}") from exc + + if protocol_status in _PROCESSING_PHASE_BY_PROTOCOL_STATUS: + return { + "state": "processing", + "phase": _PROCESSING_PHASE_BY_PROTOCOL_STATUS[protocol_status], + } + if protocol_status == ProtocolTransactionStatus.ACCEPTED: + return {"state": "decided", "outcome": "accepted"} + if protocol_status == ProtocolTransactionStatus.UNDETERMINED: + return {"state": "decided", "outcome": "undetermined"} + if protocol_status == ProtocolTransactionStatus.VALIDATORS_TIMEOUT: + return {"state": "decided", "outcome": "validators_timeout"} + if protocol_status == ProtocolTransactionStatus.LEADER_TIMEOUT: + return {"state": "decided", "outcome": "leader_timeout"} + if protocol_status == ProtocolTransactionStatus.FINALIZED: + return {"state": "finalized"} + if protocol_status == ProtocolTransactionStatus.CANCELED: + return {"state": "canceled"} + raise AssertionError(f"Unmapped protocol transaction status: {protocol_status}") class TransactionResult(str, Enum): """Consensus voting result across validators.""" + IDLE = "IDLE" AGREE = "AGREE" DISAGREE = "DISAGREE" @@ -112,13 +261,43 @@ class TransactionResult(str, Enum): } +def transaction_outcome_from_protocol_result( + result: Union[int, str, TransactionResult], +) -> Optional[TransactionDecisionOutcome]: + """Return an application outcome when a finalized record preserves one.""" + + if isinstance(result, TransactionResult): + result_name = result + elif isinstance(result, int) or (isinstance(result, str) and result.isdigit()): + result_name = TRANSACTION_RESULT_NUMBER_TO_NAME.get(str(result)) + else: + try: + result_name = TransactionResult(str(result)) + except ValueError: + result_name = None + + if result_name == TransactionResult.MAJORITY_AGREE: + return "accepted" + if result_name == TransactionResult.MAJORITY_TIMEOUT: + return "validators_timeout" + if result_name in ( + TransactionResult.MAJORITY_DISAGREE, + TransactionResult.DETERMINISTIC_VIOLATION, + TransactionResult.NO_MAJORITY, + ): + return "undetermined" + return None + + class ExecutionResult(str, Enum): """Result of contract execution by the GenVM.""" + NOT_VOTED = "NOT_VOTED" FINISHED_WITH_RETURN = "FINISHED_WITH_RETURN" FINISHED_WITH_ERROR = "FINISHED_WITH_ERROR" TIMEOUT = "TIMEOUT" NONDET_DISAGREE = "NONDET_DISAGREE" + DETERMINISTIC_VIOLATION = "DETERMINISTIC_VIOLATION" EXECUTION_RESULT_NUMBER_TO_NAME = { @@ -127,31 +306,37 @@ class ExecutionResult(str, Enum): "2": ExecutionResult.FINISHED_WITH_ERROR, "3": ExecutionResult.TIMEOUT, "4": ExecutionResult.NONDET_DISAGREE, + "5": ExecutionResult.DETERMINISTIC_VIOLATION, } class VoteType(str, Enum): + """Validator execution vote recorded for a consensus round.""" + NOT_VOTED = "NOT_VOTED" - AGREE = "AGREE" - DISAGREE = "DISAGREE" + FINISHED_WITH_RETURN = "FINISHED_WITH_RETURN" + FINISHED_WITH_ERROR = "FINISHED_WITH_ERROR" TIMEOUT = "TIMEOUT" + NONDET_DISAGREE = "NONDET_DISAGREE" DETERMINISTIC_VIOLATION = "DETERMINISTIC_VIOLATION" VOTE_TYPE_NUMBER_TO_NAME = { "0": VoteType.NOT_VOTED, - "1": VoteType.AGREE, - "2": VoteType.DISAGREE, + "1": VoteType.FINISHED_WITH_RETURN, + "2": VoteType.FINISHED_WITH_ERROR, "3": VoteType.TIMEOUT, - "4": VoteType.DETERMINISTIC_VIOLATION, + "4": VoteType.NONDET_DISAGREE, + "5": VoteType.DETERMINISTIC_VIOLATION, } VOTE_TYPE_NAME_TO_NUMBER = { VoteType.NOT_VOTED: "0", - VoteType.AGREE: "1", - VoteType.DISAGREE: "2", + VoteType.FINISHED_WITH_RETURN: "1", + VoteType.FINISHED_WITH_ERROR: "2", VoteType.TIMEOUT: "3", - VoteType.DETERMINISTIC_VIOLATION: "4", + VoteType.NONDET_DISAGREE: "4", + VoteType.DETERMINISTIC_VIOLATION: "5", } @@ -179,6 +364,7 @@ class DecodedCallData(TypedDict, total=False): class GenLayerTransaction(TypedDict, total=False): """Decoded transaction data returned by get_transaction and wait_for_transaction_receipt.""" + # currentTimestamp: testnet current_timestamp: Optional[str] @@ -192,6 +378,7 @@ class GenLayerTransaction(TypedDict, total=False): # numOfInitialValidators: testnet num_of_initial_validators: Optional[str] + initial_rotations: Optional[str] # txSlot: testnet tx_slot: Optional[str] @@ -218,12 +405,17 @@ class GenLayerTransaction(TypedDict, total=False): tx_data: Optional[HexStr] tx_data_decoded: Optional[Dict[str, Any]] - # txReceipt: testnet + # The train stores only the execution hash. `tx_receipt` remains present so + # callers can distinguish unavailable legacy bytes (`None`) explicitly. + tx_execution_hash: Optional[HexStr] tx_receipt: Optional[HexStr] # messages: testnet messages: Optional[List[Any]] + # consumedValidators: testnet + consumed_validators: Optional[List[Address]] + # queueType: testnet queue_type: Optional[int] @@ -236,9 +428,9 @@ class GenLayerTransaction(TypedDict, total=False): # lastLeader: testnet last_leader: Optional[Address] - # status: localnet: TransactionStatus // status: testnet: number - status: Optional[TransactionStatus] - status_name: Optional[TransactionStatus] + # Stable consumer lifecycle. Raw protocol values are returned only by + # GenLayerClient.get_transaction_lifecycle(). + lifecycle: TransactionLifecycle # hash: localnet // txId: testnet// hash: localnet // txId: testnet hash: Optional[HexStr] @@ -301,11 +493,17 @@ class LastRound: result: int round_validators: List[Address] validator_votes_hash: List[HexStr] + validator_result_hash: List[HexStr] validator_votes: List[int] @classmethod - def from_transaction_data( - cls, tx_data: Tuple + def from_light_data( + cls, + tx_data: Tuple, + round_validators: List[Address], + validator_votes: List[int], + validator_votes_hash: List[HexStr], + validator_result_hash: List[HexStr], ) -> "GenLayerRawTransaction.LastRound": return cls( round=tx_data[0], @@ -315,29 +513,13 @@ def from_transaction_data( appeal_bond=tx_data[4], rotations_left=tx_data[5], result=tx_data[6], - round_validators=tx_data[7], - validator_votes=tx_data[8], + round_validators=round_validators, + validator_votes=validator_votes, validator_votes_hash=[ - Web3.to_hex(vote_hash) for vote_hash in tx_data[9] + Web3.to_hex(vote_hash) for vote_hash in validator_votes_hash ], - ) - - @classmethod - def from_all_data_round( - cls, tx_data: Tuple - ) -> "GenLayerRawTransaction.LastRound": - return cls( - round=tx_data[0], - leader_index=tx_data[1], - votes_committed=tx_data[2], - votes_revealed=tx_data[3], - appeal_bond=tx_data[4], - rotations_left=tx_data[5], - result=tx_data[6], - round_validators=tx_data[7], - validator_votes=tx_data[8], - validator_votes_hash=[ - Web3.to_hex(vote_hash) for vote_hash in tx_data[9] + validator_result_hash=[ + Web3.to_hex(result_hash) for result_hash in validator_result_hash ], ) @@ -352,6 +534,7 @@ def decode(self) -> Dict[str, Any]: "result": str(self.result), "round_validators": self.round_validators, "validator_votes_hash": self.validator_votes_hash, + "validator_result_hash": self.validator_result_hash, "validator_votes": self.validator_votes, "validator_votes_name": [ VOTE_TYPE_NUMBER_TO_NAME[str(vote)].value @@ -363,6 +546,7 @@ def decode(self) -> Dict[str, Any]: sender: Address recipient: Address num_of_initial_validators: int + initial_rotations: int tx_slot: int created_timestamp: int last_vote_timestamp: int @@ -370,8 +554,10 @@ def decode(self) -> Dict[str, Any]: result: int tx_execution_result: int tx_data: HexStr - tx_receipt: HexStr + tx_execution_hash: HexStr + tx_receipt: Optional[HexStr] messages: List[Any] + consumed_validators: List[Address] queue_type: int queue_position: int activator: Address @@ -383,65 +569,35 @@ def decode(self) -> Dict[str, Any]: last_round: LastRound @classmethod - def from_transaction_data(cls, tx_data: Tuple) -> "GenLayerRawTransaction": - # V06/Bradbury ABI returns 23 fields (extra txExecutionHash, eqBlocksOutputs, - # consumedValidators; txData split into txCalldata). Asimov returns 21 fields. - if len(tx_data) >= 23: - return cls._from_v06(tx_data) - return cls._from_v04(tx_data) - - @classmethod - def _from_v04(cls, tx_data: Tuple) -> "GenLayerRawTransaction": - """Asimov / pre-Bradbury ABI (21 fields).""" - return cls( - current_timestamp=tx_data[0], - sender=tx_data[1], - recipient=tx_data[2], - num_of_initial_validators=tx_data[3], - tx_slot=tx_data[4], - created_timestamp=tx_data[5], - last_vote_timestamp=tx_data[6], - random_seed=Web3.to_hex(tx_data[7]), - result=tx_data[8], - tx_execution_result=0, - tx_data=Web3.to_hex(tx_data[9]), - tx_receipt=Web3.to_hex(tx_data[10]), - messages=tx_data[11], - queue_type=tx_data[12], - queue_position=tx_data[13], - activator=tx_data[14], - last_leader=tx_data[15], - status=tx_data[16], - tx_id=Web3.to_hex(tx_data[17]), - read_state_block_range=cls.ReadStateBlockRange.from_transaction_data( - tx_data[18] - ), - num_of_rounds=tx_data[19], - last_round=cls.LastRound.from_transaction_data(tx_data[20]), - ) - - @classmethod - def _from_v06(cls, tx_data: Tuple) -> "GenLayerRawTransaction": - """Bradbury / V06 ABI (23 fields). Fields differ at positions 9-12.""" - # [9] txExecutionHash (bytes32) — not in v04 - # [10] txCalldata (bytes) — equivalent to v04's txData - # [11] eqBlocksOutputs (bytes) — not in v04 - # [12+] messages and rest shifted by +1 vs v04 - # [22] consumedValidators — not in v04 + def from_transaction_data_light( + cls, + tx_data: Tuple, + round_validators: List[Address], + validator_votes: List[int], + validator_votes_hash: List[HexStr], + validator_result_hash: List[HexStr], + consumed_validators: List[Address], + tx_execution_result: int, + num_of_initial_validators: int, + ) -> "GenLayerRawTransaction": + """Parse the bounded train transaction view and separately read arrays.""" return cls( current_timestamp=tx_data[0], sender=tx_data[1], recipient=tx_data[2], - num_of_initial_validators=tx_data[3], # initialRotations in ABI + num_of_initial_validators=num_of_initial_validators, + initial_rotations=tx_data[3], tx_slot=tx_data[4], created_timestamp=tx_data[5], last_vote_timestamp=tx_data[6], random_seed=Web3.to_hex(tx_data[7]), result=tx_data[8], - tx_execution_result=0, - tx_data=Web3.to_hex(tx_data[10]), # txCalldata - tx_receipt="0x", # not present in V06; txExecutionHash is at [9] + tx_execution_result=tx_execution_result, + tx_data=Web3.to_hex(tx_data[10]), + tx_execution_hash=Web3.to_hex(tx_data[9]), + tx_receipt=None, messages=tx_data[12], + consumed_validators=consumed_validators, queue_type=tx_data[13], queue_position=tx_data[14], activator=tx_data[15], @@ -452,72 +608,50 @@ def _from_v06(cls, tx_data: Tuple) -> "GenLayerRawTransaction": tx_data[19] ), num_of_rounds=tx_data[20], - last_round=cls.LastRound.from_transaction_data(tx_data[21]), - ) - - @classmethod - def from_all_transaction_data(cls, tx_data: Tuple, rounds_data: List[Tuple]) -> "GenLayerRawTransaction": - """Parse getTransactionAllData response which returns (transaction, roundsData[]).""" - last_round_data = rounds_data[-1] if rounds_data else None - latest_block_range = tx_data[18][-1] if tx_data[18] else (0, 0, 0) - - return cls( - current_timestamp=0, - sender=tx_data[5], - recipient=tx_data[6], - num_of_initial_validators=tx_data[9], - tx_slot=tx_data[8], - created_timestamp=0, - last_vote_timestamp=0, - random_seed=Web3.to_hex(tx_data[13]), - result=tx_data[0], - tx_execution_result=tx_data[1], - tx_data=Web3.to_hex(tx_data[16]), - tx_receipt="0x", - messages=[], - queue_type=0, - queue_position=0, - activator=tx_data[7], - last_leader=tx_data[7], - status=tx_data[3], - tx_id=Web3.to_hex(tx_data[12]), - read_state_block_range=cls.ReadStateBlockRange.from_transaction_data(latest_block_range), - num_of_rounds=len(rounds_data), - last_round=cls.LastRound.from_all_data_round(last_round_data) if last_round_data else cls.LastRound( - round=0, leader_index=0, votes_committed=0, votes_revealed=0, - appeal_bond=0, rotations_left=0, result=0, round_validators=[], - validator_votes_hash=[], validator_votes=[], + last_round=cls.LastRound.from_light_data( + tx_data[21], + round_validators, + validator_votes, + validator_votes_hash, + validator_result_hash, ), ) def decode(self) -> GenLayerTransaction: + lifecycle = transaction_lifecycle_from_protocol_status(self.status) + if lifecycle["state"] == "finalized": + outcome = transaction_outcome_from_protocol_result(self.result) + if outcome is not None: + lifecycle["outcome"] = outcome return { "current_timestamp": str(self.current_timestamp), "sender": self.sender, "recipient": self.recipient, "num_of_initial_validators": str(self.num_of_initial_validators), + "initial_rotations": str(self.initial_rotations), "tx_slot": str(self.tx_slot), "created_timestamp": str(self.created_timestamp), "last_vote_timestamp": str(self.last_vote_timestamp), "random_seed": self.random_seed, "result": str(self.result), "tx_data": self.tx_data, + "tx_execution_hash": self.tx_execution_hash, "tx_receipt": self.tx_receipt, "consensus_data": { "leader_receipt": self._decode_leader_receipt(), }, "messages": self.messages, + "consumed_validators": self.consumed_validators, "queue_type": str(self.queue_type), "queue_position": str(self.queue_position), "activator": self.activator, "last_leader": self.last_leader, - "status": str(self.status), + "lifecycle": lifecycle, "tx_id": self.tx_id, "read_state_block_range": self.read_state_block_range.decode(), "num_of_rounds": str(self.num_of_rounds), "last_round": self.last_round.decode(), "tx_data_decoded": self._decode_input_data(), - "status_name": TRANSACTION_STATUS_NUMBER_TO_NAME[str(self.status)].value, "result_name": TRANSACTION_RESULT_NUMBER_TO_NAME[str(self.result)].value, "tx_execution_result": self.tx_execution_result, "tx_execution_result_name": EXECUTION_RESULT_NUMBER_TO_NAME.get( diff --git a/scripts/generate-api-docs.py b/scripts/generate-api-docs.py index 7010529..4fa0d7d 100644 --- a/scripts/generate-api-docs.py +++ b/scripts/generate-api-docs.py @@ -14,9 +14,17 @@ def clean_readme(content): lines = content.split("\n") - lines = [l for l in lines if not re.match(r'^\[!\[.*\]\(https://(img\.shields\.io|dcbadge|badge\.fury)', l)] + lines = [ + l + for l in lines + if not re.match( + r"^\[!\[.*\]\(https://(img\.shields\.io|dcbadge|badge\.fury)", l + ) + ] content = "\n".join(lines) - content = re.sub(r'(## )\S*[\U0001F000-\U0001FFFF\u2600-\u27BF\u200d]+\s*', r'\1', content) + content = re.sub( + r"(## )\S*[\U0001F000-\U0001FFFF\u2600-\u27BF\u200d]+\s*", r"\1", content + ) return content @@ -26,7 +34,12 @@ def format_type(annotation): name = getattr(annotation, "__name__", None) if name: return name - return str(annotation).replace("typing.", "").replace("ForwardRef('", "").replace("')", "") + return ( + str(annotation) + .replace("typing.", "") + .replace("ForwardRef('", "") + .replace("')", "") + ) def generate_method_doc(name, method): @@ -63,7 +76,9 @@ def generate_method_doc(name, method): req_str = "yes" if required else "no" type_display = f"`{type_str}`" if type_str else "" default_display = default.lstrip(" = ") if default else "" - lines.append(f"| {pname} | {type_display} | {req_str} | {default_display} |") + lines.append( + f"| {pname} | {type_display} | {req_str} | {default_display} |" + ) lines.append("") if ret: @@ -86,7 +101,9 @@ def generate_enum_doc(name, enum_class): def main(): from genlayer_py.client.genlayer_client import GenLayerClient from genlayer_py.types.transactions import ( - TransactionStatus, TransactionResult, ExecutionResult, VoteType, + ExecutionResult, + TransactionResult, + VoteType, ) output_dir = os.path.join(os.path.dirname(__file__), "..", "docs", "api-references") @@ -103,11 +120,29 @@ def main(): lines.append(f"{client_doc}\n") public_methods = [ - "fund_account", "get_current_nonce", "initialize_consensus_smart_contract", - "read_contract", "write_contract", "simulate_write_contract", "deploy_contract", - "get_contract_schema", "get_contract_schema_for_code", "appeal_transaction", - "wait_for_transaction_receipt", "get_transaction", - "get_triggered_transaction_ids", "debug_trace_transaction", + "fund_account", + "get_current_nonce", + "initialize_consensus_smart_contract", + "read_contract", + "write_contract", + "simulate_write_contract", + "deploy_contract", + "get_contract_schema", + "get_contract_schema_for_code", + "appeal_transaction", + "top_up_fees", + "top_up_and_submit_appeal", + "can_appeal", + "get_appeal_quote", + "get_appeal_charge", + "get_min_appeal_bond", + "wait_for_decision", + "wait_for_finalization", + "wait_for_transaction_receipt", + "get_transaction", + "get_transaction_lifecycle", + "get_triggered_transaction_ids", + "debug_trace_transaction", ] for name in public_methods: method = getattr(GenLayerClient, name, None) @@ -117,7 +152,6 @@ def main(): # Enums lines.append("## Types and Enums\n") for name, enum_class in [ - ("TransactionStatus", TransactionStatus), ("TransactionResult", TransactionResult), ("ExecutionResult", ExecutionResult), ("VoteType", VoteType), diff --git a/tests/e2e/tests/test_custom_validators.py b/tests/e2e/tests/test_custom_validators.py index 3754a37..6641c2d 100644 --- a/tests/e2e/tests/test_custom_validators.py +++ b/tests/e2e/tests/test_custom_validators.py @@ -2,7 +2,6 @@ from genlayer_py import create_client, create_account from genlayer_py.chains import localnet -from genlayer_py.types import TransactionStatus from genlayer_py.assertions import tx_execution_succeeded diff --git a/tests/e2e/tests/test_football_prediction_market.py b/tests/e2e/tests/test_football_prediction_market.py index f04f6ac..68200f5 100644 --- a/tests/e2e/tests/test_football_prediction_market.py +++ b/tests/e2e/tests/test_football_prediction_market.py @@ -4,7 +4,6 @@ from genlayer_py import create_client, create_account from genlayer_py.chains import localnet, studionet, testnet_asimov -from genlayer_py.types import TransactionStatus from genlayer_py.assertions import tx_execution_succeeded # Load environment variables from .env file @@ -67,7 +66,7 @@ def test_football_prediction_market(chain_config): # Wait for transaction with retries if specified wait_kwargs = { "transaction_hash": deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: wait_kwargs["retries"] = chain_config["retries"] @@ -92,7 +91,7 @@ def test_football_prediction_market(chain_config): # Wait for resolve transaction with retries if specified resolve_wait_kwargs = { "transaction_hash": resolve_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: resolve_wait_kwargs["retries"] = chain_config["retries"] diff --git a/tests/e2e/tests/test_intelligent_oracle_factory.py b/tests/e2e/tests/test_intelligent_oracle_factory.py index 441cbbe..0be6c6d 100644 --- a/tests/e2e/tests/test_intelligent_oracle_factory.py +++ b/tests/e2e/tests/test_intelligent_oracle_factory.py @@ -5,7 +5,6 @@ from genlayer_py import create_client, create_account from genlayer_py.chains import localnet, studionet, testnet_asimov -from genlayer_py.types import TransactionStatus from genlayer_py.assertions import tx_execution_succeeded # Load environment variables from .env file @@ -86,7 +85,7 @@ def test_intelligent_oracle_factory_pattern(chain_config): # Wait for registry deployment registry_wait_kwargs = { "transaction_hash": registry_deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", "retries": 80, } @@ -150,7 +149,7 @@ def test_intelligent_oracle_factory_pattern(chain_config): # Wait for create_new_prediction_market transaction create_wait_kwargs = { "transaction_hash": create_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", "retries": 80, } @@ -211,7 +210,7 @@ def test_intelligent_oracle_factory_pattern(chain_config): # Wait for resolve transaction resolve_wait_kwargs = { "transaction_hash": resolve_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", "retries": 80, } diff --git a/tests/e2e/tests/test_llm_erc20.py b/tests/e2e/tests/test_llm_erc20.py index 31b737d..d5598ac 100644 --- a/tests/e2e/tests/test_llm_erc20.py +++ b/tests/e2e/tests/test_llm_erc20.py @@ -4,7 +4,6 @@ from genlayer_py import create_client, create_account from genlayer_py.chains import localnet, studionet, testnet_asimov -from genlayer_py.types import TransactionStatus from genlayer_py.assertions import tx_execution_succeeded # Load environment variables from .env file @@ -79,7 +78,7 @@ def test_llm_erc20_interaction(chain_config): # Wait for transaction with retries if specified wait_kwargs = { "transaction_hash": deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: wait_kwargs["retries"] = chain_config["retries"] @@ -111,7 +110,7 @@ def test_llm_erc20_interaction(chain_config): # Wait for transfer transaction with retries if specified transfer_wait_kwargs = { "transaction_hash": transfer_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: transfer_wait_kwargs["retries"] = chain_config["retries"] diff --git a/tests/e2e/tests/test_log_indexer.py b/tests/e2e/tests/test_log_indexer.py index 8510202..9dae1ff 100644 --- a/tests/e2e/tests/test_log_indexer.py +++ b/tests/e2e/tests/test_log_indexer.py @@ -4,7 +4,6 @@ from genlayer_py import create_client, create_account from genlayer_py.chains import localnet, studionet, testnet_asimov -from genlayer_py.types import TransactionStatus from genlayer_py.assertions import tx_execution_succeeded # Load environment variables from .env file @@ -69,7 +68,7 @@ def test_log_indexer(chain_config): # Wait for transaction with retries if specified wait_kwargs = { "transaction_hash": deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: wait_kwargs["retries"] = chain_config["retries"] @@ -102,7 +101,7 @@ def test_log_indexer(chain_config): # Wait for add_log transaction add_log_0_wait_kwargs = { "transaction_hash": add_log_0_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: add_log_0_wait_kwargs["retries"] = chain_config["retries"] @@ -130,7 +129,7 @@ def test_log_indexer(chain_config): # Wait for add_log transaction add_log_1_wait_kwargs = { "transaction_hash": add_log_1_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: add_log_1_wait_kwargs["retries"] = chain_config["retries"] @@ -157,7 +156,7 @@ def test_log_indexer(chain_config): # Wait for update_log transaction update_log_0_wait_kwargs = { "transaction_hash": update_log_0_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: update_log_0_wait_kwargs["retries"] = chain_config["retries"] @@ -187,7 +186,7 @@ def test_log_indexer(chain_config): # Wait for remove_log transaction remove_log_0_wait_kwargs = { "transaction_hash": remove_log_0_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: remove_log_0_wait_kwargs["retries"] = chain_config["retries"] @@ -216,7 +215,7 @@ def test_log_indexer(chain_config): # Wait for add_log transaction add_log_2_wait_kwargs = { "transaction_hash": add_log_2_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: add_log_2_wait_kwargs["retries"] = chain_config["retries"] diff --git a/tests/e2e/tests/test_multi_file_contract.py b/tests/e2e/tests/test_multi_file_contract.py index f060703..3c34074 100644 --- a/tests/e2e/tests/test_multi_file_contract.py +++ b/tests/e2e/tests/test_multi_file_contract.py @@ -7,7 +7,6 @@ from genlayer_py import create_client, create_account from genlayer_py.chains import localnet, studionet, testnet_asimov -from genlayer_py.types import TransactionStatus from genlayer_py.assertions import tx_execution_succeeded # Load environment variables from .env file @@ -106,7 +105,7 @@ def test_multi_file_contract(chain_config): # Wait for transaction with retries if specified wait_kwargs = { "transaction_hash": deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: wait_kwargs["retries"] = chain_config["retries"] @@ -130,7 +129,7 @@ def test_multi_file_contract(chain_config): # Wait for wait transaction wait_wait_kwargs = { "transaction_hash": wait_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: wait_wait_kwargs["retries"] = chain_config["retries"] diff --git a/tests/e2e/tests/test_multi_read_erc20.py b/tests/e2e/tests/test_multi_read_erc20.py index 472a245..1a3ea2c 100644 --- a/tests/e2e/tests/test_multi_read_erc20.py +++ b/tests/e2e/tests/test_multi_read_erc20.py @@ -4,7 +4,6 @@ from genlayer_py import create_client, create_account from genlayer_py.chains import localnet, studionet, testnet_asimov -from genlayer_py.types import TransactionStatus from genlayer_py.assertions import tx_execution_succeeded # Load environment variables from .env file @@ -94,7 +93,7 @@ def test_multi_read_erc20(chain_config): # Wait for doge deployment doge_wait_kwargs = { "transaction_hash": doge_deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: doge_wait_kwargs["retries"] = chain_config["retries"] @@ -115,7 +114,7 @@ def test_multi_read_erc20(chain_config): # Wait for shiba deployment shiba_wait_kwargs = { "transaction_hash": shiba_deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: shiba_wait_kwargs["retries"] = chain_config["retries"] @@ -138,7 +137,7 @@ def test_multi_read_erc20(chain_config): # Wait for multi-read deployment multi_read_wait_kwargs = { "transaction_hash": multi_read_deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: multi_read_wait_kwargs["retries"] = chain_config["retries"] @@ -166,7 +165,7 @@ def test_multi_read_erc20(chain_config): # Wait for update_token_balances transaction update_balances_doge_wait_kwargs = { "transaction_hash": update_balances_doge_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: update_balances_doge_wait_kwargs["retries"] = chain_config["retries"] @@ -201,7 +200,7 @@ def test_multi_read_erc20(chain_config): # Wait for update_token_balances transaction update_balances_shiba_wait_kwargs = { "transaction_hash": update_balances_shiba_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: update_balances_shiba_wait_kwargs["retries"] = chain_config["retries"] diff --git a/tests/e2e/tests/test_multi_tenant_storage.py b/tests/e2e/tests/test_multi_tenant_storage.py index 0353749..18e33d8 100644 --- a/tests/e2e/tests/test_multi_tenant_storage.py +++ b/tests/e2e/tests/test_multi_tenant_storage.py @@ -4,7 +4,7 @@ from genlayer_py import create_client, create_account from genlayer_py.chains import localnet, studionet, testnet_asimov -from genlayer_py.types import TransactionStatus, GenLayerTransaction +from genlayer_py.types import GenLayerTransaction from genlayer_py.client import GenLayerClient from genlayer_py.assertions import tx_execution_succeeded @@ -24,7 +24,7 @@ def wait_for_triggered_transactions( for triggered_transaction in tx_receipt["triggered_transactions"]: client.wait_for_transaction_receipt( transaction_hash=triggered_transaction, - status=TransactionStatus.FINALIZED, + wait_until="finalized", ) @@ -110,7 +110,7 @@ def test_multi_tenant_storage(chain_config): # Wait for first storage deployment first_storage_wait_kwargs = { "transaction_hash": first_storage_deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: first_storage_wait_kwargs["retries"] = chain_config["retries"] @@ -133,7 +133,7 @@ def test_multi_tenant_storage(chain_config): # Wait for second storage deployment second_storage_wait_kwargs = { "transaction_hash": second_storage_deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: second_storage_wait_kwargs["retries"] = chain_config["retries"] @@ -158,7 +158,7 @@ def test_multi_tenant_storage(chain_config): # Wait for multi-tenant storage deployment multi_tenant_storage_wait_kwargs = { "transaction_hash": multi_tenant_storage_deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: multi_tenant_storage_wait_kwargs["retries"] = chain_config["retries"] @@ -185,7 +185,7 @@ def test_multi_tenant_storage(chain_config): # Wait for update_storage transaction update_storage_a_wait_kwargs = { "transaction_hash": update_storage_a_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: update_storage_a_wait_kwargs["retries"] = chain_config["retries"] @@ -207,7 +207,7 @@ def test_multi_tenant_storage(chain_config): # Wait for update_storage transaction update_storage_b_wait_kwargs = { "transaction_hash": update_storage_b_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: update_storage_b_wait_kwargs["retries"] = chain_config["retries"] diff --git a/tests/e2e/tests/test_read_erc20.py b/tests/e2e/tests/test_read_erc20.py index 1b6f49c..ea6172e 100644 --- a/tests/e2e/tests/test_read_erc20.py +++ b/tests/e2e/tests/test_read_erc20.py @@ -4,7 +4,6 @@ from genlayer_py import create_client, create_account from genlayer_py.chains import localnet, studionet, testnet_asimov -from genlayer_py.types import TransactionStatus from genlayer_py.assertions import tx_execution_succeeded # Load environment variables from .env file @@ -82,7 +81,7 @@ def test_read_erc20(chain_config): # Wait for LLM ERC20 deployment llm_erc20_wait_kwargs = { "transaction_hash": llm_erc20_deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: llm_erc20_wait_kwargs["retries"] = chain_config["retries"] @@ -111,7 +110,7 @@ def test_read_erc20(chain_config): # Wait for read_erc20 deployment read_erc20_wait_kwargs = { "transaction_hash": read_erc20_deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: read_erc20_wait_kwargs["retries"] = chain_config["retries"] diff --git a/tests/e2e/tests/test_storage.py b/tests/e2e/tests/test_storage.py index ad108a6..7f4f15a 100644 --- a/tests/e2e/tests/test_storage.py +++ b/tests/e2e/tests/test_storage.py @@ -4,7 +4,6 @@ from genlayer_py import create_client, create_account from genlayer_py.chains import localnet, studionet, testnet_asimov -from genlayer_py.types import TransactionStatus from genlayer_py.assertions import tx_execution_succeeded # Load environment variables from .env file @@ -67,7 +66,7 @@ def test_storage_interaction(chain_config): # Wait for transaction with retries if specified wait_kwargs = { "transaction_hash": deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: wait_kwargs["retries"] = chain_config["retries"] @@ -99,7 +98,7 @@ def test_storage_interaction(chain_config): # Wait for write transaction with retries if specified write_wait_kwargs = { "transaction_hash": write_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: write_wait_kwargs["retries"] = chain_config["retries"] diff --git a/tests/e2e/tests/test_user_storage.py b/tests/e2e/tests/test_user_storage.py index 5c12865..3999d10 100644 --- a/tests/e2e/tests/test_user_storage.py +++ b/tests/e2e/tests/test_user_storage.py @@ -4,7 +4,6 @@ from genlayer_py import create_client, create_account from genlayer_py.chains import localnet, studionet, testnet_asimov -from genlayer_py.types import TransactionStatus from genlayer_py.assertions import tx_execution_succeeded # Load environment variables from .env file @@ -79,7 +78,7 @@ def test_user_storage(chain_config): # Wait for transaction with retries if specified wait_kwargs = { "transaction_hash": deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: wait_kwargs["retries"] = chain_config["retries"] @@ -111,7 +110,7 @@ def test_user_storage(chain_config): # Wait for update_storage transaction update_storage_a_wait_kwargs = { "transaction_hash": update_storage_a_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: update_storage_a_wait_kwargs["retries"] = chain_config["retries"] @@ -146,7 +145,7 @@ def test_user_storage(chain_config): # Wait for update_storage transaction update_storage_b_wait_kwargs = { "transaction_hash": update_storage_b_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: update_storage_b_wait_kwargs["retries"] = chain_config["retries"] @@ -174,7 +173,7 @@ def test_user_storage(chain_config): # Wait for update_storage transaction update_storage_a2_wait_kwargs = { "transaction_hash": update_storage_a2_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: update_storage_a2_wait_kwargs["retries"] = chain_config["retries"] diff --git a/tests/e2e/tests/test_wizard_of_coin.py b/tests/e2e/tests/test_wizard_of_coin.py index 8de6e8a..0d61927 100644 --- a/tests/e2e/tests/test_wizard_of_coin.py +++ b/tests/e2e/tests/test_wizard_of_coin.py @@ -4,7 +4,6 @@ from genlayer_py import create_client, create_account from genlayer_py.chains import localnet, studionet, testnet_asimov -from genlayer_py.types import TransactionStatus from genlayer_py.assertions import tx_execution_succeeded # Load environment variables from .env file @@ -65,7 +64,7 @@ def test_wizard_of_coin(chain_config): # Wait for transaction with retries if specified wait_kwargs = { "transaction_hash": deploy_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: wait_kwargs["retries"] = chain_config["retries"] @@ -90,7 +89,7 @@ def test_wizard_of_coin(chain_config): # Wait for ask_for_coin transaction ask_for_coin_wait_kwargs = { "transaction_hash": ask_for_coin_tx_hash, - "status": TransactionStatus.FINALIZED, + "wait_until": "finalized", } if chain_config["retries"]: ask_for_coin_wait_kwargs["retries"] = chain_config["retries"] diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index ff06a60..1e42103 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -94,8 +94,7 @@ def sample_transaction_data(): "gaslimit": 2, "nonce": 1, "type": 2, - "status": 7, # FINALIZED - "status_name": "FINALIZED", + "lifecycle": {"state": "finalized", "outcome": "accepted"}, "result": "6", "result_name": "MAJORITY_AGREE", "created_at": "2025-07-22T19:58:39.866436+00:00", @@ -115,8 +114,7 @@ def pending_transaction_data(): """Transaction in pending state""" return { "hash": "0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", - "status": 1, # PENDING - "status_name": "PENDING", + "lifecycle": {"state": "processing", "phase": "pending"}, "from_address": "0xd650f318A0C1F940a3b6dFeA695747fA9804D685", "to_address": "0xf72aa51B6350C18966923073d3609e1356a3fbBA", "value": 0, @@ -128,8 +126,7 @@ def pending_transaction_data(): def accepted_transaction_data(sample_transaction_data): """Transaction in accepted state""" data = sample_transaction_data.copy() - data["status"] = 5 # ACCEPTED - data["status_name"] = "ACCEPTED" + data["lifecycle"] = {"state": "decided", "outcome": "accepted"} return data diff --git a/tests/unit/contracts/test_contract_actions.py b/tests/unit/contracts/test_contract_actions.py index c0c6de9..b19f020 100644 --- a/tests/unit/contracts/test_contract_actions.py +++ b/tests/unit/contracts/test_contract_actions.py @@ -9,6 +9,7 @@ import genlayer_py.contracts.actions as contract_actions from genlayer_py.chains import localnet from genlayer_py.chains.testnet_asimov import testnet_asimov +from genlayer_py.consensus.abi import CONSENSUS_MAIN_ABI from genlayer_py.exceptions import GenLayerError from genlayer_py.transactions.fees import ( ADD_TRANSACTION_WITH_FEES_ARGUMENT_TYPES, @@ -32,7 +33,6 @@ requires_fee_deposit_calculation, ) - DEFAULT_PARENT_MESSAGE_RECEIPT_HEADROOM = 10_000 LOCAL_EXECUTION_BUDGET_FLOOR_GAS = 306_192 @@ -124,6 +124,18 @@ } ] +# Studio refetches its ConsensusMain ABI from the simulator RPC. Its current +# native appeal entrypoint carries only the transaction id. +STUDIO_CONSENSUS_MAIN_ABI = [ + { + "type": "function", + "name": "submitAppeal", + "stateMutability": "payable", + "inputs": [{"name": "_txId", "type": "bytes32"}], + "outputs": [], + } +] + SENDER = "0x1111111111111111111111111111111111111111" RECIPIENT = "0x2222222222222222222222222222222222222222" TX_ID = "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" @@ -260,7 +272,7 @@ def fake_send_consensus_call(**kwargs): def test_top_up_and_submit_appeal_sends_consensus_call_and_returns_tx_id(monkeypatch): - client = _make_client(ADD_TRANSACTION_ABI_WITH_FEES) + client = _make_client(ADD_TRANSACTION_ABI_WITH_FEES, chain_id=testnet_asimov.id) captured = {} def fake_send_consensus_call(**kwargs): @@ -277,28 +289,58 @@ def fake_send_consensus_call(**kwargs): self=client, transaction_id=TX_ID, value=1234, + expected_decision_id=42, distribution={"appealRounds": 1, "rotations": [0, 1]}, ) selector = eth_utils.keccak( - text=f"topUpAndSubmitAppeal(bytes32,{FEES_DISTRIBUTION_ABI_TYPE})" + text=f"topUpAndSubmitAppeal(bytes32,uint256,{FEES_DISTRIBUTION_ABI_TYPE})" )[:4].hex() assert result == TX_ID assert captured["value"] == 1234 assert captured["operation_name"] == "Top up and submit appeal" assert captured["encoded_data"].startswith(f"0x{selector}") + decoded_tx_id, decision_id, _ = abi_decode( + ("bytes32", "uint256", FEES_DISTRIBUTION_ABI_TYPE), + Web3.to_bytes(hexstr=captured["encoded_data"][10:]), + ) + assert decoded_tx_id == Web3.to_bytes(hexstr=TX_ID) + assert decision_id == 42 -def test_appeal_transaction_auto_resolves_min_bond(monkeypatch): - client = _make_client(ADD_TRANSACTION_ABI_WITH_FEES) - client.chain.fee_manager_contract = {"address": "0x4444444444444444444444444444444444444444"} - client.chain.rounds_storage_contract = {"address": "0x5555555555555555555555555555555555555555"} +def test_encode_submit_appeal_uses_exact_decision_guarded_selector(): + client = _make_client(CONSENSUS_MAIN_ABI) + + encoded = contract_actions._encode_submit_appeal_data( + self=client, + transaction_id=TX_ID, + expected_decision_id=42, + ) + + selector = eth_utils.keccak(text="submitAppeal(bytes32,uint256)")[:4].hex() + assert encoded.startswith(f"0x{selector}") + assert abi_decode(("bytes32", "uint256"), Web3.to_bytes(hexstr=encoded[10:])) == ( + Web3.to_bytes(hexstr=TX_ID), + 42, + ) + + +def test_appeal_transaction_auto_resolves_latest_quote(monkeypatch): + client = _make_client(ADD_TRANSACTION_ABI_WITH_FEES, chain_id=testnet_asimov.id) captured = {} monkeypatch.setattr( contract_actions, - "get_min_appeal_bond", - Mock(return_value=4_321), + "get_appeal_quote", + Mock( + return_value={ + "decision_id": 42, + "bond": 4_000, + "funding": 321, + "total": 4_321, + "appeal_deadline": 999, + } + ), ) monkeypatch.setattr( contract_actions, @@ -322,21 +364,32 @@ def fake_send_consensus_call(**kwargs): ) assert result == TX_ID - contract_actions.get_min_appeal_bond.assert_called_once_with(client, TX_ID) + contract_actions.get_appeal_quote.assert_called_once_with(client, TX_ID) + contract_actions._encode_submit_appeal_data.assert_called_once_with( + self=client, + transaction_id=TX_ID, + expected_decision_id=42, + ) assert captured["value"] == 4_321 assert captured["operation_name"] == "Appeal" -def test_top_up_and_submit_appeal_auto_resolves_min_bond(monkeypatch): - client = _make_client(ADD_TRANSACTION_ABI_WITH_FEES) - client.chain.fee_manager_contract = {"address": "0x4444444444444444444444444444444444444444"} - client.chain.rounds_storage_contract = {"address": "0x5555555555555555555555555555555555555555"} +def test_top_up_and_submit_appeal_auto_resolves_latest_quote(monkeypatch): + client = _make_client(ADD_TRANSACTION_ABI_WITH_FEES, chain_id=testnet_asimov.id) captured = {} monkeypatch.setattr( contract_actions, - "get_min_appeal_bond", - Mock(return_value=9_999), + "get_appeal_quote", + Mock( + return_value={ + "decision_id": 77, + "bond": 9_000, + "funding": 999, + "total": 9_999, + "appeal_deadline": 1_234, + } + ), ) def fake_send_consensus_call(**kwargs): @@ -357,24 +410,275 @@ def fake_send_consensus_call(**kwargs): assert result == TX_ID assert captured["value"] == 9_999 + _, decision_id, _ = abi_decode( + ("bytes32", "uint256", FEES_DISTRIBUTION_ABI_TYPE), + Web3.to_bytes(hexstr=captured["encoded_data"][10:]), + ) + assert decision_id == 77 -def test_appeal_auto_bond_requires_fee_contracts(): - client = _make_client(ADD_TRANSACTION_ABI_WITH_FEES) - client.chain.fee_manager_contract = None +def test_appeal_auto_quote_failure_is_actionable(monkeypatch): + client = _make_client(ADD_TRANSACTION_ABI_WITH_FEES, chain_id=testnet_asimov.id) + monkeypatch.setattr( + contract_actions, + "get_appeal_quote", + Mock(side_effect=RuntimeError("no active decision")), + ) - with pytest.raises(GenLayerError, match="Cannot auto-resolve appeal bond"): + with pytest.raises(GenLayerError, match="Cannot quote an active appeal decision"): contract_actions.appeal_transaction( self=client, transaction_id=TX_ID, ) +def test_get_appeal_quote_uses_consensus_data_without_full_transaction(monkeypatch): + client = _make_client(ADD_TRANSACTION_ABI_WITH_FEES, chain_id=testnet_asimov.id) + quote_call = Mock(return_value=(42, 4_000, 321, 999)) + estimate = Mock(return_value=SimpleNamespace(call=quote_call)) + contract = SimpleNamespace( + functions=SimpleNamespace(estimateLatestAppealCharge=estimate) + ) + monkeypatch.setattr( + contract_actions, + "_consensus_data_contract", + lambda self: contract, + ) + + assert contract_actions.get_appeal_quote(client, TX_ID) == { + "decision_id": 42, + "bond": 4_000, + "funding": 321, + "total": 4_321, + "appeal_deadline": 999, + } + estimate.assert_called_once_with(Web3.to_bytes(hexstr=TX_ID)) + + +def test_get_min_appeal_bond_returns_the_full_train_charge(monkeypatch): + client = _make_client(ADD_TRANSACTION_ABI_WITH_FEES, chain_id=testnet_asimov.id) + monkeypatch.setattr( + contract_actions, + "get_appeal_quote", + Mock(return_value={"total": 4_321}), + ) + + assert contract_actions.get_min_appeal_bond(client, TX_ID) == 4_321 + + +def test_get_appeal_charge_returns_the_full_train_charge(monkeypatch): + client = Mock() + monkeypatch.setattr( + contract_actions, + "get_appeal_quote", + Mock(return_value={"total": 4_321}), + ) + assert contract_actions.get_appeal_charge(client, TX_ID) == 4_321 + + +def test_can_appeal_passes_the_exact_active_decision_id(monkeypatch): + client = _make_client(ADD_TRANSACTION_ABI_WITH_FEES, chain_id=testnet_asimov.id) + client.chain.appeals_contract = { + "address": "0x4444444444444444444444444444444444444444", + "abi": [], + } + can_appeal_call = Mock(return_value=True) + can_appeal_function = Mock(return_value=SimpleNamespace(call=can_appeal_call)) + contract = SimpleNamespace(functions=SimpleNamespace(canAppeal=can_appeal_function)) + monkeypatch.setattr( + contract_actions, + "_appeals_contract", + lambda self: contract, + ) + monkeypatch.setattr( + contract_actions, + "_get_active_decision_id", + Mock(return_value=42), + ) + + assert contract_actions.can_appeal(client, TX_ID) is True + can_appeal_function.assert_called_once_with(Web3.to_bytes(hexstr=TX_ID), 42) + + +def test_can_appeal_returns_false_without_an_active_decision(monkeypatch): + client = _make_client(ADD_TRANSACTION_ABI_WITH_FEES, chain_id=testnet_asimov.id) + client.chain.appeals_contract = { + "address": "0x4444444444444444444444444444444444444444", + "abi": [], + } + monkeypatch.setattr( + contract_actions, + "_get_active_decision_id", + Mock(return_value=None), + ) + appeals_contract = Mock() + monkeypatch.setattr( + contract_actions, + "_appeals_contract", + appeals_contract, + ) + + assert contract_actions.can_appeal(client, TX_ID) is False + appeals_contract.assert_not_called() + + +def _forbid_train_reads(monkeypatch): + train_read = Mock(side_effect=AssertionError("train read on a Studio chain")) + monkeypatch.setattr(contract_actions, "_consensus_data_contract", train_read) + monkeypatch.setattr(contract_actions, "_get_active_decision_id", train_read) + monkeypatch.setattr(contract_actions, "get_appeal_quote", train_read) + return train_read + + +def test_appeal_transaction_on_studio_keeps_the_native_call_shape(monkeypatch): + client = _make_client(STUDIO_CONSENSUS_MAIN_ABI) + train_read = _forbid_train_reads(monkeypatch) + captured = {} + + def fake_send_consensus_call(**kwargs): + captured.update(kwargs) + return "0xevmtx" + + monkeypatch.setattr( + contract_actions, + "_send_consensus_call", + fake_send_consensus_call, + ) + + result = contract_actions.appeal_transaction( + self=client, + transaction_id=TX_ID, + value=1234, + ) + + selector = eth_utils.keccak(text="submitAppeal(bytes32)")[:4].hex() + assert result == TX_ID + assert captured["value"] == 1234 + assert captured["operation_name"] == "Appeal" + assert captured["encoded_data"] == f"0x{selector}{TX_ID[2:]}" + train_read.assert_not_called() + + +def test_top_up_and_submit_appeal_on_studio_keeps_the_native_call_shape(monkeypatch): + client = _make_client(STUDIO_CONSENSUS_MAIN_ABI) + train_read = _forbid_train_reads(monkeypatch) + captured = {} + + def fake_send_consensus_call(**kwargs): + captured.update(kwargs) + return "0xevmtx" + + monkeypatch.setattr( + contract_actions, + "_send_consensus_call", + fake_send_consensus_call, + ) + + result = contract_actions.top_up_and_submit_appeal( + self=client, + transaction_id=TX_ID, + value=1234, + distribution={"appealRounds": 1, "rotations": [0, 1]}, + ) + + selector = eth_utils.keccak( + text=f"topUpAndSubmitAppeal(bytes32,{FEES_DISTRIBUTION_ABI_TYPE})" + )[:4].hex() + assert result == TX_ID + assert captured["value"] == 1234 + assert captured["operation_name"] == "Top up and submit appeal" + assert captured["encoded_data"].startswith(f"0x{selector}") + decoded_tx_id, distribution = abi_decode( + ("bytes32", FEES_DISTRIBUTION_ABI_TYPE), + Web3.to_bytes(hexstr=captured["encoded_data"][10:]), + ) + assert decoded_tx_id == Web3.to_bytes(hexstr=TX_ID) + assert distribution[2] == 1 + train_read.assert_not_called() + + +@pytest.mark.parametrize( + "action", + ( + contract_actions.get_appeal_quote, + contract_actions.get_appeal_charge, + contract_actions.get_min_appeal_bond, + ), +) +def test_appeal_quote_reads_on_studio_report_unavailable(action, monkeypatch): + client = _make_client(STUDIO_CONSENSUS_MAIN_ABI) + train_read = Mock(side_effect=AssertionError("train read on a Studio chain")) + monkeypatch.setattr(contract_actions, "_consensus_data_contract", train_read) + + with pytest.raises(GenLayerError, match="not available on current Studio"): + action(client, TX_ID) + + train_read.assert_not_called() + + +def test_studio_appeals_require_an_explicit_value(monkeypatch): + client = _make_client(STUDIO_CONSENSUS_MAIN_ABI) + train_read = _forbid_train_reads(monkeypatch) + send_consensus_call = Mock() + monkeypatch.setattr( + contract_actions, + "_send_consensus_call", + send_consensus_call, + ) + + with pytest.raises(GenLayerError, match="pass value explicitly"): + contract_actions.appeal_transaction(self=client, transaction_id=TX_ID) + with pytest.raises(GenLayerError, match="pass value explicitly"): + contract_actions.top_up_and_submit_appeal( + self=client, + transaction_id=TX_ID, + distribution={"appealRounds": 1}, + ) + + send_consensus_call.assert_not_called() + train_read.assert_not_called() + + +def test_studio_appeals_reject_the_train_decision_guard(monkeypatch): + client = _make_client(STUDIO_CONSENSUS_MAIN_ABI) + train_read = _forbid_train_reads(monkeypatch) + send_consensus_call = Mock() + monkeypatch.setattr( + contract_actions, + "_send_consensus_call", + send_consensus_call, + ) + + with pytest.raises(GenLayerError, match="expected_decision_id is not supported"): + contract_actions.appeal_transaction( + self=client, + transaction_id=TX_ID, + value=1234, + expected_decision_id=42, + ) + with pytest.raises(GenLayerError, match="expected_decision_id is not supported"): + contract_actions.top_up_and_submit_appeal( + self=client, + transaction_id=TX_ID, + distribution={"appealRounds": 1}, + value=1234, + expected_decision_id=42, + ) + + send_consensus_call.assert_not_called() + train_read.assert_not_called() + + +def test_encode_submit_appeal_still_requires_a_decision_id_on_the_train_shape(): + client = _make_client(CONSENSUS_MAIN_ABI, chain_id=testnet_asimov.id) + + with pytest.raises(ValueError, match="submitAppeal requires expected_decision_id"): + contract_actions._encode_submit_appeal_data(self=client, transaction_id=TX_ID) + + def test_send_consensus_call_returns_localnet_rpc_hash_without_waiting(monkeypatch): wait_for_transaction_receipt = Mock() - sign_transaction = Mock( - return_value=SimpleNamespace(raw_transaction=b"\x12\x34") - ) + sign_transaction = Mock(return_value=SimpleNamespace(raw_transaction=b"\x12\x34")) client = SimpleNamespace( chain=SimpleNamespace( id=localnet.id, @@ -382,12 +686,12 @@ def test_send_consensus_call_returns_localnet_rpc_hash_without_waiting(monkeypat "address": "0x3333333333333333333333333333333333333333", }, ), - provider=SimpleNamespace( - make_request=Mock(return_value={"result": TX_ID}) - ), + provider=SimpleNamespace(make_request=Mock(return_value={"result": TX_ID})), w3=SimpleNamespace( to_hex=Mock(return_value="0xsigned"), - eth=SimpleNamespace(wait_for_transaction_receipt=wait_for_transaction_receipt), + eth=SimpleNamespace( + wait_for_transaction_receipt=wait_for_transaction_receipt + ), ), ) account = SimpleNamespace(address=SENDER, sign_transaction=sign_transaction) @@ -413,14 +717,12 @@ def test_send_consensus_call_returns_localnet_rpc_hash_without_waiting(monkeypat def test_revert_selector_formatter_names_fee_errors(): error = Exception({"data": "0x632be5a1"}) - assert contract_actions._format_rpc_error(error).endswith( - "(FeeValueMustBeNonZero)" - ) + assert contract_actions._format_rpc_error(error).endswith("(FeeValueMustBeNonZero)") -def _make_client(add_transaction_abi): +def _make_client(add_transaction_abi, chain_id=localnet.id): chain = SimpleNamespace( - id=61999, + id=chain_id, consensus_main_contract={ "address": "0x3333333333333333333333333333333333333333", "abi": add_transaction_abi, @@ -432,6 +734,7 @@ def _make_client(add_transaction_abi): return SimpleNamespace( chain=chain, local_account=local_account, + provider=Mock(), w3=Web3(), ) @@ -482,7 +785,9 @@ def _make_fee_policy_client(values, gas_price=0): eth = _FakeEth(values, gas_price) return SimpleNamespace( chain=SimpleNamespace( - fee_manager_contract={"address": "0x4444444444444444444444444444444444444444"}, + fee_manager_contract={ + "address": "0x4444444444444444444444444444444444444444" + }, ), w3=SimpleNamespace( eth=eth, @@ -715,7 +1020,9 @@ def fake_send_transaction(**kwargs): assert params[9][0][6] == b"\x12\x34" -def test_write_contract_defaults_external_message_allocations_to_finalization(monkeypatch): +def test_write_contract_defaults_external_message_allocations_to_finalization( + monkeypatch, +): client = _make_client(ADD_TRANSACTION_ABI_WITH_FEES) client.initialize_consensus_smart_contract = Mock() @@ -797,6 +1104,7 @@ def test_build_estimated_fees_distribution_adds_caps_and_message_bucket(): ] }, policy, + default_consensus_max_rotations=3, ) assert distribution["leaderTimeunitsAllocation"] == 100 @@ -810,6 +1118,42 @@ def test_build_estimated_fees_distribution_adds_caps_and_message_bucket(): assert distribution["receiptFeeMaxGasPrice"] == 36 +def test_build_estimated_fees_distribution_funds_each_round_with_default_rotations(): + policy = { + "enabled": True, + "genPerTimeUnit": 10, + "storageUnitPrice": 20, + "receiptGasPrice": 30, + "executionBudgetFloor": 1_234, + } + + distribution = build_estimated_fees_distribution( + {"appealRounds": 2}, + policy, + default_consensus_max_rotations=3, + ) + + assert distribution["rotations"] == [3, 3, 3] + + +def test_build_estimated_fees_distribution_preserves_explicit_zero_rotations(): + policy = { + "enabled": True, + "genPerTimeUnit": 10, + "storageUnitPrice": 20, + "receiptGasPrice": 30, + "executionBudgetFloor": 1_234, + } + + distribution = build_estimated_fees_distribution( + {"rotations": [0]}, + policy, + default_consensus_max_rotations=3, + ) + + assert distribution["rotations"] == [0] + + def test_build_estimated_fees_distribution_preserves_explicit_execution_budget_with_messages(): policy = { "enabled": True, @@ -832,6 +1176,7 @@ def test_build_estimated_fees_distribution_preserves_explicit_execution_budget_w ], }, policy, + default_consensus_max_rotations=3, ) assert distribution["executionBudgetPerRound"] == 42 @@ -861,6 +1206,7 @@ def test_estimate_transaction_fees_uses_studio_fee_config(): chain=SimpleNamespace( fee_manager_contract=None, default_number_of_initial_validators=5, + default_consensus_max_rotations=3, ), provider=SimpleNamespace( make_request=Mock( @@ -894,7 +1240,8 @@ def test_estimate_transaction_fees_uses_studio_fee_config(): } ) assert estimate["distribution"]["executionBudgetPerRound"] == 3_000_000_000 - assert estimate["feeValue"] == 3_000_011_000 + assert estimate["distribution"]["rotations"] == [3] + assert estimate["feeValue"] == 12_000_044_000 def test_extract_studio_fee_policy_fallback_includes_message_reveal_leg(): @@ -927,6 +1274,7 @@ def test_estimate_transaction_fees_derives_message_bucket_from_allocations(): chain=SimpleNamespace( fee_manager_contract=None, default_number_of_initial_validators=5, + default_consensus_max_rotations=3, ), provider=SimpleNamespace( make_request=Mock( @@ -976,7 +1324,8 @@ def test_estimate_transaction_fees_derives_message_bucket_from_allocations(): assert estimate["distribution"]["executionBudgetPerRound"] == ( 3_000_000_000 + 30 * DEFAULT_PARENT_MESSAGE_RECEIPT_HEADROOM ) - assert estimate["feeValue"] == 3_000_311_080 + assert estimate["distribution"]["rotations"] == [3] + assert estimate["feeValue"] == 12_001_244_080 assert estimate["messageAllocations"] == message_allocations assert estimate["message_allocations"] == message_allocations @@ -986,6 +1335,7 @@ def test_estimate_transaction_fees_from_simulation_builds_trusted_preset(): chain=SimpleNamespace( fee_manager_contract=None, default_number_of_initial_validators=5, + default_consensus_max_rotations=3, ), provider=SimpleNamespace( make_request=Mock( @@ -1050,7 +1400,8 @@ def test_estimate_transaction_fees_from_simulation_builds_trusted_preset(): } assert estimate["distribution"]["executionBudgetPerRound"] == 602_117 assert estimate["distribution"]["totalMessageFees"] == 6 - assert estimate["feeValue"] == 613_123 + assert estimate["distribution"]["rotations"] == [3] + assert estimate["feeValue"] == 2_452_474 def test_simulation_execution_budget_uses_floor_without_default_gas_clobber(): @@ -1058,6 +1409,7 @@ def test_simulation_execution_budget_uses_floor_without_default_gas_clobber(): chain=SimpleNamespace( fee_manager_contract=None, default_number_of_initial_validators=5, + default_consensus_max_rotations=3, ), provider=SimpleNamespace( make_request=Mock( @@ -1131,7 +1483,9 @@ def make_request(method, params): { "messageType": MessageType.Internal, "onAcceptance": True, - "parentIndex": str(MESSAGE_ALLOCATION_ROOT_PARENT_INDEX), + "parentIndex": str( + MESSAGE_ALLOCATION_ROOT_PARENT_INDEX + ), "recipient": RECIPIENT, "callKey": "0x" + "00" * 32, "budget": "110", @@ -1159,7 +1513,9 @@ def make_request(method, params): { "messageType": MessageType.Internal, "onAcceptance": True, - "parentIndex": str(MESSAGE_ALLOCATION_ROOT_PARENT_INDEX), + "parentIndex": str( + MESSAGE_ALLOCATION_ROOT_PARENT_INDEX + ), "recipient": RECIPIENT, "callKey": "0x" + "00" * 32, "budget": "110", @@ -1202,7 +1558,8 @@ def make_request(method, params): ) request_params = sim_call.kwargs["params"][0] assert request_params["value"] == hex(7) - assert request_params["fees"]["feeValue"] == 100_021_110 + assert request_params["fees"]["feeValue"] == 400_084_110 + assert request_params["fees"]["distribution"]["rotations"] == [3] assert request_params["fees"]["distribution"]["totalMessageFees"] == 110 assert request_params["fees"]["messageAllocations"][0]["budget"] == 110 assert ( @@ -1216,6 +1573,7 @@ def make_request(method, params): assert estimate["simulation"]["feeReport"]["totalEstimatedFee"] == "501664" assert estimate["distribution"]["executionBudgetPerRound"] == 100_000_000 assert estimate["distribution"]["totalMessageFees"] == 110 + assert estimate["distribution"]["rotations"] == [0] assert estimate["messageAllocations"][0]["budget"] == 110 assert estimate["feeValue"] == 100_011_110 @@ -1231,6 +1589,7 @@ def test_estimate_transaction_fees_from_simulation_preserves_mode2_allocations() chain=SimpleNamespace( fee_manager_contract=None, default_number_of_initial_validators=5, + default_consensus_max_rotations=3, ), provider=SimpleNamespace( make_request=Mock( @@ -1274,7 +1633,8 @@ def test_estimate_transaction_fees_from_simulation_preserves_mode2_allocations() assert estimate["messageAllocations"][0]["budget"] == 50 assert estimate["messageAllocations"][0]["feeParams"] == fee_params assert estimate["distribution"]["totalMessageFees"] == 50 - assert estimate["feeValue"] == 11_050 + assert estimate["distribution"]["rotations"] == [3] + assert estimate["feeValue"] == 44_050 def test_write_contract_refreshes_consensus_abi_before_add_transaction_encoding( diff --git a/tests/unit/sample_data/full_deploy_transaction_data.py b/tests/unit/sample_data/full_deploy_transaction_data.py index cb54c6a..fb3c258 100644 --- a/tests/unit/sample_data/full_deploy_transaction_data.py +++ b/tests/unit/sample_data/full_deploy_transaction_data.py @@ -485,7 +485,7 @@ "rotation_count": 0, "s": None, "sender": "0xd650f318A0C1F940a3b6dFeA695747fA9804D685", - "status": 7, + "lifecycle": {"state": "finalized", "outcome": "accepted"}, "timestamp_appeal": None, "timestamp_awaiting_finalization": 1753284244, "to_address": "0xf72aa51B6350C18966923073d3609e1356a3fbBA", @@ -498,5 +498,4 @@ "type": 1, "v": None, "value": 0, - "status_name": "FINALIZED", } diff --git a/tests/unit/sample_data/full_write_transaction_data.py b/tests/unit/sample_data/full_write_transaction_data.py index 4c1ce8e..6ac649f 100644 --- a/tests/unit/sample_data/full_write_transaction_data.py +++ b/tests/unit/sample_data/full_write_transaction_data.py @@ -654,7 +654,7 @@ "rotation_count": 0, "s": None, "sender": "0xd650f318A0C1F940a3b6dFeA695747fA9804D685", - "status": 7, + "lifecycle": {"state": "finalized", "outcome": "accepted"}, "timestamp_appeal": None, "timestamp_awaiting_finalization": 1753284298, "to_address": "0xf72aa51B6350C18966923073d3609e1356a3fbBA", @@ -667,5 +667,4 @@ "type": 2, "v": None, "value": 0, - "status_name": "FINALIZED", } diff --git a/tests/unit/sample_data/simplified_deploy_transaction_data.py b/tests/unit/sample_data/simplified_deploy_transaction_data.py index 85e5105..29d568d 100644 --- a/tests/unit/sample_data/simplified_deploy_transaction_data.py +++ b/tests/unit/sample_data/simplified_deploy_transaction_data.py @@ -178,10 +178,9 @@ "result": 6, "result_name": "MAJORITY_AGREE", "sender": "0xd650f318A0C1F940a3b6dFeA695747fA9804D685", - "status": 7, + "lifecycle": {"state": "finalized", "outcome": "accepted"}, "to_address": "0xf72aa51B6350C18966923073d3609e1356a3fbBA", "tx_id": "0x7684df399f44fb67aa51d03905310a4fce66713c1281a3ba53d63fff9bb4faa8", "type": 1, "value": 0, - "status_name": "FINALIZED", } diff --git a/tests/unit/sample_data/simplified_write_transaction_data.py b/tests/unit/sample_data/simplified_write_transaction_data.py index 71c61fa..9a118ae 100644 --- a/tests/unit/sample_data/simplified_write_transaction_data.py +++ b/tests/unit/sample_data/simplified_write_transaction_data.py @@ -208,10 +208,9 @@ "result": 6, "result_name": "MAJORITY_AGREE", "sender": "0xd650f318A0C1F940a3b6dFeA695747fA9804D685", - "status": 7, + "lifecycle": {"state": "finalized", "outcome": "accepted"}, "to_address": "0xf72aa51B6350C18966923073d3609e1356a3fbBA", "tx_id": "0x0ae9327d0d81df24f03cef4dab94571c662c50b09f69dbe29305466aa9529ff6", "type": 2, "value": 0, - "status_name": "FINALIZED", } diff --git a/tests/unit/smoke/test_bradbury_smoke.py b/tests/unit/smoke/test_bradbury_smoke.py index 778f1cb..ecac549 100644 --- a/tests/unit/smoke/test_bradbury_smoke.py +++ b/tests/unit/smoke/test_bradbury_smoke.py @@ -101,8 +101,8 @@ def test_get_pending_transaction_value_zero(self): @pytest.mark.testnet -class TestBradburyGetTransactionAllData: - """Verify getTransactionAllData returns txExecutionResult.""" +class TestBradburyTransactionRead: + """Verify the transaction read returns txExecutionResult.""" def test_get_transaction_returns_execution_result(self): """Use the actual SDK client to fetch a known finalized tx and verify tx_execution_result.""" @@ -112,11 +112,21 @@ def test_get_transaction_returns_execution_result(self): "563f046c187d711127c51213ca62e2e4fee52009a98f0989a73a0a0382d21890" ) ) - assert tx["tx_execution_result"] in [0, 1, 2] + assert tx["tx_execution_result"] in [0, 1, 2, 3, 4, 5] assert tx["tx_execution_result_name"] in [ - "NOT_VOTED", "FINISHED_WITH_RETURN", "FINISHED_WITH_ERROR" + "NOT_VOTED", + "FINISHED_WITH_RETURN", + "FINISHED_WITH_ERROR", + "TIMEOUT", + "NONDET_DISAGREE", + "DETERMINISTIC_VIOLATION", ] - assert tx["status_name"] is not None + assert tx["lifecycle"]["state"] in { + "processing", + "decided", + "finalized", + "canceled", + } assert tx["result_name"] is not None def test_get_transaction_includes_messages(self): diff --git a/tests/unit/staking/test_staking_actions.py b/tests/unit/staking/test_staking_actions.py index 3969a41..2ad50da 100644 --- a/tests/unit/staking/test_staking_actions.py +++ b/tests/unit/staking/test_staking_actions.py @@ -9,27 +9,43 @@ from types import SimpleNamespace from unittest.mock import Mock +from eth_abi import decode as abi_decode from eth_utils import keccak import pytest from web3 import Web3 import genlayer_py.staking.actions as staking_actions +from genlayer_py.exceptions import GenLayerError from genlayer_py.staking.abi import STAKING_ABI, VALIDATOR_WALLET_ABI - +from genlayer_py.staking.operator_registration import ( + OperatorRegistrationContext, + OperatorRegistrationProof, +) STAKING_ADDR = "0x1111111111111111111111111111111111111111" WALLET_ADDR = "0x2222222222222222222222222222222222222222" SENDER_ADDR = "0x3333333333333333333333333333333333333333" OTHER_ADDR = "0x4444444444444444444444444444444444444444" +ADDRESS_MANAGER_ADDR = "0x5555555555555555555555555555555555555555" +FACTORY_ADDR = "0x6666666666666666666666666666666666666666" # 4-byte selectors for the function signatures we rely on. -SEL_VALIDATOR_JOIN_NO_ARGS = keccak(text="validatorJoin()")[:4].hex() -SEL_VALIDATOR_JOIN_ADDR = keccak(text="validatorJoin(address)")[:4].hex() +SEL_VALIDATOR_JOIN = keccak(text="validatorJoin(uint256[2],bytes)")[:4].hex() SEL_WALLET_DEPOSIT = keccak(text="validatorDeposit()")[:4].hex() SEL_WALLET_EXIT = keccak(text="validatorExit(uint256)")[:4].hex() -SEL_SET_OPERATOR = keccak(text="setOperator(address)")[:4].hex() SEL_DELEGATOR_JOIN = keccak(text="delegatorJoin(address)")[:4].hex() +REGISTRATION = OperatorRegistrationProof( + operator=OTHER_ADDR, + operator_pub_key=(1, 2), + possession_proof=b"\x99" * 65, +) +JOIN_CONTEXT = OperatorRegistrationContext( + registrar=FACTORY_ADDR, + owner=SENDER_ADDR, + chain_id=61999, +) + def _make_client(): """SimpleNamespace stand-in for GenLayerClient — enough surface for @@ -59,20 +75,87 @@ def _last_tx(client): return client.local_account.sign_transaction.call_args.args[0] -def test_validator_join_no_operator_targets_staking_and_encodes_empty_args(): +def test_validator_join_targets_staking_and_encodes_proof(monkeypatch): client = _make_client() - staking_actions.validator_join(self=client, amount=10) + monkeypatch.setattr( + staking_actions, + "get_validator_join_context", + lambda self, account=None: JOIN_CONTEXT, + ) + monkeypatch.setattr( + staking_actions, + "verify_operator_registration", + lambda registration, context: registration is REGISTRATION + and context == JOIN_CONTEXT, + ) + + staking_actions.validator_join(self=client, amount=10, registration=REGISTRATION) tx = _last_tx(client) assert tx["to"].lower() == STAKING_ADDR.lower() assert tx["value"] == 10 - assert tx["data"][2:10] == SEL_VALIDATOR_JOIN_NO_ARGS + assert tx["data"][2:10] == SEL_VALIDATOR_JOIN + pub_key, proof = abi_decode( + ("uint256[2]", "bytes"), Web3.to_bytes(hexstr=tx["data"][10:]) + ) + assert pub_key == (1, 2) + assert proof == REGISTRATION.possession_proof -def test_validator_join_with_operator_encodes_address_variant(): +@pytest.mark.parametrize( + "kwargs", + ({}, {"operator": OTHER_ADDR}, {"registration": OTHER_ADDR}), +) +def test_validator_join_rejects_legacy_address_only_calls(kwargs): client = _make_client() - staking_actions.validator_join(self=client, amount=10, operator=OTHER_ADDR) - tx = _last_tx(client) - assert tx["data"][2:10] == SEL_VALIDATOR_JOIN_ADDR + with pytest.raises(GenLayerError, match="OperatorRegistrationProof"): + staking_actions.validator_join(self=client, amount=10, **kwargs) + client.local_account.sign_transaction.assert_not_called() + + +def test_validator_join_rejects_proof_for_the_wrong_context(monkeypatch): + client = _make_client() + monkeypatch.setattr( + staking_actions, + "get_validator_join_context", + lambda self, account=None: JOIN_CONTEXT, + ) + monkeypatch.setattr( + staking_actions, + "verify_operator_registration", + lambda registration, context: False, + ) + + with pytest.raises(GenLayerError, match="fresh proof"): + staking_actions.validator_join( + self=client, amount=10, registration=REGISTRATION + ) + client.local_account.sign_transaction.assert_not_called() + + +def test_validator_join_context_uses_factory_and_sender(monkeypatch): + staking = SimpleNamespace( + functions=SimpleNamespace( + addressManager=lambda: SimpleNamespace(call=lambda: ADDRESS_MANAGER_ADDR) + ) + ) + get_address = Mock(return_value=SimpleNamespace(call=lambda: FACTORY_ADDR)) + address_manager = SimpleNamespace( + functions=SimpleNamespace(getAddressNonZero=get_address) + ) + client = SimpleNamespace( + local_account=SimpleNamespace(address=SENDER_ADDR), + w3=SimpleNamespace( + to_checksum_address=Web3.to_checksum_address, + eth=SimpleNamespace( + chain_id=61999, + contract=Mock(return_value=address_manager), + ), + ), + ) + monkeypatch.setattr(staking_actions, "_staking", lambda self: staking) + + assert staking_actions.get_validator_join_context(client) == JOIN_CONTEXT + get_address.assert_called_once_with("ValidatorWalletFactory") def test_validator_deposit_targets_wallet_not_staking(): @@ -95,12 +178,13 @@ def test_validator_exit_routes_through_wallet(): assert tx["data"][2:10] == SEL_WALLET_EXIT -def test_set_operator_routes_through_wallet(): +def test_set_operator_fails_with_actionable_migration_without_sending(): client = _make_client() - staking_actions.set_operator(self=client, validator=WALLET_ADDR, operator=OTHER_ADDR) - tx = _last_tx(client) - assert tx["to"].lower() == WALLET_ADDR.lower() - assert tx["data"][2:10] == SEL_SET_OPERATOR + with pytest.raises(GenLayerError, match="initiate_operator_transfer"): + staking_actions.set_operator( + self=client, validator=WALLET_ADDR, operator=OTHER_ADDR + ) + client.local_account.sign_transaction.assert_not_called() def test_delegator_join_targets_staking_with_value(): @@ -122,11 +206,15 @@ def test_staking_not_configured_raises(): def test_abis_include_expected_functions(): """Guard against the bundled ABI JSON drifting or truncating.""" names = {e["name"] for e in STAKING_ABI if e.get("type") == "function"} - wallet_names = {e["name"] for e in VALIDATOR_WALLET_ABI if e.get("type") == "function"} + wallet_names = { + e["name"] for e in VALIDATOR_WALLET_ABI if e.get("type") == "function" + } assert { "epoch", - "activeValidators", - "activeValidatorsCount", + "selectableValidators", + "selectableValidatorsCount", + "validatorsJoinedCount", + "getValidatorsJoined", "isValidator", "validatorView", "stakeOf", @@ -137,6 +225,106 @@ def test_abis_include_expected_functions(): "delegatorExit", "delegatorClaim", }.issubset(names) - assert {"validatorDeposit", "validatorExit", "setOperator", "setIdentity"}.issubset( - wallet_names + assert { + "validatorDeposit", + "validatorExit", + "setOperatorPubKey", + "setIdentity", + }.issubset(wallet_names) + assert "setOperator" not in wallet_names + # Withdrawn from the staking contract: keeping them in the bundled ABI lets + # callers reach entrypoints that revert. + assert ( + not { + "activeValidators", + "activeValidatorsCount", + "activeWeights", + "validatorsRoot", + } + & names + ) + + +class _PagedStakingStub: + """Stands in for selectable and joined Staking reads.""" + + def __init__(self, registry, selectable=None, page_len=None): + self._registry = registry + self._selectable = registry if selectable is None else selectable + self._page_len = page_len + self.pages_requested = [] + self.functions = self + + def selectableValidators(self): + return SimpleNamespace(call=lambda: self._selectable) + + def selectableValidatorsCount(self): + return SimpleNamespace(call=lambda: len(self._selectable)) + + def validatorsJoinedCount(self): + return SimpleNamespace(call=lambda: len(self._registry)) + + def getValidatorsJoined(self, start, size): + self.pages_requested.append((start, size)) + take = self._page_len or size + return SimpleNamespace(call=lambda: self._registry[start : start + take]) + + +def _client_with_staking_stub(monkeypatch, stub): + client = _make_client() + monkeypatch.setattr(staking_actions, "_staking", lambda self: stub) + return client + + +def test_active_validators_are_strictly_selectable(monkeypatch): + joined_but_not_selectable = "0x" + "a1" * 20 + selectable = "0x" + "b2" * 20 + stub = _PagedStakingStub( + [joined_but_not_selectable, selectable], selectable=[selectable] ) + client = _client_with_staking_stub(monkeypatch, stub) + + assert staking_actions.active_validators(self=client) == [selectable] + assert staking_actions.active_validators_count(self=client) == 1 + assert stub.pages_requested == [] + + +def test_joined_validators_pages_the_registry(monkeypatch): + registry = [f"0x{str(i) * 40}" for i in range(1, 6)] + stub = _PagedStakingStub(registry, page_len=2) + client = _client_with_staking_stub(monkeypatch, stub) + + monkeypatch.setattr(staking_actions, "VALIDATORS_JOINED_PAGE_SIZE", 2) + result = staking_actions.joined_validators(self=client) + + assert result == registry + assert stub.pages_requested == [(0, 2), (2, 2), (4, 2)] + + +def test_joined_validators_stops_on_a_short_page(monkeypatch): + """An empty page means the registry shrank mid-walk: stop, do not spin.""" + stub = _PagedStakingStub([]) + stub._registry = ["0x" + "a1" * 20] + # Report a count far larger than what the pages actually yield. + stub.validatorsJoinedCount = lambda: SimpleNamespace(call=lambda: 500) + client = _client_with_staking_stub(monkeypatch, stub) + + result = staking_actions.joined_validators(self=client) + + assert result == ["0x" + "a1" * 20] + assert len(stub.pages_requested) == 2 + + +def test_joined_validators_filters_zero_address(monkeypatch): + zero = "0x" + "00" * 20 + stub = _PagedStakingStub(["0x" + "a1" * 20, zero]) + client = _client_with_staking_stub(monkeypatch, stub) + + assert staking_actions.joined_validators(self=client) == ["0x" + "a1" * 20] + + +def test_joined_validators_count_reads_the_registry(monkeypatch): + stub = _PagedStakingStub(["0x" + "a1" * 20, "0x" + "b2" * 20]) + client = _client_with_staking_stub(monkeypatch, stub) + + assert staking_actions.joined_validators_count(self=client) == 2 diff --git a/tests/unit/test_api_enum_docs.py b/tests/unit/test_api_enum_docs.py new file mode 100644 index 0000000..61f4293 --- /dev/null +++ b/tests/unit/test_api_enum_docs.py @@ -0,0 +1,59 @@ +from pathlib import Path + +import pytest + +from genlayer_py.types import ExecutionResult, VoteType + +PROJECT_ROOT = Path(__file__).resolve().parents[2] + + +@pytest.mark.parametrize( + "relative_path", + ( + "docs/api-references/api.md", + "docs/api-references/genlayer-py.md", + ), +) +@pytest.mark.parametrize( + ("enum_name", "enum_type"), + (("ExecutionResult", ExecutionResult), ("VoteType", VoteType)), +) +def test_public_enum_docs_are_generated_from_the_complete_train_enum( + relative_path, enum_name, enum_type +): + docs = (PROJECT_ROOT / relative_path).read_text() + + for member in enum_type: + assert f'{enum_name}.{member.name} = "{member.value}"' in docs + + +@pytest.mark.parametrize( + "relative_path", + ( + "docs/api-references/api.md", + "docs/api-references/genlayer-py.md", + ), +) +def test_advanced_lifecycle_enums_are_not_documented_as_primary_types(relative_path): + docs = (PROJECT_ROOT / relative_path).read_text() + + assert "### TransactionStatus" not in docs + assert "### ResolutionAction" not in docs + + +@pytest.mark.parametrize( + "relative_path", + ( + "README.md", + "docs/api-references/api.md", + "docs/api-references/genlayer-py.md", + "docs/api-references/index.md", + ), +) +def test_public_lifecycle_docs_use_state_as_the_discriminator(relative_path): + docs = (PROJECT_ROOT / relative_path).read_text() + + assert "state" in docs + assert '{"status": "processing"' not in docs + assert '{"status": "decided"' not in docs + assert 'lifecycle"]["status' not in docs diff --git a/tests/unit/test_bug_hunt_v019.py b/tests/unit/test_bug_hunt_v019.py index b0e3485..882bb5f 100644 --- a/tests/unit/test_bug_hunt_v019.py +++ b/tests/unit/test_bug_hunt_v019.py @@ -25,16 +25,12 @@ def test_create_client_endpoint_does_not_mutate_caller_chain_config(): with patch.object(GenLayerClient, "initialize_consensus_smart_contract"): client = create_client(chain=chain, endpoint="http://override.invalid:8545") - assert client.chain.rpc_urls["default"]["http"] == [ - "http://override.invalid:8545" - ] + assert client.chain.rpc_urls["default"]["http"] == ["http://override.invalid:8545"] assert chain.rpc_urls["default"]["http"] == original_endpoints def test_read_contract_uses_explicit_account_when_client_has_no_default(): - account = SimpleNamespace( - address="0x1111111111111111111111111111111111111111" - ) + account = SimpleNamespace(address="0x1111111111111111111111111111111111111111") provider = Mock() provider.make_request.return_value = {"result": ""} client = SimpleNamespace(local_account=None, provider=provider) @@ -62,7 +58,7 @@ def test_calldata_decoder_rejects_truncated_length_prefixed_bytes(): def test_is_successful_recognizes_localnet_consensus_receipt(): transaction = { - "status_name": "FINALIZED", + "lifecycle": {"state": "finalized"}, "consensus_data": { "leader_receipt": [ { diff --git a/tests/unit/test_train_abi_surfaces.py b/tests/unit/test_train_abi_surfaces.py new file mode 100644 index 0000000..43f6946 --- /dev/null +++ b/tests/unit/test_train_abi_surfaces.py @@ -0,0 +1,92 @@ +import hashlib +import json + +import genlayer_py.staking as staking +from genlayer_py.consensus.abi import ( + APPEALS_ABI, + CONSENSUS_DATA_ABI, + CONSENSUS_DATA_ABI_V06, + CONSENSUS_MAIN_ABI, + CONSENSUS_MAIN_ABI_V06, +) +from genlayer_py.staking.abi import STAKING_ABI, VALIDATOR_WALLET_ABI + +# Hashes of the recursively canonicalized function surfaces generated from the +# exact consensus train artifacts at 42ea0aaf7aed9b1426681c37ee046154e22df163. +# This covers every nested tuple component, not just top-level selectors or +# function names. +EXPECTED_TRAIN_FUNCTION_SURFACE_HASHES = { + "ConsensusData": "3a7d39f4ed6c6aaa8dc1cfd5035387191f68c737ba499cd9732cf89fc97b7d34", + "ConsensusMain": "6542ed4ac55be2cdb85d190d2bc9e7e04d13a707cea9d89bde2e53feb2586ed5", + "Appeals": "7ff07eb47a1e801645e55141bcf75aaae022d46f06c8a94f29806a9fc61a0857", + "IGenLayerStaking": "1fd78e63d480800d93d41d3f5bdfd17f572bc5f394cccc7c796098f5ce8156b4", + "ValidatorWalletBlueprint": "6960726132fd77007eec8a90f036ef4be8d8efdcb6c6b79136c8835bb0b17800", +} + + +def _canonical_parameter(parameter): + canonical = { + "name": parameter.get("name", ""), + "type": parameter["type"], + } + if parameter["type"].startswith("tuple"): + canonical["components"] = [ + _canonical_parameter(component) + for component in parameter.get("components", []) + ] + return canonical + + +def _function_surface_hash(abi): + functions = [ + { + "name": entry["name"], + "stateMutability": entry.get("stateMutability"), + "inputs": [ + _canonical_parameter(parameter) for parameter in entry.get("inputs", []) + ], + "outputs": [ + _canonical_parameter(parameter) + for parameter in entry.get("outputs", []) + ], + } + for entry in abi + if entry.get("type") == "function" + ] + functions.sort( + key=lambda entry: json.dumps(entry, sort_keys=True, separators=(",", ":")) + ) + encoded = json.dumps(functions, sort_keys=True, separators=(",", ":")).encode() + return hashlib.sha256(encoded).hexdigest() + + +def test_bundled_function_surfaces_match_the_exact_consensus_train(): + bundled = { + "ConsensusData": CONSENSUS_DATA_ABI, + "ConsensusMain": CONSENSUS_MAIN_ABI, + "Appeals": APPEALS_ABI, + "IGenLayerStaking": STAKING_ABI, + "ValidatorWalletBlueprint": VALIDATOR_WALLET_ABI, + } + + assert { + name: _function_surface_hash(abi) for name, abi in bundled.items() + } == EXPECTED_TRAIN_FUNCTION_SURFACE_HASHES + + +def test_historical_consensus_abi_imports_are_train_only_aliases(): + assert CONSENSUS_DATA_ABI_V06 is CONSENSUS_DATA_ABI + assert CONSENSUS_MAIN_ABI_V06 is CONSENSUS_MAIN_ABI + + +def test_staking_package_exports_the_proof_based_join_helpers(): + expected = { + "get_validator_join_context", + "OperatorRegistrationContext", + "OperatorRegistrationProof", + "create_operator_registration", + "verify_operator_registration", + } + + assert expected.issubset(staking.__all__) + assert all(hasattr(staking, name) for name in expected) diff --git a/tests/unit/transactions/test_transaction_data_read.py b/tests/unit/transactions/test_transaction_data_read.py new file mode 100644 index 0000000..ee15ab2 --- /dev/null +++ b/tests/unit/transactions/test_transaction_data_read.py @@ -0,0 +1,563 @@ +"""Train-only transaction reads use bounded surfaces at one block snapshot.""" + +from types import SimpleNamespace +from unittest.mock import Mock, call + +import genlayer_py.transactions.actions as transaction_actions +import pytest +from genlayer_py.consensus.abi import ( + CONSENSUS_DATA_ABI, + CONSENSUS_DATA_ABI_V06, + CONSENSUS_DATA_BIG_ROUNDS_ABI, + CONSENSUS_MAIN_ABI, + CONSENSUS_MAIN_ABI_V06, + ROUNDS_STORAGE_READ_ABI, + TRANSACTION_MANAGER_READ_ABI, +) +from genlayer_py.types import ( + EXECUTION_RESULT_NUMBER_TO_NAME, + VOTE_TYPE_NUMBER_TO_NAME, + ExecutionResult, + VoteType, +) +from genlayer_py.types.transactions import ( + ProtocolTransactionStatus, + ResolutionAction, + ResolutionSource, +) +from genlayer_py.chains import localnet + +TX_HASH = "0x" + "ab" * 32 +CONSENSUS_DATA_ADDRESS = "0x" + "11" * 20 +ADDRESS_MANAGER_ADDRESS = "0x" + "22" * 20 +BIG_ROUNDS_ADDRESS = "0x" + "33" * 20 +TRANSACTION_MANAGER_ADDRESS = "0x" + "44" * 20 +ROUNDS_STORAGE_ADDRESS = "0x" + "55" * 20 +VALIDATORS = ["0x" + f"{index:040x}" for index in range(1, 4)] +CONSUMED_VALIDATORS = ["0x" + f"{index:040x}" for index in range(4, 6)] + + +class _Call: + def __init__(self, value, calls, name, args): + self._value = value + self._calls = calls + self._name = name + self._args = args + + def call(self, block_identifier=None): + self._calls.append((self._name, self._args, block_identifier)) + return self._value() if callable(self._value) else self._value + + +class _Contract: + def __init__(self, handlers): + self._handlers = handlers + self.calls = [] + self.functions = self + + def __getattr__(self, name): + def function(*args): + value = self._handlers[name](*args) + return _Call(value, self.calls, name, args) + + return function + + +def _light_transaction(): + return ( + 1_000, + "0x" + "66" * 20, + "0x" + "77" * 20, + 3, + 4, + 900, + 950, + bytes.fromhex("88" * 32), + 1, + bytes.fromhex("99" * 32), + b"", + b"", + [], + 0, + 2, + "0x" + "aa" * 20, + VALIDATORS[0], + 5, + bytes.fromhex("ab" * 32), + (10, 11, 12), + 0, + (0, 0, 2, 2, 0, 1, 1, len(VALIDATORS)), + len(CONSUMED_VALIDATORS), + ) + + +def _client_and_contracts(): + manager = _Contract( + { + "getAddressNonZero": lambda name: { + "ConsensusDataBigRounds": BIG_ROUNDS_ADDRESS, + "TransactionManager": TRANSACTION_MANAGER_ADDRESS, + "RoundsStorage": ROUNDS_STORAGE_ADDRESS, + }[name] + } + ) + big_rounds = _Contract( + { + "getStoredTransactionDataLight": lambda tx_id: _light_transaction(), + "getRoundValidatorsPaged": lambda tx_id, round_number, offset, limit: ( + VALIDATORS[offset : offset + limit], + len(VALIDATORS), + ), + "getConsumedValidatorsPaged": lambda tx_id, offset, limit: ( + CONSUMED_VALIDATORS[offset : offset + limit], + len(CONSUMED_VALIDATORS), + ), + } + ) + transaction_manager = _Contract( + { + "getTxExecutionResult": lambda tx_id: 1, + "getNumOfInitialValidators": lambda tx_id: 5, + } + ) + rounds_storage = _Contract( + { + "getValidatorVotes": lambda tx_id, round_number: [1, 2, 3], + "getValidatorVotesHash": lambda tx_id, round_number: [ + bytes.fromhex("01" * 32), + bytes.fromhex("02" * 32), + bytes.fromhex("03" * 32), + ], + "getValidatorResultHash": lambda tx_id, round_number: [ + bytes.fromhex("11" * 32), + bytes.fromhex("12" * 32), + bytes.fromhex("13" * 32), + ], + } + ) + resolution = ( + TX_HASH, + 5, + 6, + 6, + 1, + bytes(32), + 6, + 0, + 0, + bytes(32), + bytes(32), + 0, + 0, + 0, + 0, + bytes(32), + 0, + 1_000, + ) + latest_decision = (True, 42) + consensus_data = _Contract( + { + "addressManager": lambda: ADDRESS_MANAGER_ADDRESS, + "getTransactionLifecycle": lambda tx_id, timestamp: ( + 5, + resolution, + latest_decision, + True, + ), + "canFinalize": lambda tx_id, timestamp, decision_id: (True, 1_000, 999), + } + ) + contracts = { + CONSENSUS_DATA_ADDRESS: consensus_data, + ADDRESS_MANAGER_ADDRESS: manager, + BIG_ROUNDS_ADDRESS: big_rounds, + TRANSACTION_MANAGER_ADDRESS: transaction_manager, + ROUNDS_STORAGE_ADDRESS: rounds_storage, + } + eth = SimpleNamespace( + block_number=123, + contract=lambda address, abi: contracts[address], + ) + client = SimpleNamespace( + chain=SimpleNamespace( + id=4221, + consensus_data_contract={ + "address": CONSENSUS_DATA_ADDRESS, + "abi": [], + }, + ), + w3=SimpleNamespace(eth=eth), + ) + return client, contracts + + +def test_train_transaction_read_composes_light_and_split_array_surfaces(monkeypatch): + client, contracts = _client_and_contracts() + monkeypatch.setattr(transaction_actions, "TRANSACTION_ARRAY_PAGE_SIZE", 2) + + result = transaction_actions._read_train_transaction_data( + client, + contracts[CONSENSUS_DATA_ADDRESS], + TX_HASH, + 123, + ) + + ( + tx_data, + validators, + votes, + vote_hashes, + result_hashes, + consumed_validators, + execution_result, + num_of_initial_validators, + ) = result + assert tx_data == _light_transaction() + assert validators == VALIDATORS + assert votes == [1, 2, 3] + assert vote_hashes[0] == bytes.fromhex("01" * 32) + assert result_hashes[0] == bytes.fromhex("11" * 32) + assert consumed_validators == CONSUMED_VALIDATORS + assert execution_result == 1 + assert num_of_initial_validators == 5 + assert [ + call[1][2] + for call in contracts[BIG_ROUNDS_ADDRESS].calls + if call[0] == "getRoundValidatorsPaged" + ] == [0, 2] + assert [ + call[1][1] + for call in contracts[BIG_ROUNDS_ADDRESS].calls + if call[0] == "getConsumedValidatorsPaged" + ] == [0] + assert all( + block == 123 + for contract in contracts.values() + for _, _, block in contract.calls + ) + assert not any( + name == "getTransactionAllData" + for contract in contracts.values() + for name, _, _ in contract.calls + ) + + +def test_get_transaction_exposes_only_stored_consumer_lifecycle(monkeypatch): + client, contracts = _client_and_contracts() + monkeypatch.setattr( + transaction_actions, "_decode_triggered_txs", lambda self, tx: [] + ) + + result = transaction_actions.get_transaction(client, TX_HASH) + + assert result["lifecycle"] == {"state": "decided", "outcome": "accepted"} + assert "status" not in result + assert "status_name" not in result + assert "stored_status" not in result + assert "resolution_action" not in result + assert "can_finalize" not in result + assert result["last_round"]["round_validators"] == VALIDATORS + assert result["last_round"]["validator_votes"] == [1, 2, 3] + assert result["last_round"]["validator_result_hash"] == [ + "0x" + "11" * 32, + "0x" + "12" * 32, + "0x" + "13" * 32, + ] + assert result["consumed_validators"] == CONSUMED_VALIDATORS + assert result["tx_execution_hash"] == "0x" + "99" * 32 + assert result["tx_receipt"] is None + assert result["tx_execution_result_name"] == "FINISHED_WITH_RETURN" + assert result["num_of_initial_validators"] == "5" + assert result["initial_rotations"] == "3" + + lifecycle_calls = contracts[CONSENSUS_DATA_ADDRESS].calls + assert not any(call[0] == "getTransactionLifecycle" for call in lifecycle_calls) + assert not any(call[0] == "canFinalize" for call in lifecycle_calls) + + +def test_advanced_transaction_lifecycle_keeps_projection_explicit(): + client, contracts = _client_and_contracts() + + result = transaction_actions.get_transaction_lifecycle(client, TX_HASH) + + assert result == { + "stored_status": 5, + "stored_status_name": ProtocolTransactionStatus.ACCEPTED, + "projected_status": 6, + "projected_status_name": ProtocolTransactionStatus.UNDETERMINED, + "resolution_action": 6, + "resolution_action_name": ResolutionAction.FINALIZE, + "resolution_source": 6, + "resolution_source_name": ResolutionSource.FULL_REVEAL, + "decision_id": "42", + "decision_active": True, + "evaluated_at": 1_000, + } + lifecycle_calls = contracts[CONSENSUS_DATA_ADDRESS].calls + assert ("getTransactionLifecycle", (TX_HASH, 0), 123) in lifecycle_calls + assert not any(call[0] == "canFinalize" for call in lifecycle_calls) + + +def test_local_transaction_lifecycle_decodes_the_exact_node_rpc_schema(): + provider = Mock() + provider.make_request.return_value = { + "result": { + "storedStatus": "Accepted", + "storedStatusCode": 5, + "projectedStatus": "Undetermined", + "projectedStatusCode": 6, + "resolutionAction": "Finalize", + "resolutionActionCode": 6, + "resolutionSource": "FullReveal", + "resolutionSourceCode": 6, + "decisionId": "42", + "decisionActive": True, + "evaluatedAt": 1_000, + } + } + client = SimpleNamespace( + chain=SimpleNamespace(id=localnet.id), + provider=provider, + ) + + result = transaction_actions.get_transaction_lifecycle( + client, bytes.fromhex("ab" * 32), timestamp=999 + ) + + assert result == { + "stored_status": 5, + "stored_status_name": ProtocolTransactionStatus.ACCEPTED, + "projected_status": 6, + "projected_status_name": ProtocolTransactionStatus.UNDETERMINED, + "resolution_action": 6, + "resolution_action_name": ResolutionAction.FINALIZE, + "resolution_source": 6, + "resolution_source_name": ResolutionSource.FULL_REVEAL, + "decision_id": "42", + "decision_active": True, + "evaluated_at": 1_000, + } + provider.make_request.assert_called_once_with( + method="gen_getTransactionLifecycle", + params=[{"txId": TX_HASH, "timestamp": 999}], + ) + + +def test_local_transaction_lifecycle_rejects_code_name_drift(): + provider = Mock() + provider.make_request.return_value = { + "result": { + "storedStatus": "Finalized", + "storedStatusCode": 5, + "projectedStatus": "Undetermined", + "projectedStatusCode": 6, + "resolutionAction": "Finalize", + "resolutionActionCode": 6, + "resolutionSource": "FullReveal", + "resolutionSourceCode": 6, + "decisionId": None, + "decisionActive": False, + "evaluatedAt": 1_000, + } + } + client = SimpleNamespace( + chain=SimpleNamespace(id=localnet.id), + provider=provider, + ) + + with pytest.raises(transaction_actions.GenLayerError, match="storedStatus"): + transaction_actions.get_transaction_lifecycle(client, TX_HASH) + + +def test_local_transaction_lifecycle_uses_stored_status_when_rpc_is_absent(): + provider = Mock() + provider.make_request.side_effect = [ + {"error": {"code": -32601, "message": "Method not found"}}, + {"result": {"status": "ACCEPTED"}}, + ] + client = SimpleNamespace( + chain=SimpleNamespace(id=localnet.id), + provider=provider, + ) + + result = transaction_actions.get_transaction_lifecycle( + client, bytes.fromhex("ab" * 32), timestamp=999 + ) + + assert result == { + "stored_status": 5, + "stored_status_name": ProtocolTransactionStatus.ACCEPTED, + "projected_status": 5, + "projected_status_name": ProtocolTransactionStatus.ACCEPTED, + "resolution_action": 0, + "resolution_action_name": ResolutionAction.NO_OP, + "resolution_source": 0, + "resolution_source_name": ResolutionSource.UNSPECIFIED, + "decision_id": None, + "decision_active": False, + "evaluated_at": 999, + } + assert provider.make_request.call_args_list == [ + call( + method="gen_getTransactionLifecycle", + params=[{"txId": TX_HASH, "timestamp": 999}], + ), + call(method="eth_getTransactionByHash", params=[TX_HASH]), + ] + + +def test_local_transaction_lifecycle_maps_activated_to_pending(): + provider = Mock() + provider.make_request.side_effect = [ + {"error": {"code": -32601, "message": "Method not found"}}, + {"result": {"status": "ACTIVATED"}}, + ] + client = SimpleNamespace( + chain=SimpleNamespace(id=localnet.id), + provider=provider, + ) + + result = transaction_actions.get_transaction_lifecycle(client, TX_HASH) + + assert result["stored_status_name"] == ProtocolTransactionStatus.PENDING + assert result["projected_status_name"] == ProtocolTransactionStatus.PENDING + assert result["decision_active"] is False + + +def test_local_transaction_lifecycle_does_not_hide_real_rpc_failures(): + provider = Mock() + provider.make_request.return_value = { + "error": {"code": -32000, "message": "execution reverted"} + } + client = SimpleNamespace( + chain=SimpleNamespace(id=localnet.id), + provider=provider, + ) + + with pytest.raises(transaction_actions.GenLayerError, match="execution reverted"): + transaction_actions.get_transaction_lifecycle(client, TX_HASH) + + provider.make_request.assert_called_once() + + +def test_packaged_consensus_abis_expose_only_the_train_lifecycle_signature(): + for abi in (CONSENSUS_DATA_ABI, CONSENSUS_DATA_ABI_V06): + functions = { + entry["name"]: entry for entry in abi if entry.get("type") == "function" + } + assert "getTransactionData" not in functions + assert "getStoredTransactionData" in functions + assert "getTransactionLifecycle" in functions + assert len(functions["canFinalize"]["inputs"]) == 3 + transaction_components = functions["getTransactionAllData"]["outputs"][0][ + "components" + ] + assert transaction_components[2]["name"] == "status" + assert transaction_components[-1]["name"] == "queueContext" + + big_round_functions = { + entry["name"] + for entry in CONSENSUS_DATA_BIG_ROUNDS_ABI + if entry.get("type") == "function" + } + + for abi in (CONSENSUS_MAIN_ABI, CONSENSUS_MAIN_ABI_V06): + functions = { + entry["name"]: entry for entry in abi if entry.get("type") == "function" + } + assert [item["type"] for item in functions["addTransaction"]["inputs"]] == [ + "tuple" + ] + assert [item["type"] for item in functions["deploySalted"]["inputs"]] == [ + "tuple" + ] + assert [item["type"] for item in functions["topUpFees"]["inputs"]] == [ + "bytes32", + "tuple", + ] + assert [ + item["type"] for item in functions["topUpAndSubmitAppeal"]["inputs"] + ] == ["bytes32", "uint256", "tuple"] + assert [item["type"] for item in functions["submitAppeal"]["inputs"]] == [ + "bytes32", + "uint256", + ] + assert [ + item["type"] for item in functions["finalizeTransaction"]["inputs"] + ] == ["bytes32", "uint256"] + add_params = functions["addTransaction"]["inputs"][0]["components"] + assert [item["type"] for item in add_params] == [ + "address", + "address", + "uint256", + "uint256", + "uint256", + "uint256", + "uint256", + "tuple", + "bytes", + "tuple[]", + ] + assert [item["type"] for item in add_params[7]["components"]] == [ + "uint256", + "uint256", + "uint256", + "uint256", + "uint256", + "uint256", + "uint256[]", + "uint256", + "uint256", + "uint256", + ] + assert [item["type"] for item in add_params[9]["components"]] == [ + "uint8", + "bool", + "uint256", + "address", + "bytes32", + "uint256", + "bytes", + ] + assert big_round_functions == { + "getStoredTransactionDataLight", + "getRoundValidatorsPaged", + "getConsumedValidatorsPaged", + } + + rounds_storage_functions = { + entry["name"] + for entry in ROUNDS_STORAGE_READ_ABI + if entry.get("type") == "function" + } + assert rounds_storage_functions == { + "getValidatorVotes", + "getValidatorVotesHash", + "getValidatorResultHash", + } + + transaction_manager_functions = { + entry["name"] + for entry in TRANSACTION_MANAGER_READ_ABI + if entry.get("type") == "function" + } + assert transaction_manager_functions == { + "getTxExecutionResult", + "getNumOfInitialValidators", + } + + +def test_train_vote_and_execution_enums_cover_every_contract_ordinal(): + expected = { + "0": VoteType.NOT_VOTED, + "1": VoteType.FINISHED_WITH_RETURN, + "2": VoteType.FINISHED_WITH_ERROR, + "3": VoteType.TIMEOUT, + "4": VoteType.NONDET_DISAGREE, + "5": VoteType.DETERMINISTIC_VIOLATION, + } + assert VOTE_TYPE_NUMBER_TO_NAME == expected + assert EXECUTION_RESULT_NUMBER_TO_NAME == { + ordinal: ExecutionResult(member.value) for ordinal, member in expected.items() + } diff --git a/tests/unit/transactions/test_transaction_lifecycle.py b/tests/unit/transactions/test_transaction_lifecycle.py new file mode 100644 index 0000000..7efba8b --- /dev/null +++ b/tests/unit/transactions/test_transaction_lifecycle.py @@ -0,0 +1,124 @@ +import genlayer_py +import genlayer_py.types as public_types +import pytest +from types import SimpleNamespace + +from genlayer_py.chains import localnet +from genlayer_py.transactions.actions import get_transaction +from genlayer_py.types.transactions import ( + CanceledTransactionLifecycle, + DecidedTransactionLifecycle, + FinalizedTransactionLifecycle, + ProcessingTransactionLifecycle, + PROTOCOL_TRANSACTION_STATUS_NUMBER_TO_NAME, + ProtocolTransactionStatus, + ResolutionAction, + ResolutionSource, + transaction_lifecycle_from_protocol_status, + transaction_outcome_from_protocol_result, +) + +EXPECTED_LIFECYCLES = { + 0: {"state": "processing", "phase": "uninitialized"}, + 1: {"state": "processing", "phase": "pending"}, + 2: {"state": "processing", "phase": "proposing"}, + 3: {"state": "processing", "phase": "committing"}, + 4: {"state": "processing", "phase": "revealing"}, + 5: {"state": "decided", "outcome": "accepted"}, + 6: {"state": "decided", "outcome": "undetermined"}, + 7: {"state": "finalized"}, + 8: {"state": "canceled"}, + 9: {"state": "processing", "phase": "appeal_revealing"}, + 10: {"state": "processing", "phase": "appeal_committing"}, + 11: {"state": "decided", "outcome": "validators_timeout"}, + 12: {"state": "decided", "outcome": "leader_timeout"}, + 13: {"state": "processing", "phase": "leader_revealing"}, +} + + +@pytest.mark.parametrize("protocol_status, expected", EXPECTED_LIFECYCLES.items()) +def test_every_protocol_status_has_one_public_lifecycle(protocol_status, expected): + assert transaction_lifecycle_from_protocol_status(protocol_status) == expected + assert transaction_lifecycle_from_protocol_status(str(protocol_status)) == expected + assert ( + transaction_lifecycle_from_protocol_status( + PROTOCOL_TRANSACTION_STATUS_NUMBER_TO_NAME[str(protocol_status)] + ) + == expected + ) + + +@pytest.mark.parametrize("value", [-1, 14, "unknown"]) +def test_unknown_or_removed_protocol_status_is_rejected(value): + with pytest.raises(ValueError, match="Unknown protocol transaction status"): + transaction_lifecycle_from_protocol_status(value) + + +def test_public_lifecycle_is_a_discriminated_union(): + assert ProcessingTransactionLifecycle.__required_keys__ == {"state", "phase"} + assert DecidedTransactionLifecycle.__required_keys__ == {"state", "outcome"} + assert FinalizedTransactionLifecycle.__required_keys__ == {"state"} + assert FinalizedTransactionLifecycle.__optional_keys__ == {"outcome"} + assert CanceledTransactionLifecycle.__required_keys__ == {"state"} + + +@pytest.mark.parametrize( + "protocol_result, expected", + [ + (0, None), + (1, "accepted"), + (2, "undetermined"), + (3, "validators_timeout"), + (4, "undetermined"), + (5, "undetermined"), + ], +) +def test_finalized_outcome_is_added_only_when_the_result_proves_it( + protocol_result, expected +): + assert transaction_outcome_from_protocol_result(protocol_result) == expected + + +def test_raw_protocol_types_are_advanced_only(): + assert not hasattr(genlayer_py, "ResolutionAction") + assert not hasattr(genlayer_py, "ProtocolTransactionStatus") + assert not hasattr(public_types, "ResolutionAction") + assert not hasattr(public_types, "ResolutionSource") + assert not hasattr(public_types, "ProtocolTransactionStatus") + assert len(ProtocolTransactionStatus) == 14 + assert len(ResolutionSource) == 12 + assert ResolutionAction.FINALIZE.value == "Finalize" + + +@pytest.mark.parametrize( + "raw_transaction, expected", + [ + ( + {"status": "ACTIVATED", "data": None}, + {"state": "processing", "phase": "pending"}, + ), + ( + { + "status": "FINALIZED", + "result_name": "MAJORITY_AGREE", + "data": None, + }, + {"state": "finalized", "outcome": "accepted"}, + ), + ], +) +def test_local_transaction_runtime_exposes_only_public_lifecycle( + raw_transaction, expected +): + client = SimpleNamespace( + chain=SimpleNamespace(id=localnet.id), + provider=SimpleNamespace( + make_request=lambda method, params: {"result": dict(raw_transaction)} + ), + ) + + transaction = get_transaction(client, "0x" + "ab" * 32) + + assert transaction["lifecycle"] == expected + assert "status" not in transaction + assert "status_name" not in transaction diff --git a/tests/unit/transactions/test_wait_for_transaction_receipt.py b/tests/unit/transactions/test_wait_for_transaction_receipt.py index 6a3a7f0..48d4518 100644 --- a/tests/unit/transactions/test_wait_for_transaction_receipt.py +++ b/tests/unit/transactions/test_wait_for_transaction_receipt.py @@ -1,299 +1,159 @@ import pytest from unittest.mock import patch from genlayer_py.transactions.actions import ( + wait_for_decision, + wait_for_finalization, wait_for_transaction_receipt, _simplify_transaction_receipt, is_successful, ) -from genlayer_py.types import ( - ExecutionResult, - TransactionStatus, - DECIDED_STATES, - TRANSACTION_STATUS_NUMBER_TO_NAME, - is_decided_state, -) +from genlayer_py.types import ExecutionResult from genlayer_py.exceptions import GenLayerError +TX_HASH = "0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6" -class TestWaitForTransactionReceipt: - """Test suite for wait_for_transaction_receipt function""" - def test_wait_for_finalized_transaction_success( - self, mock_client, full_write_transaction_data - ): - """Test successful wait for finalized transaction""" - mock_client.get_transaction.return_value = full_write_transaction_data - - result = wait_for_transaction_receipt( - self=mock_client, - transaction_hash="0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", - status=TransactionStatus.FINALIZED, - full_transaction=True, - ) +def _transaction(lifecycle, **extra): + return {"hash": TX_HASH, "lifecycle": lifecycle, **extra} - assert result == full_write_transaction_data - mock_client.get_transaction.assert_called_once() - def test_wait_for_accepted_transaction_with_finalized_status( - self, mock_client, full_write_transaction_data +class TestTransactionWaits: + @pytest.mark.parametrize( + "lifecycle", + [ + {"state": "decided", "outcome": "accepted"}, + {"state": "decided", "outcome": "undetermined"}, + {"state": "decided", "outcome": "validators_timeout"}, + {"state": "decided", "outcome": "leader_timeout"}, + {"state": "finalized"}, + {"state": "canceled"}, + ], + ) + def test_wait_for_decision_uses_materialized_lifecycle( + self, mock_client, lifecycle ): - """Test that ACCEPTED status accepts FINALIZED transactions""" - mock_client.get_transaction.return_value = full_write_transaction_data - - result = wait_for_transaction_receipt( - self=mock_client, - transaction_hash="0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", - status=TransactionStatus.ACCEPTED, # Requesting ACCEPTED - full_transaction=True, + transaction = _transaction(lifecycle) + mock_client.get_transaction.return_value = transaction + + assert ( + wait_for_decision(mock_client, TX_HASH, full_transaction=True) + == transaction ) - # Should accept FINALIZED (status 7) when requesting ACCEPTED - assert result == full_write_transaction_data + def test_wait_for_finalization_ignores_nonfinal_stored_state(self, mock_client): + processing = _transaction({"state": "processing", "phase": "pending"}) + decided = _transaction({"state": "decided", "outcome": "accepted"}) + finalized = _transaction({"state": "finalized"}) + mock_client.get_transaction.side_effect = [processing, decided, finalized] - def test_wait_for_transaction_with_simplified_receipt( - self, mock_client, full_write_transaction_data - ): - """Test wait for transaction with simplified receipt (full_transaction=False)""" - mock_client.get_transaction.return_value = full_write_transaction_data - - with patch( - "genlayer_py.transactions.actions._simplify_transaction_receipt" - ) as mock_simplify: - simplified_data = {"hash": "0x123", "status": 7, "simplified": True} - mock_simplify.return_value = simplified_data - - result = wait_for_transaction_receipt( - self=mock_client, - transaction_hash="0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", - full_transaction=False, + with patch("time.sleep") as sleep: + result = wait_for_finalization( + mock_client, TX_HASH, interval=100, full_transaction=True ) - mock_simplify.assert_called_once_with(full_write_transaction_data) - assert result == simplified_data + assert result == finalized + assert mock_client.get_transaction.call_count == 3 + assert sleep.call_count == 2 + sleep.assert_called_with(0.1) - def test_wait_for_transaction_timeout(self, mock_client, pending_transaction_data): - """Test timeout when transaction doesn't reach desired status""" - mock_client.get_transaction.return_value = pending_transaction_data + def test_receipt_default_waits_for_decision_and_simplifies(self, mock_client): + transaction = _transaction({"state": "decided", "outcome": "accepted"}) + mock_client.get_transaction.return_value = transaction + simplified = {"hash": TX_HASH, "lifecycle": transaction["lifecycle"]} - with pytest.raises(GenLayerError, match="did not reach desired status"): - wait_for_transaction_receipt( - self=mock_client, - transaction_hash="0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", - retries=2, - interval=1, # 1ms for fast test - ) + with patch( + "genlayer_py.transactions.actions._simplify_transaction_receipt", + return_value=simplified, + ) as simplify: + result = wait_for_transaction_receipt(mock_client, TX_HASH) - # Should have tried 2 times - assert mock_client.get_transaction.call_count == 2 + assert result == simplified + simplify.assert_called_once_with(transaction) - def test_wait_for_nonexistent_transaction(self, mock_client): - """Test error when transaction doesn't exist""" - mock_client.get_transaction.return_value = None + def test_receipt_can_wait_for_finalization(self, mock_client): + transaction = _transaction({"state": "finalized"}) + mock_client.get_transaction.return_value = transaction - with pytest.raises(GenLayerError, match="Transaction .* not found"): + assert ( wait_for_transaction_receipt( - self=mock_client, - transaction_hash="0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", + mock_client, + TX_HASH, + wait_until="finalized", + full_transaction=True, ) + == transaction + ) - @patch("time.sleep") - def test_wait_for_transaction_with_retry_logic( - self, - mock_sleep, - mock_client, - pending_transaction_data, - full_write_transaction_data, - ): - """Test retry logic with eventual success""" - # First two calls return pending, third returns finalized - mock_client.get_transaction.side_effect = [ - pending_transaction_data, - pending_transaction_data, - full_write_transaction_data, - ] - - result = wait_for_transaction_receipt( - self=mock_client, - transaction_hash="0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", - interval=100, # 100ms - full_transaction=True, + def test_processing_timeout_reports_public_phase(self, mock_client): + mock_client.get_transaction.return_value = _transaction( + {"state": "processing", "phase": "leader_revealing"} ) - assert result == full_write_transaction_data - assert mock_client.get_transaction.call_count == 3 - assert mock_sleep.call_count == 2 - mock_sleep.assert_called_with(0.1) # 100ms / 1000 + with pytest.raises( + GenLayerError, match="Last observed lifecycle state: 'processing'" + ): + wait_for_decision(mock_client, TX_HASH, retries=1, interval=1) - def test_wait_for_transaction_with_custom_parameters( - self, mock_client, full_write_transaction_data - ): - """Test with custom interval and retries""" - mock_client.get_transaction.return_value = full_write_transaction_data - - result = wait_for_transaction_receipt( - self=mock_client, - transaction_hash="0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", - status=TransactionStatus.FINALIZED, - interval=500, - retries=10, - full_transaction=True, - ) + def test_wait_for_finalization_fails_fast_when_canceled(self, mock_client): + mock_client.get_transaction.return_value = _transaction({"state": "canceled"}) - assert result == full_write_transaction_data - - def test_wait_for_accepted_with_all_decided_states(self, mock_client): - """Test that ACCEPTED status accepts all decided states""" - decided_statuses = ["5", "6", "8", "7", "12", "13"] # ACCEPTED, UNDETERMINED, CANCELED, FINALIZED, VALIDATORS_TIMEOUT, LEADER_TIMEOUT - - for status_num in decided_statuses: - mock_transaction = { - "hash": "0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", - "status": status_num, - "status_name": "test_status", - "from_address": "0x123", - "to_address": "0x456", - "value": "0", - "gaslimit": "1000000", - "nonce": "1", - "created_at": "2023-01-01T00:00:00Z", - } - - mock_client.get_transaction.return_value = mock_transaction - - result = wait_for_transaction_receipt( - self=mock_client, - transaction_hash="0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", - status=TransactionStatus.ACCEPTED, - full_transaction=True, - ) - - assert result == mock_transaction - - def test_wait_until_decided_resolves_on_undetermined(self, mock_client): - mock_transaction = { - "hash": "0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", - "status": "6", - "status_name": "UNDETERMINED", - } - mock_client.get_transaction.return_value = mock_transaction + with pytest.raises(GenLayerError, match="canceled before finalization"): + wait_for_finalization(mock_client, TX_HASH) - result = wait_for_transaction_receipt( - self=mock_client, - transaction_hash="0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", - wait_until="decided", - full_transaction=True, - ) + mock_client.get_transaction.assert_called_once() - assert result == mock_transaction + def test_nonexistent_transaction(self, mock_client): + mock_client.get_transaction.return_value = None - def test_status_14_does_not_crash_wait_loop(self, mock_client): - mock_transaction = { - "hash": "0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", - "status": "14", - "status_name": "LEADER_REVEALING", - } - mock_client.get_transaction.return_value = mock_transaction + with pytest.raises(GenLayerError, match="Transaction .* not found"): + wait_for_decision(mock_client, TX_HASH) - with pytest.raises(GenLayerError, match="LEADER_REVEALING"): - wait_for_transaction_receipt( - self=mock_client, - transaction_hash="0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", - wait_until="finalized", - retries=1, - interval=1, - full_transaction=True, - ) + def test_invalid_lifecycle_is_rejected(self, mock_client): + mock_client.get_transaction.return_value = {"hash": TX_HASH} - assert TRANSACTION_STATUS_NUMBER_TO_NAME["14"] == TransactionStatus.LEADER_REVEALING - - def test_wait_for_specific_status_not_affected(self, mock_client): - """Test that waiting for specific non-ACCEPTED statuses is not affected by decided states logic""" - mock_transaction = { - "hash": "0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", - "status": "7", # FINALIZED - "status_name": "FINALIZED", - "from_address": "0x123", - "to_address": "0x456", - "value": "0", - "gaslimit": "1000000", - "nonce": "1", - "created_at": "2023-01-01T00:00:00Z", - } - - mock_client.get_transaction.return_value = mock_transaction - - result = wait_for_transaction_receipt( - self=mock_client, - transaction_hash="0x4b8037744adab7ea8335b4f839979d20031d83a8ccdf706e0ae61312930335f6", - status=TransactionStatus.FINALIZED, - full_transaction=True, - ) - - assert result == mock_transaction - - -class TestDecidedStatesUtility: - """Test suite for DECIDED_STATES constant and is_decided_state function""" - - def test_decided_states_constant(self): - """Test that DECIDED_STATES contains all expected states""" - expected_states = [ - TransactionStatus.ACCEPTED, - TransactionStatus.UNDETERMINED, - TransactionStatus.LEADER_TIMEOUT, - TransactionStatus.VALIDATORS_TIMEOUT, - TransactionStatus.CANCELED, - TransactionStatus.FINALIZED - ] - - assert DECIDED_STATES == expected_states - - def test_is_decided_state_with_decided_statuses(self): - """Test is_decided_state returns True for all decided statuses""" - decided_status_numbers = ["5", "6", "8", "7", "12", "13"] # ACCEPTED, UNDETERMINED, CANCELED, FINALIZED, VALIDATORS_TIMEOUT, LEADER_TIMEOUT - - for status_num in decided_status_numbers: - assert is_decided_state(status_num) == True, f"Status {status_num} should be decided" - - def test_is_decided_state_with_non_decided_statuses(self): - """Test is_decided_state returns False for non-decided statuses""" - non_decided_status_numbers = ["0", "1", "2", "3", "4", "9", "10", "11"] # UNINITIALIZED, PENDING, PROPOSING, COMMITTING, REVEALING, APPEAL_REVEALING, APPEAL_COMMITTING, READY_TO_FINALIZE - - for status_num in non_decided_status_numbers: - assert is_decided_state(status_num) == False, f"Status {status_num} should not be decided" - - def test_is_decided_state_with_invalid_status(self): - """Test is_decided_state returns False for invalid statuses""" - invalid_statuses = ["999", "invalid", "", None] - - for status in invalid_statuses: - if status is not None: - assert is_decided_state(status) == False, f"Invalid status {status} should not be decided" + with pytest.raises(GenLayerError, match="has no valid lifecycle"): + wait_for_decision(mock_client, TX_HASH) + + def test_invalid_receipt_wait_target_is_rejected(self, mock_client): + with pytest.raises(ValueError, match="wait_until"): + wait_for_transaction_receipt(mock_client, TX_HASH, wait_until="projected") class TestIsSuccessful: def test_truth_table(self): assert is_successful( { - "status": "5", + "lifecycle": {"state": "decided", "outcome": "accepted"}, "tx_execution_result": "1", } ) assert not is_successful( { - "status": "6", + "lifecycle": {"state": "decided", "outcome": "undetermined"}, "tx_execution_result": "1", } ) assert not is_successful( { - "status": TransactionStatus.ACCEPTED, + "lifecycle": {"state": "decided", "outcome": "accepted"}, "tx_execution_result": "2", } ) assert is_successful( { - "status_name": TransactionStatus.FINALIZED, + "lifecycle": {"state": "finalized"}, + "tx_execution_result_name": ExecutionResult.FINISHED_WITH_RETURN, + } + ) + assert is_successful( + { + "lifecycle": {"state": "finalized", "outcome": "accepted"}, + "tx_execution_result_name": ExecutionResult.FINISHED_WITH_RETURN, + } + ) + assert not is_successful( + { + "lifecycle": {"state": "finalized", "outcome": "undetermined"}, "tx_execution_result_name": ExecutionResult.FINISHED_WITH_RETURN, } ) @@ -337,8 +197,7 @@ def test_simplify_preserves_essential_fields(self, full_write_transaction_data): # These fields should be preserved essential_fields = [ "hash", - "status", - "status_name", + "lifecycle", "from_address", "to_address", "value", diff --git a/uv.lock b/uv.lock index f958102..392c1a0 100644 --- a/uv.lock +++ b/uv.lock @@ -434,7 +434,7 @@ wheels = [ [[package]] name = "genlayer-py" -version = "0.18.0" +version = "0.19.0" source = { editable = "." } dependencies = [ { name = "web3" },