From 225877ee2386c6dc19fe242cdd733ee4f30724a6 Mon Sep 17 00:00:00 2001 From: jmlago Date: Mon, 19 Oct 2026 19:23:18 +0100 Subject: [PATCH 1/5] fix: target Bradbury Phase 2 and verify RPC network identity --- README.md | 20 + package.json | 3 +- scripts/bradbury-phase-2-contracts.json | 62 + scripts/check-bradbury-network.mjs | 44 + scripts/check-chains-drift.mjs | 16 +- src/chains/testnetBradbury.ts | 5586 ++++++++++++++++------- src/client/client.ts | 49 +- src/client/networkIdentity.ts | 20 + src/types/chains.ts | 2 + tests/bradbury-network.test.ts | 53 + 10 files changed, 4076 insertions(+), 1779 deletions(-) create mode 100644 scripts/bradbury-phase-2-contracts.json create mode 100644 scripts/check-bradbury-network.mjs create mode 100644 src/client/networkIdentity.ts create mode 100644 tests/bradbury-network.test.ts diff --git a/README.md b/README.md index 7bfb82e..c2497a9 100644 --- a/README.md +++ b/README.md @@ -504,3 +504,23 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file ### v0.6 consumer migration See [the v2 migration guide](docs/consumer-migration-v06.md) for the staking rewards rename, producer ABI changes, execution generation, and package selection. + +### Bradbury Phase 2 + +`testnetBradbury` targets the Phase 2 deployment (chain ID 4221). That chain ID +was also used by Phase 1, so the SDK verifies the genesis hash and required +contract code on first use and again before broadcasting a transaction. A wallet +provider is checked separately before signing. A mismatched endpoint fails closed. + +The public chain endpoint is `https://rpc.testnet-chain.genlayer.com`, with the +chain explorer at `https://scan.testnet-chain.genlayer.com`. During the DNS +cutover, explicitly use the assigned Conduit endpoint with `createClient({chain: +testnetBradbury, endpoint: rpcUrl})`. Overrides do not change exported defaults. +The chain RPC serves Ethereum/staking calls; GenLayer `gen_*` methods require a +compatible GenLayer node endpoint. + +Run `npm run check:bradbury` to check the default endpoint, or set +`BRADBURY_RPC_URL` and, when required, `BRADBURY_RPC_KEY` (sent as `X-AccessKey`). +A successful check establishes network identity, not validator activation or +WebSocket readiness. `npm run check:chains` compares the Phase 2 contract +configuration against the pinned deployment and verified implementation ABIs. diff --git a/package.json b/package.json index 2c938ba..b58d320 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "lint": "eslint . --fix --ext .ts", "check:chains": "node scripts/check-chains-drift.mjs", "release": "./scripts/release.sh", - "docs": "node scripts/generate-api-docs.mjs" + "docs": "node scripts/generate-api-docs.mjs", + "check:bradbury": "node scripts/check-bradbury-network.mjs" }, "exports": { ".": { diff --git a/scripts/bradbury-phase-2-contracts.json b/scripts/bradbury-phase-2-contracts.json new file mode 100644 index 0000000..696351c --- /dev/null +++ b/scripts/bradbury-phase-2-contracts.json @@ -0,0 +1,62 @@ +{ + "ConsensusMain": { + "address": "0x2E2766cbc3E5e61Ce93bBcdCBb3eAcB82082A019", + "implementation": "0xe9F572e836ea3640c022D09Aa41108fba3574731" + }, + "ConsensusData": { + "address": "0xc5FA6f82BEe53598825d6edf7E3e24613082c75B", + "implementation": "0x7A92A2036102c27eE9989f1D2f2E16152338c4b0" + }, + "Staking": { + "address": "0xD8fBa96C0dBB0257028dBc0107060b958e5c7113", + "implementation": "0x5ed40150710C64318607CC684211ff6c7b3592Fa" + }, + "StakingData": { + "address": "0x8951E93ae3E95F44Bc700fd8D145d30f5eeD408E", + "implementation": "0xb17160b160885616cac24CA46cDE0FCBf66DE2e8" + }, + "FeeManager": { + "address": "0x7678587A847712f2A96082AC07883A88D0fc7245", + "implementation": "0x8797Ef886ebBd2492A137f5279E537ba29B1E542" + }, + "RoundsStorage": { + "address": "0x4038d4F72C7aAbA5a442cC0dA946012B9E3f4B8a", + "implementation": "0x9d1516378757dabd8E3DFd41894e1BCB2Df8b9D1" + }, + "Appeals": { + "address": "0xdc953c3bCf8837987853ca05a78D52fFC3E18651", + "implementation": "0xfA88c97083f51CCB498248a43f8E5e573CA5475f" + }, + "ValidatorWalletBlueprint": { + "address": "0xAE308333af9e4aB7418E0CA6f1Fd5fAb8915BAf2", + "implementation": "0xAE308333af9e4aB7418E0CA6f1Fd5fAb8915BAf2" + }, + "StakingConfig": { + "address": "0xe56D9dEdD88b600D36663c3E3a57099616Da1494", + "implementation": "0xe56D9dEdD88b600D36663c3E3a57099616Da1494" + }, + "StakingDelegators": { + "address": "0x05F3157E873dD68De43ED82920D6a799873Cf7F5", + "implementation": "0x05F3157E873dD68De43ED82920D6a799873Cf7F5" + }, + "StakingBan": { + "address": "0x9c251FB71832C470D7a30B08107fF8ad85825CFB", + "implementation": "0x9c251FB71832C470D7a30B08107fF8ad85825CFB" + }, + "StakingValidators": { + "address": "0x6750F65b74B73FA529a7A4fe283b705d509B3306", + "implementation": "0x6750F65b74B73FA529a7A4fe283b705d509B3306" + }, + "StakingEpoch": { + "address": "0xdeF1262F9A0CFFD7Fc26F0C8F7Ef1af724136E19", + "implementation": "0xdeF1262F9A0CFFD7Fc26F0C8F7Ef1af724136E19" + }, + "StakingReadFacet": { + "address": "0x47a404edE8F68F0b9253aB009e5Aa0362517B1e1", + "implementation": "0x47a404edE8F68F0b9253aB009e5Aa0362517B1e1" + }, + "StakingReadModel": { + "address": "0xf1fBdE733A9ceE2C0A44b8f724d944F89aE6D8A4", + "implementation": "0xf1fBdE733A9ceE2C0A44b8f724d944F89aE6D8A4" + } +} diff --git a/scripts/check-bradbury-network.mjs b/scripts/check-bradbury-network.mjs new file mode 100644 index 0000000..7400bbd --- /dev/null +++ b/scripts/check-bradbury-network.mjs @@ -0,0 +1,44 @@ +import { pathToFileURL } from 'node:url'; + +export const GENESIS = '0x17d89764d4f4f963158fc4c5e8f2cb670c2837740b35f37081c12860c3df97e4'; +export const CONTRACTS = { + AddressManager: '0x3F71AE080BD6270A91dBcc7960d88797828538E0', + Staking: '0xD8fBa96C0dBB0257028dBc0107060b958e5c7113', + ConsensusMain: '0x2E2766cbc3E5e61Ce93bBcdCBb3eAcB82082A019', +}; + +export async function checkNetwork(request) { + if (BigInt(await request('eth_chainId', [])) !== 4221n) throw new Error('Wrong chain ID'); + const genesis = await request('eth_getBlockByNumber', ['0x0', false]); + if (genesis?.hash?.toLowerCase() !== GENESIS) throw new Error('Wrong genesis: this is not Bradbury Phase 2 (chain ID 4221 is reused)'); + for (const [name, address] of Object.entries(CONTRACTS)) { + const code = await request('eth_getCode', [address, 'latest']); + if (typeof code !== 'string' || !/^0x[0-9a-f]+$/i.test(code) || code.length <= 2) throw new Error(`${name} has no deployed code`); + } +} + +export function rpcRequest(url, key) { + return async (method, params) => { + // Do not print endpoint URLs, headers, provider errors or response bodies: they may contain credentials. + let response; + try { + response = await fetch(url, {method: 'POST', headers: {'content-type': 'application/json', ...(key ? {'X-AccessKey': key} : {})}, + body: JSON.stringify({jsonrpc: '2.0', id: 1, method, params}), signal: AbortSignal.timeout(15000)}); + } catch { throw new Error(`${method}: RPC connection failed`); } + if (!response.ok) throw new Error(`${method}: HTTP ${response.status}`); + let data; + try { data = await response.json(); } catch { throw new Error(`${method}: invalid JSON response`); } + if (data.error || data.result === undefined) throw new Error(`${method}: RPC request rejected`); + return data.result; + }; +} + +if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { + try { + await checkNetwork(rpcRequest(process.env.BRADBURY_RPC_URL || 'https://rpc.testnet-chain.genlayer.com', process.env.BRADBURY_RPC_KEY)); + console.log('Bradbury Phase 2: chain ID, genesis and required contract code verified.'); + } catch (error) { + console.error(error.message); + process.exitCode = 1; + } +} diff --git a/scripts/check-chains-drift.mjs b/scripts/check-chains-drift.mjs index 37a975e..486b884 100644 --- a/scripts/check-chains-drift.mjs +++ b/scripts/check-chains-drift.mjs @@ -21,6 +21,10 @@ const REPO_ROOT = join(dirname(fileURLToPath(import.meta.url)), ".."); const NETWORKS_REF = process.env.GENLAYER_NETWORKS_REF || "main"; const NETWORKS_BASE = `https://raw.githubusercontent.com/genlayerlabs/genlayer-networks/${NETWORKS_REF}`; +// Phase 2 is not yet represented by genlayer-networks/bradbury. Verify its +// pinned, explorer-verified implementation ABIs instead of the legacy deployment. +const BRADBURY = JSON.parse(readFileSync(join(REPO_ROOT, "scripts/bradbury-phase-2-contracts.json"), "utf8")); + const CHAINS = [ { name: "asimov", deploymentKey: "deployment_asimov_phase5" }, { name: "bradbury", deploymentKey: "deployment_bradbury" }, @@ -140,10 +144,12 @@ async function main() { failures.push(`[${name}] chain export missing from dist/chains`); continue; } - const deployments = await fetchJson( + const deployments = name === "bradbury" ? null : await fetchJson( `${NETWORKS_BASE}/${name}/testnet_deployments.json`, ); - const group = deployments.genlayerTestnet?.[deploymentKey]; + const group = name === "bradbury" + ? Object.fromEntries(Object.entries(BRADBURY).map(([key, value]) => [key, value.address])) + : deployments.genlayerTestnet?.[deploymentKey]; if (!group) { failures.push( `[${name}] testnet_deployments.json has no .genlayerTestnet.${deploymentKey}`, @@ -172,7 +178,9 @@ async function main() { } const nwAbi = ( - await fetchJson(`${NETWORKS_BASE}/${name}/${abiPath}`) + await fetchJson(name === "bradbury" + ? `https://contracts.conduit.xyz/v2/contract/4221/${BRADBURY[networksKey].implementation}?fields=abi` + : `${NETWORKS_BASE}/${name}/${abiPath}`) ).abi; const jsSet = canonicalSet(jsContract.abi); const nwSet = canonicalSet(nwAbi); @@ -199,7 +207,7 @@ async function main() { process.exit(1); } console.log( - "No drift. Chain files match genlayer-networks/" + NETWORKS_REF + ".", + "No drift. Bradbury matches its verified Phase 2 implementations; other chains match genlayer-networks/" + NETWORKS_REF + ".", ); } diff --git a/src/chains/testnetBradbury.ts b/src/chains/testnetBradbury.ts index f6b0e00..7929039 100644 --- a/src/chains/testnetBradbury.ts +++ b/src/chains/testnetBradbury.ts @@ -2,3389 +2,5474 @@ import {Address, defineChain} from "viem"; import {GenLayerChain} from "@/types"; import {STAKING_ABI} from "@/abi/staking"; -const TESTNET_JSON_RPC_URL = "https://rpc-bradbury.genlayer.com"; -// WebSocket not available on testnet GenLayer RPC nodes +const TESTNET_JSON_RPC_URL = "https://rpc.testnet-chain.genlayer.com"; +// Validator WebSocket access is configured separately by its RPC operator. const STAKING_CONTRACT = { - address: "0x4A4449E617F8D10FDeD0b461CadEf83939E821A5" as Address, + address: "0xD8fBa96C0dBB0257028dBc0107060b958e5c7113" as Address, abi: STAKING_ABI, }; const FEE_MANAGER_CONTRACT = { - address: "0xF205868bf5db79d2162843742D18D0900A9E462a" as Address, + address: "0x7678587A847712f2A96082AC07883A88D0fc7245" as Address, abi: [ - { - type: "function" as const, - name: "calculateMinAppealBond", - stateMutability: "view" as const, - inputs: [ - { name: "_txId", type: "bytes32" }, - { name: "_round", type: "uint256" }, - { name: "_status", type: "uint8" }, - ], - outputs: [ - { name: "totalFeesToPay", type: "uint256" }, - ], - }, - ], + { + "name": "calculateMinAppealBond", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_round", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_status", + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" + } + ], + "outputs": [ + { + "name": "totalFeesToPay", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + } +], }; const ROUNDS_STORAGE_CONTRACT = { - address: "0x7134D05af13A14c0b66Fe129fb930b1d0C420e33" as Address, + address: "0x4038d4F72C7aAbA5a442cC0dA946012B9E3f4B8a" as Address, abi: [ - { - type: "function" as const, - name: "getLastRoundData", - stateMutability: "view" as const, - inputs: [ - { name: "txId", type: "bytes32" }, - ], - outputs: [ - { name: "round", type: "uint256" }, - { - name: "roundData", - type: "tuple", - components: [ - { name: "round", type: "uint256" }, - { name: "leaderIndex", type: "uint256" }, - { name: "votesCommitted", type: "uint256" }, - { name: "votesRevealed", type: "uint256" }, - { name: "appealBond", type: "uint256" }, - { name: "rotationsLeft", type: "uint256" }, - { name: "result", type: "uint8" }, - { name: "roundValidators", type: "address[]" }, - { name: "validatorVotes", type: "uint8[]" }, - { name: "validatorVotesHash", type: "bytes32[]" }, - { name: "validatorResultHash", type: "bytes32[]" }, - ], - }, - ], - }, - { - type: "function" as const, - name: "getRoundData", - stateMutability: "view" as const, - inputs: [ - { name: "txId", type: "bytes32" }, - { name: "round", type: "uint256" }, - ], - outputs: [ - { - name: "", - type: "tuple", - components: [ - { name: "round", type: "uint256" }, - { name: "leaderIndex", type: "uint256" }, - { name: "votesCommitted", type: "uint256" }, - { name: "votesRevealed", type: "uint256" }, - { name: "appealBond", type: "uint256" }, - { name: "rotationsLeft", type: "uint256" }, - { name: "result", type: "uint8" }, - { name: "roundValidators", type: "address[]" }, - { name: "validatorVotes", type: "uint8[]" }, - { name: "validatorVotesHash", type: "bytes32[]" }, - { name: "validatorResultHash", type: "bytes32[]" }, - ], - }, - ], - }, - { - type: "function" as const, - name: "getRoundNumber", - stateMutability: "view" as const, - inputs: [ - { name: "txId", type: "bytes32" }, - ], - outputs: [ - { name: "", type: "uint256" }, - ], - }, - ], + { + "name": "getLastRoundData", + "type": "function", + "inputs": [ + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "round", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "roundData", + "type": "tuple", + "components": [ + { + "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": "uint256" + }, + { + "name": "result", + "type": "uint8", + "internalType": "enum ITransactions.ResultType" + }, + { + "name": "roundValidators", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "validatorVotes", + "type": "uint8[]", + "internalType": "enum ITransactions.VoteType[]" + }, + { + "name": "validatorVotesHash", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "validatorResultHash", + "type": "bytes32[]", + "internalType": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData" + } + ], + "stateMutability": "view" + }, + { + "name": "getRoundData", + "type": "function", + "inputs": [ + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "round", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "tuple", + "components": [ + { + "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": "uint256" + }, + { + "name": "result", + "type": "uint8", + "internalType": "enum ITransactions.ResultType" + }, + { + "name": "roundValidators", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "validatorVotes", + "type": "uint8[]", + "internalType": "enum ITransactions.VoteType[]" + }, + { + "name": "validatorVotesHash", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "validatorResultHash", + "type": "bytes32[]", + "internalType": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData" + } + ], + "stateMutability": "view" + }, + { + "name": "getRoundNumber", + "type": "function", + "inputs": [ + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + } +], }; const APPEALS_CONTRACT = { - address: "0xbb8C35AA878D09b9830aFF9e5aAC6492BFbd5471" as Address, + address: "0xdc953c3bCf8837987853ca05a78D52fFC3E18651" as Address, abi: [ - { - type: "function" as const, - name: "canAppeal", - stateMutability: "view" as const, - inputs: [ - { name: "_txId", type: "bytes32" }, - ], - outputs: [ - { name: "", type: "bool" }, - ], - }, - ], + { + "name": "canAppeal", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_expectedDecisionId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + } +], }; -const EXPLORER_URL = "https://explorer-bradbury.genlayer.com/"; +const EXPLORER_URL = "https://scan.testnet-chain.genlayer.com"; const CONSENSUS_MAIN_CONTRACT = { - address: "0x0112Bf6e83497965A5fdD6Dad1E447a6E004271D" as Address, + address: "0x2E2766cbc3E5e61Ce93bBcdCBb3eAcB82082A019" as Address, abi: [ { + "type": "constructor", "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" + "stateMutability": "nonpayable" }, { - "inputs": [], "name": "CallerNotMessages", - "type": "error" + "type": "error", + "inputs": [] + }, + { + "name": "CanNotAppeal", + "type": "error", + "inputs": [] + }, + { + "name": "ExecutionBudgetExceeded", + "type": "error", + "inputs": [ + { + "name": "attemptedConsumption", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "budget", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "InsufficientFees", + "type": "error", + "inputs": [] }, { - "inputs": [], "name": "InvalidDeploymentWithSalt", - "type": "error" + "type": "error", + "inputs": [] }, { - "inputs": [], "name": "InvalidInitialization", - "type": "error" + "type": "error", + "inputs": [] + }, + { + "name": "InvalidRegistry", + "type": "error", + "inputs": [] }, { - "inputs": [], "name": "InvalidRevealLeaderData", - "type": "error" + "type": "error", + "inputs": [] }, { - "inputs": [], - "name": "InvalidVote", - "type": "error" + "name": "LegacyProposeReceiptRetired", + "type": "error", + "inputs": [] + }, + { + "name": "MessageEnvelopeRequired", + "type": "error", + "inputs": [] + }, + { + "name": "MessageFeesTotalMustBeNonZero", + "type": "error", + "inputs": [] }, { - "inputs": [], "name": "NotInitializing", - "type": "error" + "type": "error", + "inputs": [] }, { + "name": "OwnableInvalidOwner", + "type": "error", "inputs": [ { - "internalType": "address", "name": "owner", - "type": "address" + "type": "address", + "internalType": "address" } - ], - "name": "OwnableInvalidOwner", - "type": "error" + ] }, { + "name": "OwnableUnauthorizedAccount", + "type": "error", "inputs": [ { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" } - ], - "name": "OwnableUnauthorizedAccount", - "type": "error" + ] + }, + { + "name": "ProtocolNotSealed", + "type": "error", + "inputs": [] }, { - "inputs": [], "name": "ReentrancyGuardReentrantCall", - "type": "error" + "type": "error", + "inputs": [] }, { - "inputs": [], - "name": "TransactionNotFinalized", - "type": "error" + "name": "RegistryBindingLocked", + "type": "error", + "inputs": [] + }, + { + "name": "RollupBudgetBelowFloor", + "type": "error", + "inputs": [] }, { - "inputs": [], "name": "Unauthorized", - "type": "error" + "type": "error", + "inputs": [] }, { - "anonymous": false, + "name": "ActivatorReplaced", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { - "indexed": true, - "internalType": "address", "name": "oldActivator", - "type": "address" + "type": "address", + "indexed": true, + "internalType": "address" }, { - "indexed": true, - "internalType": "address", "name": "newActivator", - "type": "address" + "type": "address", + "indexed": true, + "internalType": "address" } ], - "name": "ActivatorReplaced", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "AddressManagerSet", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "address", "name": "addressManager", - "type": "address" + "type": "address", + "indexed": true, + "internalType": "address" } ], - "name": "AddressManagerSet", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "AllVotesCommitted", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { - "indexed": false, - "internalType": "enum ITransactions.TransactionStatus", "name": "newStatus", - "type": "uint8" + "type": "uint8", + "indexed": false, + "internalType": "enum ITransactions.TransactionStatus" } ], - "name": "AllVotesCommitted", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "AppealBondReturned", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" - }, - { + "type": "bytes32", "indexed": true, - "internalType": "address", - "name": "appellant", - "type": "address" + "internalType": "bytes32" }, { - "indexed": false, - "internalType": "uint256", - "name": "bond", - "type": "uint256" + "name": "appealer", + "type": "address", + "indexed": true, + "internalType": "address" }, { + "name": "amount", + "type": "uint256", "indexed": false, - "internalType": "address[]", - "name": "validators", - "type": "address[]" + "internalType": "uint256" } ], - "name": "AppealStarted", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "AppealStarted", + "type": "event", "inputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "attempted", - "type": "uint256" + "name": "txId", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "appellant", + "type": "address", + "indexed": true, + "internalType": "address" }, { + "name": "bond", + "type": "uint256", "indexed": false, - "internalType": "uint256", - "name": "succeeded", - "type": "uint256" + "internalType": "uint256" }, { + "name": "validators", + "type": "address[]", "indexed": false, - "internalType": "uint256", - "name": "failed", - "type": "uint256" + "internalType": "address[]" } ], - "name": "BatchFinalizationCompleted", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "AppealerProfitPayoutFailed", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { + "name": "appealer", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "bondReturned", + "type": "uint256", "indexed": false, - "internalType": "uint256", - "name": "txSlot", - "type": "uint256" - } - ], - "name": "CreatedTransaction", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "internalType": "uint256" + }, { + "name": "profitUnpaid", + "type": "uint256", "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" + "internalType": "uint256" } ], - "name": "Initialized", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "BatchCommandFailed", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { + "name": "commandKind", + "type": "uint8", "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" + "internalType": "uint8" }, { - "indexed": true, - "internalType": "address", - "name": "activator", - "type": "address" + "name": "errorSelector", + "type": "bytes4", + "indexed": false, + "internalType": "bytes4" + }, + { + "name": "failureFingerprint", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" } ], - "name": "InternalMessageProcessed", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "BatchFinalizationCompleted", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" + "name": "attempted", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "indexed": true, - "internalType": "address", - "name": "oldLeader", - "type": "address" + "name": "finalized", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { - "indexed": true, - "internalType": "address", - "name": "newLeader", - "type": "address" + "name": "progressed", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "failed", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "LeaderIdlenessProcessed", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "BatchResolutionCompleted", + "type": "event", + "inputs": [ + { + "name": "attempted", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "resolved", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "failed", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "name": "CreatedTransaction", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { + "name": "txSlot", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "name": "FeesRefunded", + "type": "event", + "inputs": [ + { + "name": "txId", + "type": "bytes32", "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" + "internalType": "bytes32" }, { + "name": "sender", + "type": "address", "indexed": true, - "internalType": "address", - "name": "activator", - "type": "address" + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "NewTransaction", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "FinalizationEffectsDeferred", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { + "name": "decisionId", + "type": "uint256", "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" + "internalType": "uint256" }, { + "name": "recipient", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "name": "Initialized", + "type": "event", + "inputs": [ + { + "name": "version", + "type": "uint64", "indexed": false, - "internalType": "uint256", - "name": "firstAnnouncedAt", - "type": "uint256" + "internalType": "uint64" } ], - "name": "NewTransactionAlreadyAnnounced", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "InternalMessageProcessed", + "type": "event", "inputs": [ { + "name": "txId", + "type": "bytes32", "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" + "internalType": "bytes32" }, { + "name": "recipient", + "type": "address", "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" + "internalType": "address" + }, + { + "name": "activator", + "type": "address", + "indexed": true, + "internalType": "address" } ], - "name": "OwnershipTransferStarted", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "LeaderIdlenessProcessed", + "type": "event", "inputs": [ { + "name": "txId", + "type": "bytes32", "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" + "internalType": "bytes32" }, { + "name": "oldLeader", + "type": "address", "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" + "internalType": "address" + }, + { + "name": "newLeader", + "type": "address", + "indexed": true, + "internalType": "address" } ], - "name": "OwnershipTransferred", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "NewTransaction", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "recipient", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "activator", + "type": "address", + "indexed": true, + "internalType": "address" } ], - "name": "ProcessIdlenessAccepted", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "NewTransactionAlreadyAnnounced", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "recipient", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "firstAnnouncedAt", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], - "name": "TransactionAccepted", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "OwnershipTransferStarted", + "type": "event", "inputs": [ { + "name": "previousOwner", + "type": "address", "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" + "internalType": "address" }, { + "name": "newOwner", + "type": "address", "indexed": true, - "internalType": "address", - "name": "leader", - "type": "address" + "internalType": "address" } ], - "name": "TransactionActivated", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "OwnershipTransferred", + "type": "event", "inputs": [ { + "name": "previousOwner", + "type": "address", "indexed": true, - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" + "internalType": "address" }, { + "name": "newOwner", + "type": "address", "indexed": true, - "internalType": "address", - "name": "cancelledBy", - "type": "address" + "internalType": "address" } ], - "name": "TransactionCancelled", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "ProcessIdlenessAccepted", + "type": "event", "inputs": [ { + "name": "txId", + "type": "bytes32", "indexed": true, - "internalType": "bytes32", + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "name": "ReceiptFeeEstimated", + "type": "event", + "inputs": [ + { "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "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", + "indexed": false, + "internalType": "uint256" } ], - "name": "TransactionFinalizationFailed", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "TransactionAccepted", + "type": "event", "inputs": [ { + "name": "txId", + "type": "bytes32", "indexed": true, - "internalType": "bytes32", + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "name": "TransactionActivated", + "type": "event", + "inputs": [ + { "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "leader", + "type": "address", + "indexed": true, + "internalType": "address" } ], - "name": "TransactionFinalized", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "TransactionCancelled", + "type": "event", "inputs": [ { + "name": "txId", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "cancelledBy", + "type": "address", "indexed": true, - "internalType": "bytes32", + "internalType": "address" + } + ], + "anonymous": false + }, + { + "name": "TransactionFinalized", + "type": "event", + "inputs": [ + { "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" } ], - "name": "TransactionLeaderRevealed", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "TransactionLeaderRevealed", + "type": "event", "inputs": [ { + "name": "txId", + "type": "bytes32", "indexed": true, - "internalType": "bytes32", + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "name": "TransactionLeaderRotated", + "type": "event", + "inputs": [ + { "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { - "indexed": true, - "internalType": "address", "name": "newLeader", - "type": "address" + "type": "address", + "indexed": true, + "internalType": "address" } ], - "name": "TransactionLeaderRotated", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "TransactionLeaderTimeout", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" } ], - "name": "TransactionLeaderTimeout", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "TransactionNeedsRecomputation", + "type": "event", "inputs": [ { - "indexed": false, - "internalType": "bytes32[]", "name": "txIds", - "type": "bytes32[]" + "type": "bytes32[]", + "indexed": false, + "internalType": "bytes32[]" } ], - "name": "TransactionNeedsRecomputation", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "TransactionReceiptProposed", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { - "indexed": false, - "internalType": "address[]", "name": "validators", - "type": "address[]" + "type": "address[]", + "indexed": false, + "internalType": "address[]" } ], - "name": "TransactionReceiptProposed", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "TransactionUndetermined", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" } ], - "name": "TransactionUndetermined", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "TribunalAppealVoteCommitted", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { + "name": "tribunalIndex", + "type": "uint256", "indexed": false, - "internalType": "uint256", - "name": "totalUnissuedValue", - "type": "uint256" + "internalType": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "unissuedCount", - "type": "uint256" + "name": "validator", + "type": "address", + "indexed": true, + "internalType": "address" } ], - "name": "UnissuedMessagesAtFinalization", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "TribunalAppealVoteRevealed", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { - "indexed": true, - "internalType": "address", - "name": "oldValidator", - "type": "address" + "name": "tribunalIndex", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { + "name": "validator", + "type": "address", "indexed": true, - "internalType": "address", - "name": "newValidator", - "type": "address" + "internalType": "address" }, { + "name": "voteType", + "type": "uint8", "indexed": false, - "internalType": "uint256", - "name": "validatorIndex", - "type": "uint256" + "internalType": "enum ITransactions.VoteType" } ], - "name": "ValidatorReplaced", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "UnifiedFeesDistributed", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { - "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" + "name": "chunkIndex", + "type": "uint256", + "indexed": false, + "internalType": "uint256" }, { + "name": "recipients", + "type": "address[]", "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" + "internalType": "address[]" + }, + { + "name": "amounts", + "type": "uint256[]", + "indexed": false, + "internalType": "uint256[]" } ], - "name": "ValueWithdrawalFailed", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "UserValueRefunded", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { + "name": "recipient", + "type": "address", "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" + "internalType": "address" }, { + "name": "amount", + "type": "uint256", "indexed": false, - "internalType": "bool", - "name": "isLastVote", - "type": "bool" + "internalType": "uint256" } ], - "name": "VoteCommitted", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "ValidatorReplaced", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { + "name": "oldValidator", + "type": "address", "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" + "internalType": "address" }, { - "indexed": false, - "internalType": "enum ITransactions.VoteType", - "name": "voteType", - "type": "uint8" + "name": "newValidator", + "type": "address", + "indexed": true, + "internalType": "address" }, { + "name": "validatorIndex", + "type": "uint256", "indexed": false, - "internalType": "bool", - "name": "isLastVote", - "type": "bool" + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "name": "ValueWithdrawalFailed", + "type": "event", + "inputs": [ + { + "name": "txId", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "recipient", + "type": "address", + "indexed": true, + "internalType": "address" }, { + "name": "value", + "type": "uint256", "indexed": false, - "internalType": "enum ITransactions.ResultType", - "name": "result", - "type": "uint8" + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "name": "VoteCommitted", + "type": "event", + "inputs": [ + { + "name": "txId", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "validator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "isLastVote", + "type": "bool", + "indexed": false, + "internalType": "bool" + } + ], + "anonymous": false + }, + { + "name": "VoteRevealed", + "type": "event", + "inputs": [ + { + "name": "txId", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "validator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "voteType", + "type": "uint8", + "indexed": false, + "internalType": "enum ITransactions.VoteType" + }, + { + "name": "isLastVote", + "type": "bool", + "indexed": false, + "internalType": "bool" + }, + { + "name": "result", + "type": "uint8", + "indexed": false, + "internalType": "enum ITransactions.ResultType" + } + ], + "anonymous": false + }, + { + "name": "EVENTS_BATCH_SIZE", + "type": "function", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "name": "VERSION", + "type": "function", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, + { + "name": "acceptOwnership", + "type": "function", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "name": "activateTransaction", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_vrfProof", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "_expectedAttemptId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "name": "activatorIdleness", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_expectedAttemptId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "name": "addTransaction", + "type": "function", + "inputs": [ + { + "name": "_params", + "type": "tuple", + "components": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "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", + "internalType": "uint256" + }, + { + "name": "feesDistribution", + "type": "tuple", + "components": [ + { + "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": "uint256" + } + ], + "internalType": "struct IFeeManager.FeesDistribution" + }, + { + "name": "txCalldata", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "messageAllocations", + "type": "tuple[]", + "components": [ + { + "name": "messageType", + "type": "uint8", + "internalType": "enum IMessages.MessageType" + }, + { + "name": "onAcceptance", + "type": "bool", + "internalType": "bool" + }, + { + "name": "parentIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "callKey", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "budget", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "feeParams", + "type": "bytes", + "internalType": "bytes" + } + ], + "internalType": "struct IMessages.MessageFeeAllocationNode[]" + } + ], + "internalType": "struct IConsensusMainWithFees.AddTransactionParams" + } + ], + "outputs": [ + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "payable" + }, + { + "name": "addressManager", + "type": "function", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IAddressManager" + } + ], + "stateMutability": "view" + }, + { + "name": "cancelTransaction", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "name": "commitVote", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_commitHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_validatorIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_expectedAttemptId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "name": "continueAcceptanceMessages", + "type": "function", + "inputs": [ + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "expectedDecisionId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expectedGeneration", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "complete", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "name": "continueRecomputation", + "type": "function", + "inputs": [ + { + "name": "recipient", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "name": "deploySalted", + "type": "function", + "inputs": [ + { + "name": "_params", + "type": "tuple", + "components": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "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", + "internalType": "uint256" + }, + { + "name": "feesDistribution", + "type": "tuple", + "components": [ + { + "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": "uint256" + } + ], + "internalType": "struct IFeeManager.FeesDistribution" + }, + { + "name": "txCalldata", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "messageAllocations", + "type": "tuple[]", + "components": [ + { + "name": "messageType", + "type": "uint8", + "internalType": "enum IMessages.MessageType" + }, + { + "name": "onAcceptance", + "type": "bool", + "internalType": "bool" + }, + { + "name": "parentIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "callKey", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "budget", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "feeParams", + "type": "bytes", + "internalType": "bytes" + } + ], + "internalType": "struct IMessages.MessageFeeAllocationNode[]" + } + ], + "internalType": "struct IConsensusMainWithFees.AddTransactionParams" + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "name": "estimateAppealCharge", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_expectedDecisionId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "bond", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "funding", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "name": "executeMessage", + "type": "function", + "inputs": [ + { + "name": "_recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "_value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_data", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "_gasLimit", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "success", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" + }, + { + "name": "finalizeDecisionBatchItem", + "type": "function", + "inputs": [ + { + "name": "command", + "type": "tuple", + "components": [ + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "expectedDecisionId", + "type": "uint256", + "internalType": "uint256" + } + ], + "internalType": "struct IFinalizationPhase.FinalizeTransactionParams" + } + ], + "outputs": [ + { + "name": "outcome", + "type": "uint8", + "internalType": "uint8" + } + ], + "stateMutability": "nonpayable" + }, + { + "name": "finalizeDecisions", + "type": "function", + "inputs": [ + { + "name": "_commands", + "type": "tuple[]", + "components": [ + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "expectedDecisionId", + "type": "uint256", + "internalType": "uint256" + } + ], + "internalType": "struct IFinalizationPhase.FinalizeTransactionParams[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "name": "finalizeTransaction", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_expectedDecisionId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "name": "finalizeTransactionDeferred", + "type": "function", + "inputs": [ + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "expectedDecisionId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "name": "flushExternalMessages", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "name": "flushInternalMessages", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "name": "getAddressManager", + "type": "function", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IAddressManager" + } + ], + "stateMutability": "view" + }, + { + "name": "getPendingTransactionValue", + "type": "function", + "inputs": [ + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "name": "initialize", + "type": "function", + "inputs": [ + { + "name": "_addressManager", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "name": "invalidatePreemptedHead", + "type": "function", + "inputs": [ + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "name": "isAuthorizedGhostCaller", + "type": "function", + "inputs": [ + { + "name": "caller", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "name": "isGhostContract", + "type": "function", + "inputs": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "name": "leaderIdleness", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_expectedAttemptId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "name": "leaderRevealVote", + "type": "function", + "inputs": [ + { + "name": "leaderRevealVoteParams", + "type": "tuple", + "components": [ + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "expectedAttemptId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "saltAsAValidator", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "txExecutionHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "messagesAndOtherFieldsHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "otherExecutionFieldsHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "resultValue", + "type": "uint8", + "internalType": "enum ITransactions.VoteType" + }, + { + "name": "messages", + "type": "tuple[]", + "components": [ + { + "name": "messageType", + "type": "uint8", + "internalType": "enum IMessages.MessageType" + }, + { + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "onAcceptance", + "type": "bool", + "internalType": "bool" + }, + { + "name": "saltNonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "feeParams", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "declaredBudget", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "allocationSubtree", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "callKey", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "useBalance", + "type": "bool", + "internalType": "bool" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]" + } + ], + "internalType": "struct IConsensusMainWithFees.LeaderRevealVoteParams" } ], - "name": "VoteRevealed", - "type": "event" + "outputs": [], + "stateMutability": "nonpayable" }, { + "name": "owner", + "type": "function", "inputs": [], - "name": "EVENTS_BATCH_SIZE", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "pendingOwner", + "type": "function", "inputs": [], - "name": "VERSION", "outputs": [ { - "internalType": "string", "name": "", - "type": "string" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "view" }, { + "name": "processIdleness", + "type": "function", "inputs": [ { - "internalType": "bytes32", "name": "_txId", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "address", - "name": "_operator", - "type": "address" - }, + "name": "_expectedAttemptId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "name": "promoteNextPendingTransactions", + "type": "function", + "inputs": [ { - "internalType": "bytes", - "name": "_vrfProof", - "type": "bytes" + "name": "recipients", + "type": "address[]", + "internalType": "address[]" } ], - "name": "activateTransaction", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "name": "proposeReceipt", + "type": "function", "inputs": [ { - "internalType": "address", - "name": "_sender", - "type": "address" + "name": "", + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "address", - "name": "_recipient", - "type": "address" + "name": "", + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "uint256", - "name": "_numOfInitialValidators", - "type": "uint256" + "name": "", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "_maxRotations", - "type": "uint256" + "name": "", + "type": "address", + "internalType": "address" }, { - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" + "name": "", + "type": "bytes", + "internalType": "bytes" }, { - "internalType": "uint256", - "name": "_validUntil", - "type": "uint256" - } - ], - "name": "addTransaction", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "addressManager", - "outputs": [ - { - "internalType": "contract IAddressManager", "name": "", - "type": "address" + "type": "bytes", + "internalType": "bytes" } ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "cancelTransaction", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "pure" }, { + "name": "proposeReceipt", + "type": "function", "inputs": [ { - "internalType": "bytes32", "name": "_txId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_commitHash", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "uint256", - "name": "_validatorIndex", - "type": "uint256" - } - ], - "name": "commitVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_sender", - "type": "address" + "name": "_txExecutionHash", + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "uint256", - "name": "_numOfInitialValidators", - "type": "uint256" + "name": "_processingBlock", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "_maxRotations", - "type": "uint256" + "name": "_storageFeeUsed", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" + "name": "_eqBlocksOutputs", + "type": "bytes", + "internalType": "bytes" }, { - "internalType": "uint256", - "name": "_saltNonce", - "type": "uint256" + "name": "_vrfProof", + "type": "bytes", + "internalType": "bytes" }, { - "internalType": "uint256", - "name": "_validUntil", - "type": "uint256" + "name": "_expectedAttemptId", + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "deploySalted", "outputs": [], - "stateMutability": "payable", - "type": "function" + "stateMutability": "nonpayable" }, { + "name": "proposeReceipt", + "type": "function", "inputs": [ { - "internalType": "address", - "name": "_recipient", - "type": "address" + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "uint256", - "name": "_value", - "type": "uint256" + "name": "_txExecutionHash", + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "executeMessage", - "outputs": [ + "name": "_processingBlock", + "type": "uint256", + "internalType": "uint256" + }, { - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ + "name": "_eqBlocksOutputs", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "_vrfProof", + "type": "bytes", + "internalType": "bytes" + }, { - "internalType": "bytes32[]", - "name": "_txIds", - "type": "bytes32[]" + "name": "_expectedAttemptId", + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "finalizeIdlenessTxs", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "name": "proposeReceiptWithMessageEnvelope", + "type": "function", "inputs": [ { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" + "name": "p", + "type": "tuple", + "components": [ + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "txExecutionHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "processingBlock", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "storageFeeUsed", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "eqBlocksOutputs", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "vrfProof", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "reportedMessageFeesTotal", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "expectedAttemptId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "messageBytes", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "messageCount", + "type": "uint256", + "internalType": "uint256" + } + ], + "internalType": "struct IConsensusMainWithFees.MessageEnvelopeProposal" } ], - "name": "finalizeTransaction", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "name": "proposeReceiptWithMessages", + "type": "function", "inputs": [ { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" - } - ], - "name": "flushExternalMessages", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAddressManager", - "outputs": [ + "name": "", + "type": "bytes32", + "internalType": "bytes32" + }, { - "internalType": "contract IAddressManager", "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ + "type": "bytes32", + "internalType": "bytes32" + }, { - "internalType": "bytes32", - "name": "txId", - "type": "bytes32" - } - ], - "name": "getPendingTransactionValue", - "outputs": [ + "name": "", + "type": "uint256", + "internalType": "uint256" + }, { - "internalType": "uint256", "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ + "type": "uint256", + "internalType": "uint256" + }, { - "internalType": "address", - "name": "_addressManager", - "type": "address" + "name": "", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "reportedTotal", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "initialize", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "isGhostContract", + "name": "protocolComponentId", + "type": "function", + "inputs": [], "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "pure" }, { + "name": "registerGhostContract", + "type": "function", "inputs": [ { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" + "name": "ghost", + "type": "address", + "internalType": "address" } ], - "name": "leaderIdleness", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" + }, + { + "name": "renounceOwnership", + "type": "function", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" }, { + "name": "resolveTransactionBatchItem", + "type": "function", "inputs": [ { + "name": "command", + "type": "tuple", "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" + "type": "bytes32", + "internalType": "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[]" + "name": "expectedAttemptId", + "type": "bytes32", + "internalType": "bytes32" } ], - "internalType": "struct IConsensusMain.LeaderRevealVoteParams", - "name": "leaderRevealVoteParams", - "type": "tuple" - } - ], - "name": "leaderRevealVote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" + "internalType": "struct IIdlenessPhase.ProcessIdlenessParams" } ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingOwner", "outputs": [ { - "internalType": "address", - "name": "", - "type": "address" + "name": "outcome", + "type": "uint8", + "internalType": "uint8" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "nonpayable" }, { + "name": "resolveTransactions", + "type": "function", "inputs": [ { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" + "name": "_commands", + "type": "tuple[]", + "components": [ + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "expectedAttemptId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "internalType": "struct IIdlenessPhase.ProcessIdlenessParams[]" } ], - "name": "processIdleness", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "name": "retryFinalizationPromotion", + "type": "function", "inputs": [ { - "internalType": "address[]", - "name": "affectedRecipients", - "type": "address[]" + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "promoteNextPendingTransactions", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "name": "revealVote", + "type": "function", "inputs": [ { - "internalType": "bytes32", "name": "_txId", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "bytes32", - "name": "_txExecutionHash", - "type": "bytes32" + "name": "_voteHash", + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "uint256", - "name": "_processingBlock", - "type": "uint256" + "name": "_voteType", + "type": "uint8", + "internalType": "enum ITransactions.VoteType" }, { - "internalType": "address", - "name": "_operator", - "type": "address" + "name": "_otherExecutionFieldsHash", + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "bytes", - "name": "_eqBlocksOutputs", - "type": "bytes" + "name": "_nonce", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes", - "name": "_vrfProof", - "type": "bytes" + "name": "_validatorIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_expectedAttemptId", + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "proposeReceipt", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "name": "setAddressManager", + "type": "function", "inputs": [ { - "internalType": "bytes32[]", - "name": "_txIds", - "type": "bytes32[]" + "name": "_addressManager", + "type": "address", + "internalType": "address" } ], - "name": "redButtonFinalize", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "name": "submitAppeal", + "type": "function", "inputs": [ { - "internalType": "address", - "name": "ghost", - "type": "address" + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_expectedDecisionId", + "type": "uint256", + "internalType": "uint256" } ], - "name": "registerGhostContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "payable" }, { + "name": "topUpAndProgressFinalization", + "type": "function", "inputs": [ { - "internalType": "bytes32", "name": "_txId", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "bytes32", - "name": "_voteHash", - "type": "bytes32" - }, + "name": "_expectedDecisionId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ { - "internalType": "enum ITransactions.VoteType", - "name": "_voteType", - "type": "uint8" - }, + "name": "finalized", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "payable" + }, + { + "name": "topUpAndSubmitAppeal", + "type": "function", + "inputs": [ { - "internalType": "bytes32", - "name": "_otherExecutionFieldsHash", - "type": "bytes32" + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" + "name": "_expectedDecisionId", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "_validatorIndex", - "type": "uint256" + "name": "", + "type": "tuple", + "components": [ + { + "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": "uint256" + } + ], + "internalType": "struct IFeeManager.FeesDistribution" } ], - "name": "revealVote", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "payable" }, { + "name": "topUpFees", + "type": "function", "inputs": [ { - "internalType": "address", - "name": "_addressManager", - "type": "address" + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_feesDistribution", + "type": "tuple", + "components": [ + { + "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": "uint256" + } + ], + "internalType": "struct IFeeManager.FeesDistribution" } ], - "name": "setAddressManager", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "payable" }, { + "name": "transferEthOnBehalf", + "type": "function", "inputs": [ { - "internalType": "bytes32", - "name": "_txId", - "type": "bytes32" + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" } ], - "name": "submitAppeal", - "outputs": [], - "stateMutability": "payable", - "type": "function" + "outputs": [ + { + "name": "success", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "nonpayable" }, { + "name": "transferOwnership", + "type": "function", "inputs": [ { - "internalType": "address", "name": "newOwner", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "transferOwnership", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { - "stateMutability": "payable", - "type": "receive" + "type": "receive", + "stateMutability": "payable" } ], bytecode: "", }; const CONSENSUS_DATA_CONTRACT = { - address: "0x85D7bf947A512Fc640C75327A780c90847267697" as Address, + address: "0xc5FA6f82BEe53598825d6edf7E3e24613082c75B" as Address, abi: [ { + "type": "constructor", "inputs": [], + "stateMutability": "nonpayable" + }, + { "name": "AccessControlBadConfirmation", - "type": "error" + "type": "error", + "inputs": [] }, { + "name": "AccessControlUnauthorizedAccount", + "type": "error", "inputs": [ { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "bytes32", "name": "neededRole", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } - ], - "name": "AccessControlUnauthorizedAccount", - "type": "error" + ] }, { - "inputs": [], "name": "InvalidInitialization", - "type": "error" + "type": "error", + "inputs": [] + }, + { + "name": "InvalidRegistry", + "type": "error", + "inputs": [] + }, + { + "name": "InvalidTransactionStatus", + "type": "error", + "inputs": [] }, { - "inputs": [], "name": "NotInitializing", - "type": "error" + "type": "error", + "inputs": [] }, { + "name": "OwnableInvalidOwner", + "type": "error", "inputs": [ { - "internalType": "address", "name": "owner", - "type": "address" + "type": "address", + "internalType": "address" } - ], - "name": "OwnableInvalidOwner", - "type": "error" + ] }, { + "name": "OwnableUnauthorizedAccount", + "type": "error", "inputs": [ { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" } - ], - "name": "OwnableUnauthorizedAccount", - "type": "error" + ] + }, + { + "name": "PhaseDeadlineNotInitialized", + "type": "error", + "inputs": [ + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "status", + "type": "uint8", + "internalType": "uint8" + } + ] }, { - "inputs": [], "name": "ReentrancyGuardReentrantCall", - "type": "error" + "type": "error", + "inputs": [] + }, + { + "name": "RegistryBindingLocked", + "type": "error", + "inputs": [] }, { - "anonymous": false, + "name": "Initialized", + "type": "event", "inputs": [ { - "indexed": false, - "internalType": "uint64", "name": "version", - "type": "uint64" + "type": "uint64", + "indexed": false, + "internalType": "uint64" } ], - "name": "Initialized", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "OwnershipTransferStarted", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "address", "name": "previousOwner", - "type": "address" + "type": "address", + "indexed": true, + "internalType": "address" }, { - "indexed": true, - "internalType": "address", "name": "newOwner", - "type": "address" + "type": "address", + "indexed": true, + "internalType": "address" } ], - "name": "OwnershipTransferStarted", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "OwnershipTransferred", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "address", "name": "previousOwner", - "type": "address" + "type": "address", + "indexed": true, + "internalType": "address" }, { - "indexed": true, - "internalType": "address", "name": "newOwner", - "type": "address" + "type": "address", + "indexed": true, + "internalType": "address" } ], - "name": "OwnershipTransferred", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "RoleAdminChanged", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "role", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { - "indexed": true, - "internalType": "bytes32", "name": "previousAdminRole", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { - "indexed": true, - "internalType": "bytes32", "name": "newAdminRole", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" } ], - "name": "RoleAdminChanged", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "RoleGranted", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "role", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { - "indexed": true, - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "indexed": true, + "internalType": "address" }, { - "indexed": true, - "internalType": "address", "name": "sender", - "type": "address" + "type": "address", + "indexed": true, + "internalType": "address" } ], - "name": "RoleGranted", - "type": "event" + "anonymous": false }, { - "anonymous": false, + "name": "RoleRevoked", + "type": "event", "inputs": [ { - "indexed": true, - "internalType": "bytes32", "name": "role", - "type": "bytes32" + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" }, { - "indexed": true, - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "indexed": true, + "internalType": "address" }, { - "indexed": true, - "internalType": "address", "name": "sender", - "type": "address" + "type": "address", + "indexed": true, + "internalType": "address" } ], - "name": "RoleRevoked", - "type": "event" + "anonymous": false }, { - "inputs": [], "name": "DEFAULT_ADMIN_ROLE", + "type": "function", + "inputs": [], "outputs": [ { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { - "inputs": [], "name": "acceptOwnership", + "type": "function", + "inputs": [], "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [], "name": "addressManager", + "type": "function", + "inputs": [], "outputs": [ { - "internalType": "contract IAddressManager", "name": "", - "type": "address" + "type": "address", + "internalType": "contract IAddressManager" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "canFinalize", + "type": "function", "inputs": [ { - "internalType": "bytes32", "name": "_txId", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "uint256", "name": "_currentTimestamp", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_expectedDecisionId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "ready", + "type": "bool", + "internalType": "bool" + }, + { + "name": "evaluatedAt", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "appealDeadline", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "name": "estimateAppealBond", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "name": "estimateLatestAppealCharge", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "decisionId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "bond", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "funding", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "appealDeadline", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "name": "getCurrentActivator", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "newActivator", + "type": "address", + "internalType": "address" + }, + { + "name": "activatorIsIdle", + "type": "bool", + "internalType": "bool" + }, + { + "name": "slots", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "secondsUntilNextBoundary", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "currentStatus", + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" + } + ], + "stateMutability": "view" + }, + { + "name": "getCurrentLeader", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "newLeader", + "type": "address", + "internalType": "address" + }, + { + "name": "leaderIsIdle", + "type": "bool", + "internalType": "bool" + }, + { + "name": "slots", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "secondsUntilNextBoundary", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "currentStatus", + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" + } + ], + "stateMutability": "view" + }, + { + "name": "getCurrentValidators", + "type": "function", + "inputs": [ + { + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "canFinalize", "outputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "name": "validators", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "leaderIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "idleIndexes", + "type": "uint256[]", + "internalType": "uint256[]" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "leaderIsIdle", + "type": "bool", + "internalType": "bool" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "name": "slots", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "secondsUntilNextBoundary", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "currentStatus", + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "getLatestAcceptedTransaction", + "type": "function", "inputs": [ { - "internalType": "address", "name": "recipient", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "getLatestAcceptedTransaction", "outputs": [ { + "name": "inputData", + "type": "tuple", "components": [ { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" + "name": "observedAt", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", "name": "sender", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "recipient", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "initialRotations", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "txSlot", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "createdTimestamp", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "lastVoteTimestamp", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes32", "name": "randomSeed", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.ResultType" }, { - "internalType": "bytes32", "name": "txExecutionHash", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "bytes", "name": "txCalldata", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" }, { - "internalType": "bytes", "name": "eqBlocksOutputs", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" }, { + "name": "messages", + "type": "tuple[]", "components": [ { - "internalType": "enum IMessages.MessageType", "name": "messageType", - "type": "uint8" + "type": "uint8", + "internalType": "enum IMessages.MessageType" }, { - "internalType": "address", "name": "recipient", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "value", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes", "name": "data", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" }, { - "internalType": "bool", "name": "onAcceptance", - "type": "bool" + "type": "bool", + "internalType": "bool" }, { - "internalType": "uint256", "name": "saltNonce", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "feeParams", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "declaredBudget", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "allocationSubtree", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "callKey", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "useBalance", + "type": "bool", + "internalType": "bool" } ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" + "internalType": "struct IMessages.SubmittedMessage[]" }, { - "internalType": "enum IQueues.QueueType", "name": "queueType", - "type": "uint8" + "type": "uint8", + "internalType": "enum IQueues.QueueType" }, { - "internalType": "uint256", "name": "queuePosition", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", "name": "activator", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "lastLeader", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "enum ITransactions.TransactionStatus", "name": "status", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" }, { - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { + "name": "readStateBlockRange", + "type": "tuple", "components": [ { - "internalType": "uint256", "name": "activationBlock", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "processingBlock", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "proposalBlock", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" + "internalType": "struct ITransactions.ReadStateBlockRange" }, { - "internalType": "uint256", "name": "numOfRounds", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { + "name": "lastRound", + "type": "tuple", "components": [ { - "internalType": "uint256", "name": "round", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "leaderIndex", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "votesCommitted", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "votesRevealed", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "appealBond", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "rotationsLeft", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.ResultType" }, { - "internalType": "address[]", "name": "roundValidators", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" }, { - "internalType": "enum ITransactions.VoteType[]", "name": "validatorVotes", - "type": "uint8[]" + "type": "uint8[]", + "internalType": "enum ITransactions.VoteType[]" }, { - "internalType": "bytes32[]", "name": "validatorVotesHash", - "type": "bytes32[]" + "type": "bytes32[]", + "internalType": "bytes32[]" }, { - "internalType": "bytes32[]", "name": "validatorResultHash", - "type": "bytes32[]" + "type": "bytes32[]", + "internalType": "bytes32[]" } ], - "internalType": "struct ITransactions.RoundData", - "name": "lastRound", - "type": "tuple" + "internalType": "struct ITransactions.RoundData" }, { - "internalType": "address[]", "name": "consumedValidators", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" } ], - "internalType": "struct ConsensusData.TransactionData", - "name": "inputData", - "type": "tuple" + "internalType": "struct ConsensusData.TransactionData" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "getLatestAcceptedTransactions", + "type": "function", "inputs": [ { - "internalType": "address", "name": "recipient", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "startIndex", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "pageSize", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "getLatestAcceptedTransactions", "outputs": [ { + "name": "", + "type": "tuple[]", "components": [ { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" + "name": "observedAt", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", "name": "sender", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "recipient", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "initialRotations", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "txSlot", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "createdTimestamp", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "lastVoteTimestamp", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes32", "name": "randomSeed", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.ResultType" }, { - "internalType": "bytes32", "name": "txExecutionHash", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "bytes", "name": "txCalldata", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" }, { - "internalType": "bytes", "name": "eqBlocksOutputs", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" }, { + "name": "messages", + "type": "tuple[]", "components": [ { - "internalType": "enum IMessages.MessageType", "name": "messageType", - "type": "uint8" + "type": "uint8", + "internalType": "enum IMessages.MessageType" }, { - "internalType": "address", "name": "recipient", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "value", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes", "name": "data", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" }, { - "internalType": "bool", "name": "onAcceptance", - "type": "bool" + "type": "bool", + "internalType": "bool" }, { - "internalType": "uint256", "name": "saltNonce", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "feeParams", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "declaredBudget", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "allocationSubtree", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "callKey", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "useBalance", + "type": "bool", + "internalType": "bool" } ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" + "internalType": "struct IMessages.SubmittedMessage[]" }, { - "internalType": "enum IQueues.QueueType", "name": "queueType", - "type": "uint8" + "type": "uint8", + "internalType": "enum IQueues.QueueType" }, { - "internalType": "uint256", "name": "queuePosition", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", "name": "activator", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "lastLeader", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "enum ITransactions.TransactionStatus", "name": "status", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" }, { - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { + "name": "readStateBlockRange", + "type": "tuple", "components": [ { - "internalType": "uint256", "name": "activationBlock", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "processingBlock", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "proposalBlock", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" + "internalType": "struct ITransactions.ReadStateBlockRange" }, { - "internalType": "uint256", "name": "numOfRounds", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { + "name": "lastRound", + "type": "tuple", "components": [ { - "internalType": "uint256", "name": "round", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "leaderIndex", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "votesCommitted", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "votesRevealed", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "appealBond", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "rotationsLeft", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.ResultType" }, { - "internalType": "address[]", "name": "roundValidators", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" }, { - "internalType": "enum ITransactions.VoteType[]", "name": "validatorVotes", - "type": "uint8[]" + "type": "uint8[]", + "internalType": "enum ITransactions.VoteType[]" }, { - "internalType": "bytes32[]", "name": "validatorVotesHash", - "type": "bytes32[]" + "type": "bytes32[]", + "internalType": "bytes32[]" }, { - "internalType": "bytes32[]", "name": "validatorResultHash", - "type": "bytes32[]" + "type": "bytes32[]", + "internalType": "bytes32[]" } ], - "internalType": "struct ITransactions.RoundData", - "name": "lastRound", - "type": "tuple" + "internalType": "struct ITransactions.RoundData" }, { - "internalType": "address[]", "name": "consumedValidators", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" } ], - "internalType": "struct ConsensusData.TransactionData[]", - "name": "", - "type": "tuple[]" + "internalType": "struct ConsensusData.TransactionData[]" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "getLatestAcceptedTxCount", + "type": "function", "inputs": [ { - "internalType": "address", "name": "recipient", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "getLatestAcceptedTxCount", "outputs": [ { - "internalType": "uint256", "name": "", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "getLatestFinalizedTransaction", + "type": "function", "inputs": [ { - "internalType": "address", "name": "recipient", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "getLatestFinalizedTransaction", "outputs": [ { + "name": "inputData", + "type": "tuple", "components": [ { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" + "name": "observedAt", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", "name": "sender", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "recipient", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "initialRotations", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "txSlot", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "createdTimestamp", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "lastVoteTimestamp", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes32", "name": "randomSeed", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.ResultType" }, { - "internalType": "bytes32", "name": "txExecutionHash", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "bytes", "name": "txCalldata", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" }, { - "internalType": "bytes", "name": "eqBlocksOutputs", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" }, { + "name": "messages", + "type": "tuple[]", "components": [ { - "internalType": "enum IMessages.MessageType", "name": "messageType", - "type": "uint8" + "type": "uint8", + "internalType": "enum IMessages.MessageType" }, { - "internalType": "address", "name": "recipient", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "value", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes", "name": "data", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" }, { - "internalType": "bool", "name": "onAcceptance", - "type": "bool" + "type": "bool", + "internalType": "bool" }, { - "internalType": "uint256", "name": "saltNonce", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "feeParams", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "declaredBudget", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "allocationSubtree", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "callKey", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "useBalance", + "type": "bool", + "internalType": "bool" } ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" + "internalType": "struct IMessages.SubmittedMessage[]" }, { - "internalType": "enum IQueues.QueueType", "name": "queueType", - "type": "uint8" + "type": "uint8", + "internalType": "enum IQueues.QueueType" }, { - "internalType": "uint256", "name": "queuePosition", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", "name": "activator", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "lastLeader", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "enum ITransactions.TransactionStatus", "name": "status", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" }, { - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { + "name": "readStateBlockRange", + "type": "tuple", "components": [ { - "internalType": "uint256", "name": "activationBlock", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "processingBlock", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "proposalBlock", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" + "internalType": "struct ITransactions.ReadStateBlockRange" }, { - "internalType": "uint256", "name": "numOfRounds", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { + "name": "lastRound", + "type": "tuple", "components": [ { - "internalType": "uint256", "name": "round", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "leaderIndex", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "votesCommitted", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "votesRevealed", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "appealBond", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "rotationsLeft", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.ResultType" }, { - "internalType": "address[]", "name": "roundValidators", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" }, { - "internalType": "enum ITransactions.VoteType[]", "name": "validatorVotes", - "type": "uint8[]" + "type": "uint8[]", + "internalType": "enum ITransactions.VoteType[]" }, { - "internalType": "bytes32[]", "name": "validatorVotesHash", - "type": "bytes32[]" + "type": "bytes32[]", + "internalType": "bytes32[]" }, { - "internalType": "bytes32[]", "name": "validatorResultHash", - "type": "bytes32[]" + "type": "bytes32[]", + "internalType": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData" + }, + { + "name": "consumedValidators", + "type": "address[]", + "internalType": "address[]" + } + ], + "internalType": "struct ConsensusData.TransactionData" + } + ], + "stateMutability": "view" + }, + { + "name": "getLatestFinalizedTransactions", + "type": "function", + "inputs": [ + { + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "startIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "pageSize", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "tuple[]", + "components": [ + { + "name": "observedAt", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "initialRotations", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "txSlot", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "createdTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "lastVoteTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "randomSeed", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "result", + "type": "uint8", + "internalType": "enum ITransactions.ResultType" + }, + { + "name": "txExecutionHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "txCalldata", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "eqBlocksOutputs", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "messages", + "type": "tuple[]", + "components": [ + { + "name": "messageType", + "type": "uint8", + "internalType": "enum IMessages.MessageType" + }, + { + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "onAcceptance", + "type": "bool", + "internalType": "bool" + }, + { + "name": "saltNonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "feeParams", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "declaredBudget", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "allocationSubtree", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "callKey", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "useBalance", + "type": "bool", + "internalType": "bool" + } + ], + "internalType": "struct IMessages.SubmittedMessage[]" + }, + { + "name": "queueType", + "type": "uint8", + "internalType": "enum IQueues.QueueType" + }, + { + "name": "queuePosition", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "activator", + "type": "address", + "internalType": "address" + }, + { + "name": "lastLeader", + "type": "address", + "internalType": "address" + }, + { + "name": "status", + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" + }, + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "readStateBlockRange", + "type": "tuple", + "components": [ + { + "name": "activationBlock", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "processingBlock", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "proposalBlock", + "type": "uint256", + "internalType": "uint256" } ], - "internalType": "struct ITransactions.RoundData", + "internalType": "struct ITransactions.ReadStateBlockRange" + }, + { + "name": "numOfRounds", + "type": "uint256", + "internalType": "uint256" + }, + { "name": "lastRound", - "type": "tuple" + "type": "tuple", + "components": [ + { + "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": "uint256" + }, + { + "name": "result", + "type": "uint8", + "internalType": "enum ITransactions.ResultType" + }, + { + "name": "roundValidators", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "validatorVotes", + "type": "uint8[]", + "internalType": "enum ITransactions.VoteType[]" + }, + { + "name": "validatorVotesHash", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "validatorResultHash", + "type": "bytes32[]", + "internalType": "bytes32[]" + } + ], + "internalType": "struct ITransactions.RoundData" }, { - "internalType": "address[]", "name": "consumedValidators", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" } ], - "internalType": "struct ConsensusData.TransactionData", - "name": "inputData", - "type": "tuple" + "internalType": "struct ConsensusData.TransactionData[]" + } + ], + "stateMutability": "view" + }, + { + "name": "getLatestFinalizedTxCount", + "type": "function", + "inputs": [ + { + "name": "recipient", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "name": "getRoleAdmin", + "type": "function", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "getStoredTransactionData", + "type": "function", "inputs": [ { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "startIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pageSize", - "type": "uint256" + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "getLatestFinalizedTransactions", "outputs": [ { + "name": "", + "type": "tuple", "components": [ { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" + "name": "observedAt", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", "name": "sender", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "recipient", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "initialRotations", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "txSlot", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "createdTimestamp", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "lastVoteTimestamp", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes32", "name": "randomSeed", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.ResultType" }, { - "internalType": "bytes32", "name": "txExecutionHash", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "bytes", "name": "txCalldata", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" }, { - "internalType": "bytes", "name": "eqBlocksOutputs", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" }, { + "name": "messages", + "type": "tuple[]", "components": [ { - "internalType": "enum IMessages.MessageType", "name": "messageType", - "type": "uint8" + "type": "uint8", + "internalType": "enum IMessages.MessageType" }, { - "internalType": "address", "name": "recipient", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "value", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes", "name": "data", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" }, { - "internalType": "bool", "name": "onAcceptance", - "type": "bool" + "type": "bool", + "internalType": "bool" }, { - "internalType": "uint256", "name": "saltNonce", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "feeParams", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "declaredBudget", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "allocationSubtree", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "callKey", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "useBalance", + "type": "bool", + "internalType": "bool" } ], - "internalType": "struct IMessages.SubmittedMessage[]", - "name": "messages", - "type": "tuple[]" + "internalType": "struct IMessages.SubmittedMessage[]" }, { - "internalType": "enum IQueues.QueueType", "name": "queueType", - "type": "uint8" + "type": "uint8", + "internalType": "enum IQueues.QueueType" }, { - "internalType": "uint256", "name": "queuePosition", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "address", "name": "activator", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "lastLeader", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "enum ITransactions.TransactionStatus", "name": "status", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" }, { - "internalType": "bytes32", "name": "txId", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { + "name": "readStateBlockRange", + "type": "tuple", "components": [ { - "internalType": "uint256", "name": "activationBlock", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "processingBlock", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "proposalBlock", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" + "internalType": "struct ITransactions.ReadStateBlockRange" }, { - "internalType": "uint256", "name": "numOfRounds", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { + "name": "lastRound", + "type": "tuple", "components": [ { - "internalType": "uint256", "name": "round", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "leaderIndex", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "votesCommitted", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "votesRevealed", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "appealBond", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "rotationsLeft", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.ResultType" }, { - "internalType": "address[]", "name": "roundValidators", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" }, { - "internalType": "enum ITransactions.VoteType[]", "name": "validatorVotes", - "type": "uint8[]" + "type": "uint8[]", + "internalType": "enum ITransactions.VoteType[]" }, { - "internalType": "bytes32[]", "name": "validatorVotesHash", - "type": "bytes32[]" + "type": "bytes32[]", + "internalType": "bytes32[]" }, { - "internalType": "bytes32[]", "name": "validatorResultHash", - "type": "bytes32[]" + "type": "bytes32[]", + "internalType": "bytes32[]" } ], - "internalType": "struct ITransactions.RoundData", - "name": "lastRound", - "type": "tuple" + "internalType": "struct ITransactions.RoundData" }, { - "internalType": "address[]", "name": "consumedValidators", - "type": "address[]" + "type": "address[]", + "internalType": "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" + "internalType": "struct ConsensusData.TransactionData" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "getStoredTransactionStatus", + "type": "function", "inputs": [ { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" + "name": "_txId", + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "getRoleAdmin", "outputs": [ { - "internalType": "bytes32", "name": "", - "type": "bytes32" + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "getTransactionAllData", + "type": "function", "inputs": [ { - "internalType": "bytes32", "name": "_txId", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "getTransactionAllData", "outputs": [ { + "name": "transaction", + "type": "tuple", "components": [ { - "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.ResultType" }, { - "internalType": "enum ITransactions.VoteType", "name": "txExecutionResult", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.VoteType" }, { - "internalType": "enum ITransactions.TransactionStatus", - "name": "previousStatus", - "type": "uint8" - }, - { - "internalType": "enum ITransactions.TransactionStatus", "name": "status", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" }, { - "internalType": "address", "name": "txOrigin", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "sender", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "recipient", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "address", "name": "activator", - "type": "address" + "type": "address", + "internalType": "address" }, { - "internalType": "uint256", "name": "txSlot", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "initialRotations", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "numOfInitialValidators", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "epoch", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes32", "name": "id", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "bytes32", "name": "randomSeed", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "bytes32", "name": "txExecutionHash", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "bytes32", "name": "resultHash", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "bytes", "name": "txCalldata", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" }, { - "internalType": "bytes", "name": "eqBlocksOutputs", - "type": "bytes" + "type": "bytes", + "internalType": "bytes" }, { + "name": "readStateBlockRanges", + "type": "tuple[]", "components": [ { - "internalType": "uint256", "name": "activationBlock", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "processingBlock", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "proposalBlock", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "internalType": "struct ITransactions.ReadStateBlockRange[]", - "name": "readStateBlockRanges", - "type": "tuple[]" + "internalType": "struct ITransactions.ReadStateBlockRange[]" }, { - "internalType": "uint256", "name": "validUntil", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "value", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "lockedStorageUnitPrice", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "storageFeeUsed", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "lockedReceiptGasPrice", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "txSigner", + "type": "address", + "internalType": "address" + }, + { + "name": "queueContext", + "type": "uint8", + "internalType": "enum ITransactions.QueueContext" } ], - "internalType": "struct ITransactions.Transaction", - "name": "transaction", - "type": "tuple" + "internalType": "struct ITransactions.Transaction" }, { + "name": "roundsData", + "type": "tuple[]", "components": [ { - "internalType": "uint256", "name": "round", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "leaderIndex", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "votesCommitted", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "votesRevealed", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "appealBond", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", "name": "rotationsLeft", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.ResultType" }, { - "internalType": "address[]", "name": "roundValidators", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" }, { - "internalType": "enum ITransactions.VoteType[]", "name": "validatorVotes", - "type": "uint8[]" + "type": "uint8[]", + "internalType": "enum ITransactions.VoteType[]" }, { - "internalType": "bytes32[]", "name": "validatorVotesHash", - "type": "bytes32[]" + "type": "bytes32[]", + "internalType": "bytes32[]" }, { - "internalType": "bytes32[]", "name": "validatorResultHash", - "type": "bytes32[]" + "type": "bytes32[]", + "internalType": "bytes32[]" } ], - "internalType": "struct ITransactions.RoundData[]", - "name": "roundsData", - "type": "tuple[]" + "internalType": "struct ITransactions.RoundData[]" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "getTransactionLifecycle", + "type": "function", "inputs": [ { - "internalType": "bytes32", "name": "_txId", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "uint256", "name": "_timestamp", - "type": "uint256" + "type": "uint256", + "internalType": "uint256" } ], - "name": "getTransactionData", "outputs": [ { + "name": "lifecycle", + "type": "tuple", "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" + "name": "storedStatus", + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" }, { + "name": "resolution", + "type": "tuple", "components": [ { - "internalType": "enum IMessages.MessageType", - "name": "messageType", - "type": "uint8" + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "address", - "name": "recipient", - "type": "address" + "name": "storedStatus", + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" }, { - "internalType": "uint256", - "name": "value", - "type": "uint256" + "name": "projectedStatus", + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" }, { - "internalType": "bytes", - "name": "data", - "type": "bytes" + "name": "action", + "type": "uint8", + "internalType": "enum IIdlenessPhase.ResolutionAction" }, { - "internalType": "bool", - "name": "onAcceptance", - "type": "bool" + "name": "result", + "type": "uint8", + "internalType": "enum ITransactions.ResultType" }, { - "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": [ + "name": "resultHash", + "type": "bytes32", + "internalType": "bytes32" + }, { - "internalType": "uint256", - "name": "activationBlock", - "type": "uint256" + "name": "source", + "type": "uint8", + "internalType": "enum ITransactionManager.ResolutionSource" }, { - "internalType": "uint256", - "name": "processingBlock", - "type": "uint256" + "name": "sourceRound", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "proposalBlock", - "type": "uint256" + "name": "sourceGeneration", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "sourceRoundContextHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "roundPlanHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "resultRound", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "resultGeneration", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "basisDecisionId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "context", + "type": "uint8", + "internalType": "enum ITransactionManager.ResolutionContext" + }, + { + "name": "attemptId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "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": "uint256" + }, + { + "name": "materializesDecision", + "type": "bool", + "internalType": "bool" + }, + { + "name": "actionOutcomeDeterministic", + "type": "bool", + "internalType": "bool" + }, + { + "name": "nonCurrentEvaluation", + "type": "bool", + "internalType": "bool" } ], - "internalType": "struct ITransactions.ReadStateBlockRange", - "name": "readStateBlockRange", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "numOfRounds", - "type": "uint256" + "internalType": "struct IIdlenessPhase.ResolutionPlan" }, { + "name": "latestDecision", + "type": "tuple", "components": [ { - "internalType": "uint256", - "name": "round", - "type": "uint256" + "name": "exists", + "type": "bool", + "internalType": "bool" }, { - "internalType": "uint256", - "name": "leaderIndex", - "type": "uint256" + "name": "decisionId", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "votesCommitted", - "type": "uint256" + "name": "basisDecisionId", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "uint256", - "name": "votesRevealed", - "type": "uint256" + "name": "context", + "type": "uint8", + "internalType": "enum ITransactionManager.ResolutionContext" }, { - "internalType": "uint256", - "name": "appealBond", - "type": "uint256" + "name": "source", + "type": "uint8", + "internalType": "enum ITransactionManager.ResolutionSource" }, { - "internalType": "uint256", - "name": "rotationsLeft", - "type": "uint256" + "name": "sourceAttemptId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "sourceStatus", + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" + }, + { + "name": "status", + "type": "uint8", + "internalType": "enum ITransactions.TransactionStatus" + }, + { + "name": "sourceRound", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "sourceGeneration", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "sourceRoundContextHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "roundPlanHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "resultRound", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "resultGeneration", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8" + "type": "uint8", + "internalType": "enum ITransactions.ResultType" }, { - "internalType": "address[]", - "name": "roundValidators", - "type": "address[]" + "name": "resultHash", + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "enum ITransactions.VoteType[]", - "name": "validatorVotes", - "type": "uint8[]" + "name": "effectiveAt", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes32[]", - "name": "validatorVotesHash", - "type": "bytes32[]" + "name": "materializedAt", + "type": "uint256", + "internalType": "uint256" }, { - "internalType": "bytes32[]", - "name": "validatorResultHash", - "type": "bytes32[]" + "name": "appealDeadline", + "type": "uint256", + "internalType": "uint256" } ], - "internalType": "struct ITransactions.RoundData", - "name": "lastRound", - "type": "tuple" + "internalType": "struct ITransactionManager.DecisionRecord" }, { - "internalType": "address[]", - "name": "consumedValidators", - "type": "address[]" + "name": "decisionActive", + "type": "bool", + "internalType": "bool" + }, + { + "name": "executionGeneration", + "type": "uint256", + "internalType": "uint256" } ], - "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" + "internalType": "struct ConsensusData.TransactionLifecycle" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "getValidatorsForLastRound", + "type": "function", "inputs": [ { - "internalType": "bytes32", "name": "_txId", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" } ], - "name": "getValidatorsForLastRound", "outputs": [ { - "internalType": "address[]", "name": "validators", - "type": "address[]" + "type": "address[]", + "internalType": "address[]" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "grantRole", + "type": "function", "inputs": [ { - "internalType": "bytes32", "name": "role", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "grantRole", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "name": "hasRole", + "type": "function", "inputs": [ { - "internalType": "bytes32", "name": "role", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "hasRole", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "initialize", + "type": "function", "inputs": [ { - "internalType": "address", "name": "_addressManager", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "initialize", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { - "inputs": [], - "name": "owner", + "name": "isRoundValidator", + "type": "function", + "inputs": [ + { + "name": "txId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "round", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "validator", + "type": "address", + "internalType": "address" + } + ], "outputs": [ { - "internalType": "address", "name": "", - "type": "address" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "owner", + "type": "function", "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { "name": "pendingOwner", + "type": "function", + "inputs": [], "outputs": [ { - "internalType": "address", "name": "", - "type": "address" + "type": "address", + "internalType": "address" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "protocolComponentId", + "type": "function", "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "pure" + }, + { "name": "renounceOwnership", + "type": "function", + "inputs": [], "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "name": "renounceRole", + "type": "function", "inputs": [ { - "internalType": "bytes32", "name": "role", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "address", "name": "callerConfirmation", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "renounceRole", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "name": "revokeRole", + "type": "function", "inputs": [ { - "internalType": "bytes32", "name": "role", - "type": "bytes32" + "type": "bytes32", + "internalType": "bytes32" }, { - "internalType": "address", "name": "account", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "revokeRole", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "name": "setAddressManager", + "type": "function", "inputs": [ { - "internalType": "address", "name": "_addressManager", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "setAddressManager", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" }, { + "name": "supportsInterface", + "type": "function", "inputs": [ { - "internalType": "bytes4", "name": "interfaceId", - "type": "bytes4" + "type": "bytes4", + "internalType": "bytes4" } ], - "name": "supportsInterface", "outputs": [ { - "internalType": "bool", "name": "", - "type": "bool" + "type": "bool", + "internalType": "bool" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "view" }, { + "name": "transferOwnership", + "type": "function", "inputs": [ { - "internalType": "address", "name": "newOwner", - "type": "address" + "type": "address", + "internalType": "address" } ], - "name": "transferOwnership", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "nonpayable" } ], bytecode: "", @@ -3393,6 +5478,7 @@ const CONSENSUS_DATA_CONTRACT = { export const testnetBradbury: GenLayerChain = defineChain({ id: 0x107d, isStudio: false, + genesisHash: "0x17d89764d4f4f963158fc4c5e8f2cb670c2837740b35f37081c12860c3df97e4", name: "Genlayer Bradbury Testnet", rpcUrls: { default: { diff --git a/src/client/client.ts b/src/client/client.ts index 5e46852..6f5f20d 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -18,6 +18,7 @@ import {stakingActions} from "../staking/actions"; import {vestingActions} from "../vesting/actions"; import {GenLayerClient, GenLayerChain} from "@/types"; import {chainActions} from "@/chains/actions"; +import {assertNetworkIdentity} from "./networkIdentity"; import {localnet} from "@/chains"; // Define the configuration interface for the client @@ -72,14 +73,33 @@ const assertChainMatch = async ( const getCustomTransportConfig = (config: ClientConfig, chainConfig: GenLayerChain) => { const isAddress = typeof config.account !== "object"; + const rpc = async ({method, params = []}: {method: string; params?: any[]}) => { + const response = await fetch(chainConfig.rpcUrls.default.http[0], { + method: "POST", headers: {"Content-Type": "application/json"}, + body: JSON.stringify({jsonrpc: "2.0", id: Date.now(), method, params}), + }); + if (!response.ok) throw new Error(`RPC HTTP ${response.status}`); + const data = await response.json(); + if (data.error) throw data.error; + return data.result; + }; + let identityCheck: Promise | undefined; return { async request({method, params = []}: {method: string; params: any[]}) { + if (chainConfig.genesisHash) { + // Recheck before every broadcast, including locally signed transactions. + if (!identityCheck || method === "eth_sendRawTransaction" || method === "eth_sendTransaction" || method === "eth_signTransaction") { + identityCheck = assertNetworkIdentity(rpc, chainConfig).catch(error => {identityCheck = undefined; throw error;}); + } + await identityCheck; + } if (PROVIDER_METHODS.has(method) && isAddress) { const provider = config.provider || (typeof window !== "undefined" ? window.ethereum : undefined); if (provider) { try { if (method === "eth_sendTransaction" || method === "eth_signTransaction") { await assertChainMatch(provider, chainConfig); + await assertNetworkIdentity(args => provider.request(args), chainConfig); } return await provider.request({method, params}); } catch (err) { @@ -90,26 +110,7 @@ const getCustomTransportConfig = (config: ClientConfig, chainConfig: GenLayerCha } try { - const response = await fetch(chainConfig.rpcUrls.default.http[0], { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - jsonrpc: "2.0", - id: Date.now(), - method, - params, - }), - }); - - const data = await response.json(); - - if (data.error) { - throw data.error; - } - - return data.result; + return await rpc({method, params}); } catch (err) { console.error(`GenLayer RPC error (${method}):`, (err as Error).message || err); throw err; @@ -129,10 +130,10 @@ const getCustomTransportConfig = (config: ClientConfig, chainConfig: GenLayerCha * @returns Configured client with contract, transaction, and staking methods */ export const createClient = (config: ClientConfig = {chain: localnet}): GenLayerClient => { - const chainConfig = config.chain || localnet; - if (config.endpoint) { - chainConfig.rpcUrls.default.http = [config.endpoint]; - } + const source = config.chain || localnet; + const chainConfig = config.endpoint + ? {...source, rpcUrls: {...source.rpcUrls, default: {...source.rpcUrls.default, http: [config.endpoint]}}} + : source; const customTransport = custom(getCustomTransportConfig(config, chainConfig as GenLayerChain), {retryCount: 0, retryDelay: 0}); const publicClient = createPublicClient(chainConfig as GenLayerChain, customTransport).extend( diff --git a/src/client/networkIdentity.ts b/src/client/networkIdentity.ts new file mode 100644 index 0000000..ab74466 --- /dev/null +++ b/src/client/networkIdentity.ts @@ -0,0 +1,20 @@ +import {GenLayerChain} from "@/types"; + +type Request = (args: {method: string; params?: any[]}) => Promise; + +/** Chain IDs are reused across Bradbury deployments; validate genesis and contract code. */ +export async function assertNetworkIdentity(request: Request, chain: GenLayerChain): Promise { + if (!chain.genesisHash) return; + const id = await request({method: "eth_chainId"}); + const block = await request({method: "eth_getBlockByNumber", params: ["0x0", false]}); + if (BigInt(id) !== BigInt(chain.id) || block?.hash?.toLowerCase() !== chain.genesisHash.toLowerCase()) { + throw new Error("RPC network identity does not match Bradbury Phase 2; chain ID 4221 alone is insufficient."); + } + for (const contract of [chain.consensusMainContract, chain.stakingContract]) { + if (!contract) continue; + const code = await request({method: "eth_getCode", params: [contract.address, "latest"]}); + if (typeof code !== "string" || !/^0x[0-9a-f]+$/i.test(code) || code.length <= 2) { + throw new Error("Bradbury Phase 2 contract code is missing from the configured RPC."); + } + } +} diff --git a/src/types/chains.ts b/src/types/chains.ts index e3e4ed5..f1a7ce4 100644 --- a/src/types/chains.ts +++ b/src/types/chains.ts @@ -3,6 +3,8 @@ import {Address} from "./accounts"; export type GenLayerChain = Chain & { isStudio: boolean; + /** Genesis identity for networks that reuse a chain ID. */ + genesisHash?: `0x${string}`; consensusMainContract: { address: Address; abi: readonly unknown[]; diff --git a/tests/bradbury-network.test.ts b/tests/bradbury-network.test.ts new file mode 100644 index 0000000..0728bc6 --- /dev/null +++ b/tests/bradbury-network.test.ts @@ -0,0 +1,53 @@ +import {afterEach, describe, expect, it, vi} from "vitest"; +import {assertNetworkIdentity} from "../src/client/networkIdentity"; +import {createClient} from "../src/client/client"; +import {testnetBradbury} from "../src/chains/testnetBradbury"; + +const GENESIS = "0x17d89764d4f4f963158fc4c5e8f2cb670c2837740b35f37081c12860c3df97e4"; +const request = () => vi.fn(async ({method}: {method: string}) => { + if (method === "eth_chainId") return "0x107d"; + if (method === "eth_getBlockByNumber") return {hash: GENESIS}; + if (method === "eth_getCode") return "0x6001"; + throw new Error(`Unexpected method ${method}`); +}); +afterEach(() => vi.restoreAllMocks()); + +describe("Bradbury Phase 2 network identity", () => { + it("accepts the deployed genesis and requires contract code", async () => { + const rpc = request(); + await expect(assertNetworkIdentity(rpc, testnetBradbury)).resolves.toBeUndefined(); + expect(rpc).toHaveBeenCalledWith({method: "eth_getCode", params: ["0xD8fBa96C0dBB0257028dBc0107060b958e5c7113", "latest"]}); + }); + it("rejects the legacy network even though its chain ID matches", async () => { + const rpc = request(); + rpc.mockImplementationOnce(async () => "0x107d"); + rpc.mockImplementationOnce(async () => ({hash: "0xef97917ce9bd9fa7d12ad6a8d81ea26c80ac1d727acc37cbb9799ae199788dc5"})); + await expect(assertNetworkIdentity(rpc, testnetBradbury)).rejects.toThrow("identity"); + }); + it("rejects an endpoint without the deployed staking contract", async () => { + const valid = request(); + await expect(assertNetworkIdentity(async args => args.method === "eth_getCode" ? "0x" : valid(args), testnetBradbury)).rejects.toThrow("code is missing"); + }); + it("does not add calls to chains without a genesis pin", async () => { + const rpc = request(); + await assertNetworkIdentity(rpc, {...testnetBradbury, genesisHash: undefined}); + expect(rpc).not.toHaveBeenCalled(); + }); + it("does not mutate exported defaults when a client overrides its endpoint", () => { + const first = createClient({chain: testnetBradbury, endpoint: "https://first.example"}); + const second = createClient({chain: testnetBradbury, endpoint: "https://second.example"}); + expect(first.chain.rpcUrls.default.http).toEqual(["https://first.example"]); + expect(second.chain.rpcUrls.default.http).toEqual(["https://second.example"]); + expect(testnetBradbury.rpcUrls.default.http).toEqual(["https://rpc.testnet-chain.genlayer.com"]); + }); + it("blocks a locally signed broadcast before contacting a wrong network", async () => { + const methods: string[] = []; + vi.spyOn(globalThis, "fetch").mockImplementation(async (_url, init) => { + const {method} = JSON.parse(init!.body as string); methods.push(method); + return new Response(JSON.stringify({jsonrpc: "2.0", id: 1, result: method === "eth_chainId" ? "0x107d" : {hash: "0xdead"}})); + }); + const client = createClient({chain: testnetBradbury}); + await expect(client.request({method: "eth_sendRawTransaction", params: ["0x01"]})).rejects.toThrow("identity"); + expect(methods).not.toContain("eth_sendRawTransaction"); + }); +}); From fa765e1fda1d3d48181b88dfd3f6e4f29179ae03 Mon Sep 17 00:00:00 2001 From: jmlago Date: Mon, 19 Oct 2026 19:26:02 +0100 Subject: [PATCH 2/5] fix: retry throttled RPC reads without repeating broadcasts --- src/client/client.ts | 53 ++++++++++++++++++------- src/client/networkIdentity.ts | 4 +- tests/bradbury-network.test.ts | 71 ++++++++++++++++++++++++++++------ 3 files changed, 102 insertions(+), 26 deletions(-) diff --git a/src/client/client.ts b/src/client/client.ts index 6f5f20d..4e2f61a 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -62,7 +62,7 @@ const assertChainMatch = async ( const currentId = parseInt(currentChainId as string, 16); throw new Error( `Wallet is on chain ${currentId} but client is configured for chain ${chainConfig.id} (${chainConfig.name}). ` + - `Call client.connect("${chainConfig.name}") or switch your wallet to the correct network before sending transactions.`, + `Call client.connect("${chainConfig.name}") or switch your wallet to the correct network before sending transactions.`, ); } } catch (err) { @@ -74,22 +74,43 @@ const getCustomTransportConfig = (config: ClientConfig, chainConfig: GenLayerCha const isAddress = typeof config.account !== "object"; const rpc = async ({method, params = []}: {method: string; params?: any[]}) => { - const response = await fetch(chainConfig.rpcUrls.default.http[0], { - method: "POST", headers: {"Content-Type": "application/json"}, - body: JSON.stringify({jsonrpc: "2.0", id: Date.now(), method, params}), - }); - if (!response.ok) throw new Error(`RPC HTTP ${response.status}`); - const data = await response.json(); - if (data.error) throw data.error; - return data.result; + const retryable = + /^(eth_get\w+|eth_call|eth_chainId|eth_blockNumber|eth_gasPrice|eth_estimateGas|net_version)$/.test( + method, + ); + for (let attempt = 0; ; attempt++) { + const response = await fetch(chainConfig.rpcUrls.default.http[0], { + method: "POST", + headers: {"Content-Type": "application/json"}, + body: JSON.stringify({jsonrpc: "2.0", id: Date.now(), method, params}), + }); + if (response.status === 429 && retryable && attempt < 3) { + const retryAfter = Number(response.headers.get("retry-after")); + const delay = retryAfter > 0 ? Math.min(retryAfter * 1000, 10000) : 1000 * 2 ** attempt; + await new Promise(resolve => setTimeout(resolve, delay)); + continue; + } + if (!response.ok) throw new Error(`RPC HTTP ${response.status}`); + const data = await response.json(); + if (data.error) throw data.error; + return data.result; + } }; let identityCheck: Promise | undefined; return { async request({method, params = []}: {method: string; params: any[]}) { if (chainConfig.genesisHash) { // Recheck before every broadcast, including locally signed transactions. - if (!identityCheck || method === "eth_sendRawTransaction" || method === "eth_sendTransaction" || method === "eth_signTransaction") { - identityCheck = assertNetworkIdentity(rpc, chainConfig).catch(error => {identityCheck = undefined; throw error;}); + if ( + !identityCheck || + method === "eth_sendRawTransaction" || + method === "eth_sendTransaction" || + method === "eth_signTransaction" + ) { + identityCheck = assertNetworkIdentity(rpc, chainConfig).catch(error => { + identityCheck = undefined; + throw error; + }); } await identityCheck; } @@ -135,7 +156,10 @@ export const createClient = (config: ClientConfig = {chain: localnet}): GenLayer ? {...source, rpcUrls: {...source.rpcUrls, default: {...source.rpcUrls.default, http: [config.endpoint]}}} : source; - const customTransport = custom(getCustomTransportConfig(config, chainConfig as GenLayerChain), {retryCount: 0, retryDelay: 0}); + const customTransport = custom(getCustomTransportConfig(config, chainConfig as GenLayerChain), { + retryCount: 0, + retryDelay: 0, + }); const publicClient = createPublicClient(chainConfig as GenLayerChain, customTransport).extend( publicActions, ); @@ -160,7 +184,10 @@ export const createClient = (config: ClientConfig = {chain: localnet}): GenLayer const clientWithAllActions = { ...clientWithTransactionActions, - ...contractActions(clientWithTransactionActions as unknown as GenLayerClient, publicClient), + ...contractActions( + clientWithTransactionActions as unknown as GenLayerClient, + publicClient, + ), } as unknown as GenLayerClient; const clientWithReceiptActions = { diff --git a/src/client/networkIdentity.ts b/src/client/networkIdentity.ts index ab74466..88ea4c3 100644 --- a/src/client/networkIdentity.ts +++ b/src/client/networkIdentity.ts @@ -8,7 +8,9 @@ export async function assertNetworkIdentity(request: Request, chain: GenLayerCha const id = await request({method: "eth_chainId"}); const block = await request({method: "eth_getBlockByNumber", params: ["0x0", false]}); if (BigInt(id) !== BigInt(chain.id) || block?.hash?.toLowerCase() !== chain.genesisHash.toLowerCase()) { - throw new Error("RPC network identity does not match Bradbury Phase 2; chain ID 4221 alone is insufficient."); + throw new Error( + "RPC network identity does not match Bradbury Phase 2; chain ID 4221 alone is insufficient.", + ); } for (const contract of [chain.consensusMainContract, chain.stakingContract]) { if (!contract) continue; diff --git a/tests/bradbury-network.test.ts b/tests/bradbury-network.test.ts index 0728bc6..bca54c5 100644 --- a/tests/bradbury-network.test.ts +++ b/tests/bradbury-network.test.ts @@ -4,29 +4,40 @@ import {createClient} from "../src/client/client"; import {testnetBradbury} from "../src/chains/testnetBradbury"; const GENESIS = "0x17d89764d4f4f963158fc4c5e8f2cb670c2837740b35f37081c12860c3df97e4"; -const request = () => vi.fn(async ({method}: {method: string}) => { - if (method === "eth_chainId") return "0x107d"; - if (method === "eth_getBlockByNumber") return {hash: GENESIS}; - if (method === "eth_getCode") return "0x6001"; - throw new Error(`Unexpected method ${method}`); -}); +const request = () => + vi.fn(async ({method}: {method: string}) => { + if (method === "eth_chainId") return "0x107d"; + if (method === "eth_getBlockByNumber") return {hash: GENESIS}; + if (method === "eth_getCode") return "0x6001"; + throw new Error(`Unexpected method ${method}`); + }); afterEach(() => vi.restoreAllMocks()); describe("Bradbury Phase 2 network identity", () => { it("accepts the deployed genesis and requires contract code", async () => { const rpc = request(); await expect(assertNetworkIdentity(rpc, testnetBradbury)).resolves.toBeUndefined(); - expect(rpc).toHaveBeenCalledWith({method: "eth_getCode", params: ["0xD8fBa96C0dBB0257028dBc0107060b958e5c7113", "latest"]}); + expect(rpc).toHaveBeenCalledWith({ + method: "eth_getCode", + params: ["0xD8fBa96C0dBB0257028dBc0107060b958e5c7113", "latest"], + }); }); it("rejects the legacy network even though its chain ID matches", async () => { const rpc = request(); rpc.mockImplementationOnce(async () => "0x107d"); - rpc.mockImplementationOnce(async () => ({hash: "0xef97917ce9bd9fa7d12ad6a8d81ea26c80ac1d727acc37cbb9799ae199788dc5"})); + rpc.mockImplementationOnce(async () => ({ + hash: "0xef97917ce9bd9fa7d12ad6a8d81ea26c80ac1d727acc37cbb9799ae199788dc5", + })); await expect(assertNetworkIdentity(rpc, testnetBradbury)).rejects.toThrow("identity"); }); it("rejects an endpoint without the deployed staking contract", async () => { const valid = request(); - await expect(assertNetworkIdentity(async args => args.method === "eth_getCode" ? "0x" : valid(args), testnetBradbury)).rejects.toThrow("code is missing"); + await expect( + assertNetworkIdentity( + async args => (args.method === "eth_getCode" ? "0x" : valid(args)), + testnetBradbury, + ), + ).rejects.toThrow("code is missing"); }); it("does not add calls to chains without a genesis pin", async () => { const rpc = request(); @@ -43,11 +54,47 @@ describe("Bradbury Phase 2 network identity", () => { it("blocks a locally signed broadcast before contacting a wrong network", async () => { const methods: string[] = []; vi.spyOn(globalThis, "fetch").mockImplementation(async (_url, init) => { - const {method} = JSON.parse(init!.body as string); methods.push(method); - return new Response(JSON.stringify({jsonrpc: "2.0", id: 1, result: method === "eth_chainId" ? "0x107d" : {hash: "0xdead"}})); + const {method} = JSON.parse(init!.body as string); + methods.push(method); + return new Response( + JSON.stringify({ + jsonrpc: "2.0", + id: 1, + result: method === "eth_chainId" ? "0x107d" : {hash: "0xdead"}, + }), + ); }); const client = createClient({chain: testnetBradbury}); - await expect(client.request({method: "eth_sendRawTransaction", params: ["0x01"]})).rejects.toThrow("identity"); + await expect(client.request({method: "eth_sendRawTransaction", params: ["0x01"]})).rejects.toThrow( + "identity", + ); expect(methods).not.toContain("eth_sendRawTransaction"); }); }); + +describe("RPC rate limiting", () => { + it("retries a rate-limited read", async () => { + vi.useFakeTimers(); + const fetch = vi + .spyOn(globalThis, "fetch") + .mockResolvedValueOnce(new Response("", {status: 429})) + .mockResolvedValueOnce(new Response(JSON.stringify({result: "0x107d"}))); + try { + const chain = {...testnetBradbury, genesisHash: undefined}; + const client = createClient({chain}); + const result = client.request({method: "eth_chainId"}); + await vi.runAllTimersAsync(); + await expect(result).resolves.toBe("0x107d"); + expect(fetch).toHaveBeenCalledTimes(2); + } finally { + vi.useRealTimers(); + } + }); + it("never retries a rate-limited broadcast", async () => { + const fetch = vi.spyOn(globalThis, "fetch").mockResolvedValue(new Response("", {status: 429})); + const chain = {...testnetBradbury, genesisHash: undefined}; + const client = createClient({chain}); + await expect(client.request({method: "eth_sendRawTransaction", params: ["0x01"]})).rejects.toThrow("429"); + expect(fetch).toHaveBeenCalledTimes(1); + }); +}); From 7e29c039aba5febcd0965d98c991c793bf975ff8 Mon Sep 17 00:00:00 2001 From: jmlago Date: Mon, 19 Oct 2026 19:41:14 +0100 Subject: [PATCH 3/5] fix: resolve deployment contracts through AddressManager --- README.md | 10 ++++++ scripts/check-bradbury-network.checks.mjs | 29 ++++++++++++++++ scripts/check-bradbury-network.mjs | 29 +++++++++++----- src/chains/testnetBradbury.ts | 1 + src/client/networkIdentity.ts | 40 ++++++++++++++++++--- src/types/chains.ts | 2 ++ tests/bradbury-network.test.ts | 42 +++++++++++++++++++++-- 7 files changed, 138 insertions(+), 15 deletions(-) create mode 100644 scripts/check-bradbury-network.checks.mjs diff --git a/README.md b/README.md index c2497a9..63b0bce 100644 --- a/README.md +++ b/README.md @@ -524,3 +524,13 @@ Run `npm run check:bradbury` to check the default endpoint, or set A successful check establishes network identity, not validator activation or WebSocket readiness. `npm run check:chains` compares the Phase 2 contract configuration against the pinned deployment and verified implementation ABIs. + +AddressManager is the stable deployment anchor. The network preflight resolves +Staking and ConsensusMain from that registry and checks code at their current +addresses; their initial deployment addresses are not network identity pins. +The SDK chain definition remains a qualified address/ABI snapshot. Before use +and broadcasts it compares that snapshot with the registry. If a contract moves, +it reports a stale SDK configuration (not a wrong network) and requires an updated +SDK/chain configuration with compatible ABIs. It does not silently redirect a +transaction encoded with an old ABI. The preflight also accepts the node's +`GENLAYERNODE_ROLLUP_GENLAYERCHAINRPCKEY` environment variable. diff --git a/scripts/check-bradbury-network.checks.mjs b/scripts/check-bradbury-network.checks.mjs new file mode 100644 index 0000000..f560b35 --- /dev/null +++ b/scripts/check-bradbury-network.checks.mjs @@ -0,0 +1,29 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import {checkNetwork, ADDRESS_MANAGER, GENESIS} from './check-bradbury-network.mjs'; +const staking = '0x1111111111111111111111111111111111111111'; +const consensus = '0x2222222222222222222222222222222222222222'; +function rpc({missing = false, empty = false, oldGenesis = false} = {}) { + const checked = []; + return {checked, request: async (method, params) => { + if (method === 'eth_chainId') return '0x107d'; + if (method === 'eth_getBlockByNumber') return {hash: oldGenesis ? '0xdead' : GENESIS}; + if (method === 'eth_call') { + assert.equal(params[0].to, ADDRESS_MANAGER); + assert.equal(params[0].data.slice(0,10), '0xbf40fac1'); + const name = Buffer.from(params[0].data.slice(138), 'hex').toString().replace(/\0/g, ''); + assert.ok(['Staking','ConsensusMain'].includes(name)); + return '0x' + (empty ? '0'.repeat(64) : (name === 'Staking' ? staking : consensus).slice(2).padStart(64,'0')); + } + if (method === 'eth_getCode') {checked.push(params[0]); return missing && params[0] === staking ? '0x' : '0x6001';} + throw Error('Unexpected RPC method'); + }}; +} +test('accepts current registry addresses even when they differ from the initial deployment', async () => { + const mock=rpc(); + assert.deepEqual(await checkNetwork(mock.request),{AddressManager: ADDRESS_MANAGER,Staking:staking,ConsensusMain:consensus}); + assert.deepEqual(mock.checked,[ADDRESS_MANAGER,staking,consensus]); +}); +test('rejects an empty registry entry', async()=>{await assert.rejects(checkNetwork(rpc({empty:true}).request),/entry/);}); +test('requires code at the resolved address', async()=>{await assert.rejects(checkNetwork(rpc({missing:true}).request),/code/);}); +test('rejects the former chain before reading the registry', async()=>{await assert.rejects(checkNetwork(rpc({oldGenesis:true}).request),/genesis/);}); diff --git a/scripts/check-bradbury-network.mjs b/scripts/check-bradbury-network.mjs index 7400bbd..721da46 100644 --- a/scripts/check-bradbury-network.mjs +++ b/scripts/check-bradbury-network.mjs @@ -1,20 +1,33 @@ import { pathToFileURL } from 'node:url'; export const GENESIS = '0x17d89764d4f4f963158fc4c5e8f2cb670c2837740b35f37081c12860c3df97e4'; -export const CONTRACTS = { - AddressManager: '0x3F71AE080BD6270A91dBcc7960d88797828538E0', - Staking: '0xD8fBa96C0dBB0257028dBc0107060b958e5c7113', - ConsensusMain: '0x2E2766cbc3E5e61Ce93bBcdCBb3eAcB82082A019', -}; +export const ADDRESS_MANAGER = '0x3F71AE080BD6270A91dBcc7960d88797828538E0'; + +function lookupData(name) { + const word = value => value.toString(16).padStart(64, '0'); + const bytes = Buffer.from(name, 'utf8'); + // getAddress(string), ABI-encoded without a package dependency. + return '0xbf40fac1' + word(32) + word(bytes.length) + bytes.toString('hex').padEnd(Math.ceil(bytes.length / 32) * 64, '0'); +} export async function checkNetwork(request) { if (BigInt(await request('eth_chainId', [])) !== 4221n) throw new Error('Wrong chain ID'); const genesis = await request('eth_getBlockByNumber', ['0x0', false]); if (genesis?.hash?.toLowerCase() !== GENESIS) throw new Error('Wrong genesis: this is not Bradbury Phase 2 (chain ID 4221 is reused)'); - for (const [name, address] of Object.entries(CONTRACTS)) { + async function requireCode(name, address) { const code = await request('eth_getCode', [address, 'latest']); - if (typeof code !== 'string' || !/^0x[0-9a-f]+$/i.test(code) || code.length <= 2) throw new Error(`${name} has no deployed code`); + if (typeof code !== 'string' || !/^0x[0-9a-f]+$/i.test(code) || code.length <= 2) throw new Error(name + ' has no deployed code'); + } + await requireCode('AddressManager', ADDRESS_MANAGER); + const resolved = {AddressManager: ADDRESS_MANAGER}; + for (const name of ['Staking', 'ConsensusMain']) { + const result = await request('eth_call', [{to: ADDRESS_MANAGER, data: lookupData(name)}, 'latest']); + if (typeof result !== 'string' || !/^0x0{24}[0-9a-f]{40}$/i.test(result) || BigInt(result) === 0n) throw new Error(name + ' has no valid AddressManager entry'); + const address = '0x' + result.slice(-40); + await requireCode(name, address); + resolved[name] = address; } + return resolved; } export function rpcRequest(url, key) { @@ -35,7 +48,7 @@ export function rpcRequest(url, key) { if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { try { - await checkNetwork(rpcRequest(process.env.BRADBURY_RPC_URL || 'https://rpc.testnet-chain.genlayer.com', process.env.BRADBURY_RPC_KEY)); + await checkNetwork(rpcRequest(process.env.BRADBURY_RPC_URL || 'https://rpc.testnet-chain.genlayer.com', process.env.BRADBURY_RPC_KEY || process.env.GENLAYERNODE_ROLLUP_GENLAYERCHAINRPCKEY)); console.log('Bradbury Phase 2: chain ID, genesis and required contract code verified.'); } catch (error) { console.error(error.message); diff --git a/src/chains/testnetBradbury.ts b/src/chains/testnetBradbury.ts index 7929039..13b7f36 100644 --- a/src/chains/testnetBradbury.ts +++ b/src/chains/testnetBradbury.ts @@ -5479,6 +5479,7 @@ export const testnetBradbury: GenLayerChain = defineChain({ id: 0x107d, isStudio: false, genesisHash: "0x17d89764d4f4f963158fc4c5e8f2cb670c2837740b35f37081c12860c3df97e4", + addressManager: "0x3F71AE080BD6270A91dBcc7960d88797828538E0", name: "Genlayer Bradbury Testnet", rpcUrls: { default: { diff --git a/src/client/networkIdentity.ts b/src/client/networkIdentity.ts index 88ea4c3..145ac18 100644 --- a/src/client/networkIdentity.ts +++ b/src/client/networkIdentity.ts @@ -1,8 +1,10 @@ import {GenLayerChain} from "@/types"; +import {decodeFunctionResult, encodeFunctionData, parseAbi} from "viem"; type Request = (args: {method: string; params?: any[]}) => Promise; +export const ADDRESS_MANAGER_ABI = parseAbi(["function getAddress(string key) view returns (address)"]); -/** Chain IDs are reused across Bradbury deployments; validate genesis and contract code. */ +/** Validate deployment identity separately from the SDK's qualified contract/ABI snapshot. */ export async function assertNetworkIdentity(request: Request, chain: GenLayerChain): Promise { if (!chain.genesisHash) return; const id = await request({method: "eth_chainId"}); @@ -12,11 +14,41 @@ export async function assertNetworkIdentity(request: Request, chain: GenLayerCha "RPC network identity does not match Bradbury Phase 2; chain ID 4221 alone is insufficient.", ); } - for (const contract of [chain.consensusMainContract, chain.stakingContract]) { - if (!contract) continue; - const code = await request({method: "eth_getCode", params: [contract.address, "latest"]}); + const requireCode = async (address: string) => { + const code = await request({method: "eth_getCode", params: [address, "latest"]}); if (typeof code !== "string" || !/^0x[0-9a-f]+$/i.test(code) || code.length <= 2) { throw new Error("Bradbury Phase 2 contract code is missing from the configured RPC."); } + }; + if (!chain.addressManager) return; + await requireCode(chain.addressManager); + const contracts = { + ConsensusMain: chain.consensusMainContract, + ConsensusData: chain.consensusDataContract, + Staking: chain.stakingContract, + FeeManager: chain.feeManagerContract, + RoundsStorage: chain.roundsStorageContract, + Appeals: chain.appealsContract, + }; + for (const [name, contract] of Object.entries(contracts)) { + if (!contract) continue; + const data = await request({ + method: "eth_call", + params: [ + { + to: chain.addressManager, + data: encodeFunctionData({abi: ADDRESS_MANAGER_ABI, functionName: "getAddress", args: [name]}), + }, + "latest", + ], + }); + const address = decodeFunctionResult({abi: ADDRESS_MANAGER_ABI, functionName: "getAddress", data}); + if (/^0x0{40}$/i.test(address)) throw new Error(`AddressManager has no ${name} entry.`); + await requireCode(address); + if (address.toLowerCase() !== contract.address.toLowerCase()) { + throw new Error( + `AddressManager ${name} differs from this SDK contract configuration. The network identity matches; use an SDK/chain configuration with the current addresses and compatible ABIs before sending transactions.`, + ); + } } } diff --git a/src/types/chains.ts b/src/types/chains.ts index f1a7ce4..c10cf73 100644 --- a/src/types/chains.ts +++ b/src/types/chains.ts @@ -5,6 +5,8 @@ export type GenLayerChain = Chain & { isStudio: boolean; /** Genesis identity for networks that reuse a chain ID. */ genesisHash?: `0x${string}`; + /** Stable deployment registry; contract addresses below are a qualified ABI/configuration snapshot. */ + addressManager?: Address; consensusMainContract: { address: Address; abi: readonly unknown[]; diff --git a/tests/bradbury-network.test.ts b/tests/bradbury-network.test.ts index bca54c5..eb18c4f 100644 --- a/tests/bradbury-network.test.ts +++ b/tests/bradbury-network.test.ts @@ -1,19 +1,55 @@ +import {decodeFunctionData, encodeFunctionResult} from "viem"; import {afterEach, describe, expect, it, vi} from "vitest"; -import {assertNetworkIdentity} from "../src/client/networkIdentity"; +import {ADDRESS_MANAGER_ABI, assertNetworkIdentity} from "../src/client/networkIdentity"; import {createClient} from "../src/client/client"; import {testnetBradbury} from "../src/chains/testnetBradbury"; const GENESIS = "0x17d89764d4f4f963158fc4c5e8f2cb670c2837740b35f37081c12860c3df97e4"; const request = () => - vi.fn(async ({method}: {method: string}) => { + vi.fn(async ({method, params}: {method: string; params?: any[]}) => { if (method === "eth_chainId") return "0x107d"; if (method === "eth_getBlockByNumber") return {hash: GENESIS}; if (method === "eth_getCode") return "0x6001"; + if (method === "eth_call") { + const {args} = decodeFunctionData({abi: ADDRESS_MANAGER_ABI, data: params![0].data}); + const contracts = { + ConsensusMain: testnetBradbury.consensusMainContract, + ConsensusData: testnetBradbury.consensusDataContract, + Staking: testnetBradbury.stakingContract, + FeeManager: testnetBradbury.feeManagerContract, + RoundsStorage: testnetBradbury.roundsStorageContract, + Appeals: testnetBradbury.appealsContract, + }; + return encodeFunctionResult({ + abi: ADDRESS_MANAGER_ABI, + functionName: "getAddress", + result: contracts[args[0] as keyof typeof contracts]!.address, + }); + } throw new Error(`Unexpected method ${method}`); }); afterEach(() => vi.restoreAllMocks()); describe("Bradbury Phase 2 network identity", () => { + it("distinguishes a changed registry from the wrong network and rejects stale SDK targets", async () => { + const valid = request(); + const moved = "0x1111111111111111111111111111111111111111"; + const rpc = async (args: {method: string; params?: any[]}) => + args.method === "eth_call" + ? encodeFunctionResult({abi: ADDRESS_MANAGER_ABI, functionName: "getAddress", result: moved}) + : valid(args); + await expect(assertNetworkIdentity(rpc, testnetBradbury)).rejects.toThrow("network identity matches"); + const updated = { + ...testnetBradbury, + consensusMainContract: {...testnetBradbury.consensusMainContract!, address: moved as `0x${string}`}, + consensusDataContract: null, + stakingContract: null, + feeManagerContract: null, + roundsStorageContract: null, + appealsContract: null, + }; + await expect(assertNetworkIdentity(rpc, updated)).resolves.toBeUndefined(); + }); it("accepts the deployed genesis and requires contract code", async () => { const rpc = request(); await expect(assertNetworkIdentity(rpc, testnetBradbury)).resolves.toBeUndefined(); @@ -81,7 +117,7 @@ describe("RPC rate limiting", () => { .mockResolvedValueOnce(new Response(JSON.stringify({result: "0x107d"}))); try { const chain = {...testnetBradbury, genesisHash: undefined}; - const client = createClient({chain}); + const client = createClient({chain}); const result = client.request({method: "eth_chainId"}); await vi.runAllTimersAsync(); await expect(result).resolves.toBe("0x107d"); From d9ce1bc9248dc3a7b5b38ac3336c933a88d9db67 Mon Sep 17 00:00:00 2001 From: Darien Hernandez Date: Mon, 19 Oct 2026 23:35:15 +0200 Subject: [PATCH 4/5] fix: reduce Bradbury Phase 2 change to the chain preset Keep what Phase 2 needs and follow the existing chain-preset pattern: - testnetBradbury: Phase 2 addresses, refreshed ConsensusMain/ConsensusData ABIs and the new RPC/explorer URLs. ABIs keep the file's existing key order and narrow-ABI style; Appeals.canAppeal gains its decision-id argument. - createClient: an endpoint override copies the chain instead of mutating the shared preset. - check:chains: Bradbury reads a pinned copy of genlayer-consensus deployments/bradbury-phase-2.json and the explorer-verified ABIs through a CHAINS entry, instead of name checks in the loop. Removed: - genesisHash/addressManager chain fields and the identity check in the transport. It added ~15 RPC calls on first use and before every broadcast, and failed every CLI custom network based on testnet-bradbury. The SDK already resolves AddressManager on chain from ConsensusMain. - the 429 retry loop in the transport. Unrelated to Phase 2 and it partly reverses #110; it belongs in its own PR if wanted. - check:bradbury script, its node:test checks (not run anywhere) and the README section that described the removed behavior. Co-Authored-By: Claude Opus 5.5 --- README.md | 30 - package.json | 3 +- scripts/bradbury-phase-2-contracts.json | 62 - scripts/check-bradbury-network.checks.mjs | 29 - scripts/check-bradbury-network.mjs | 57 - scripts/check-chains-drift.mjs | 39 +- scripts/deployments/bradbury-phase-2.json | 224 + src/chains/testnetBradbury.ts | 4624 ++++++++++----------- src/client/client.ts | 81 +- src/client/networkIdentity.ts | 54 - src/types/chains.ts | 4 - tests/bradbury-network.test.ts | 136 - tests/chains-config.test.ts | 19 +- tests/client.test.ts | 9 + 14 files changed, 2541 insertions(+), 2830 deletions(-) delete mode 100644 scripts/bradbury-phase-2-contracts.json delete mode 100644 scripts/check-bradbury-network.checks.mjs delete mode 100644 scripts/check-bradbury-network.mjs create mode 100644 scripts/deployments/bradbury-phase-2.json delete mode 100644 src/client/networkIdentity.ts delete mode 100644 tests/bradbury-network.test.ts diff --git a/README.md b/README.md index 63b0bce..7bfb82e 100644 --- a/README.md +++ b/README.md @@ -504,33 +504,3 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file ### v0.6 consumer migration See [the v2 migration guide](docs/consumer-migration-v06.md) for the staking rewards rename, producer ABI changes, execution generation, and package selection. - -### Bradbury Phase 2 - -`testnetBradbury` targets the Phase 2 deployment (chain ID 4221). That chain ID -was also used by Phase 1, so the SDK verifies the genesis hash and required -contract code on first use and again before broadcasting a transaction. A wallet -provider is checked separately before signing. A mismatched endpoint fails closed. - -The public chain endpoint is `https://rpc.testnet-chain.genlayer.com`, with the -chain explorer at `https://scan.testnet-chain.genlayer.com`. During the DNS -cutover, explicitly use the assigned Conduit endpoint with `createClient({chain: -testnetBradbury, endpoint: rpcUrl})`. Overrides do not change exported defaults. -The chain RPC serves Ethereum/staking calls; GenLayer `gen_*` methods require a -compatible GenLayer node endpoint. - -Run `npm run check:bradbury` to check the default endpoint, or set -`BRADBURY_RPC_URL` and, when required, `BRADBURY_RPC_KEY` (sent as `X-AccessKey`). -A successful check establishes network identity, not validator activation or -WebSocket readiness. `npm run check:chains` compares the Phase 2 contract -configuration against the pinned deployment and verified implementation ABIs. - -AddressManager is the stable deployment anchor. The network preflight resolves -Staking and ConsensusMain from that registry and checks code at their current -addresses; their initial deployment addresses are not network identity pins. -The SDK chain definition remains a qualified address/ABI snapshot. Before use -and broadcasts it compares that snapshot with the registry. If a contract moves, -it reports a stale SDK configuration (not a wrong network) and requires an updated -SDK/chain configuration with compatible ABIs. It does not silently redirect a -transaction encoded with an old ABI. The preflight also accepts the node's -`GENLAYERNODE_ROLLUP_GENLAYERCHAINRPCKEY` environment variable. diff --git a/package.json b/package.json index b58d320..2c938ba 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,7 @@ "lint": "eslint . --fix --ext .ts", "check:chains": "node scripts/check-chains-drift.mjs", "release": "./scripts/release.sh", - "docs": "node scripts/generate-api-docs.mjs", - "check:bradbury": "node scripts/check-bradbury-network.mjs" + "docs": "node scripts/generate-api-docs.mjs" }, "exports": { ".": { diff --git a/scripts/bradbury-phase-2-contracts.json b/scripts/bradbury-phase-2-contracts.json deleted file mode 100644 index 696351c..0000000 --- a/scripts/bradbury-phase-2-contracts.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "ConsensusMain": { - "address": "0x2E2766cbc3E5e61Ce93bBcdCBb3eAcB82082A019", - "implementation": "0xe9F572e836ea3640c022D09Aa41108fba3574731" - }, - "ConsensusData": { - "address": "0xc5FA6f82BEe53598825d6edf7E3e24613082c75B", - "implementation": "0x7A92A2036102c27eE9989f1D2f2E16152338c4b0" - }, - "Staking": { - "address": "0xD8fBa96C0dBB0257028dBc0107060b958e5c7113", - "implementation": "0x5ed40150710C64318607CC684211ff6c7b3592Fa" - }, - "StakingData": { - "address": "0x8951E93ae3E95F44Bc700fd8D145d30f5eeD408E", - "implementation": "0xb17160b160885616cac24CA46cDE0FCBf66DE2e8" - }, - "FeeManager": { - "address": "0x7678587A847712f2A96082AC07883A88D0fc7245", - "implementation": "0x8797Ef886ebBd2492A137f5279E537ba29B1E542" - }, - "RoundsStorage": { - "address": "0x4038d4F72C7aAbA5a442cC0dA946012B9E3f4B8a", - "implementation": "0x9d1516378757dabd8E3DFd41894e1BCB2Df8b9D1" - }, - "Appeals": { - "address": "0xdc953c3bCf8837987853ca05a78D52fFC3E18651", - "implementation": "0xfA88c97083f51CCB498248a43f8E5e573CA5475f" - }, - "ValidatorWalletBlueprint": { - "address": "0xAE308333af9e4aB7418E0CA6f1Fd5fAb8915BAf2", - "implementation": "0xAE308333af9e4aB7418E0CA6f1Fd5fAb8915BAf2" - }, - "StakingConfig": { - "address": "0xe56D9dEdD88b600D36663c3E3a57099616Da1494", - "implementation": "0xe56D9dEdD88b600D36663c3E3a57099616Da1494" - }, - "StakingDelegators": { - "address": "0x05F3157E873dD68De43ED82920D6a799873Cf7F5", - "implementation": "0x05F3157E873dD68De43ED82920D6a799873Cf7F5" - }, - "StakingBan": { - "address": "0x9c251FB71832C470D7a30B08107fF8ad85825CFB", - "implementation": "0x9c251FB71832C470D7a30B08107fF8ad85825CFB" - }, - "StakingValidators": { - "address": "0x6750F65b74B73FA529a7A4fe283b705d509B3306", - "implementation": "0x6750F65b74B73FA529a7A4fe283b705d509B3306" - }, - "StakingEpoch": { - "address": "0xdeF1262F9A0CFFD7Fc26F0C8F7Ef1af724136E19", - "implementation": "0xdeF1262F9A0CFFD7Fc26F0C8F7Ef1af724136E19" - }, - "StakingReadFacet": { - "address": "0x47a404edE8F68F0b9253aB009e5Aa0362517B1e1", - "implementation": "0x47a404edE8F68F0b9253aB009e5Aa0362517B1e1" - }, - "StakingReadModel": { - "address": "0xf1fBdE733A9ceE2C0A44b8f724d944F89aE6D8A4", - "implementation": "0xf1fBdE733A9ceE2C0A44b8f724d944F89aE6D8A4" - } -} diff --git a/scripts/check-bradbury-network.checks.mjs b/scripts/check-bradbury-network.checks.mjs deleted file mode 100644 index f560b35..0000000 --- a/scripts/check-bradbury-network.checks.mjs +++ /dev/null @@ -1,29 +0,0 @@ -import test from 'node:test'; -import assert from 'node:assert/strict'; -import {checkNetwork, ADDRESS_MANAGER, GENESIS} from './check-bradbury-network.mjs'; -const staking = '0x1111111111111111111111111111111111111111'; -const consensus = '0x2222222222222222222222222222222222222222'; -function rpc({missing = false, empty = false, oldGenesis = false} = {}) { - const checked = []; - return {checked, request: async (method, params) => { - if (method === 'eth_chainId') return '0x107d'; - if (method === 'eth_getBlockByNumber') return {hash: oldGenesis ? '0xdead' : GENESIS}; - if (method === 'eth_call') { - assert.equal(params[0].to, ADDRESS_MANAGER); - assert.equal(params[0].data.slice(0,10), '0xbf40fac1'); - const name = Buffer.from(params[0].data.slice(138), 'hex').toString().replace(/\0/g, ''); - assert.ok(['Staking','ConsensusMain'].includes(name)); - return '0x' + (empty ? '0'.repeat(64) : (name === 'Staking' ? staking : consensus).slice(2).padStart(64,'0')); - } - if (method === 'eth_getCode') {checked.push(params[0]); return missing && params[0] === staking ? '0x' : '0x6001';} - throw Error('Unexpected RPC method'); - }}; -} -test('accepts current registry addresses even when they differ from the initial deployment', async () => { - const mock=rpc(); - assert.deepEqual(await checkNetwork(mock.request),{AddressManager: ADDRESS_MANAGER,Staking:staking,ConsensusMain:consensus}); - assert.deepEqual(mock.checked,[ADDRESS_MANAGER,staking,consensus]); -}); -test('rejects an empty registry entry', async()=>{await assert.rejects(checkNetwork(rpc({empty:true}).request),/entry/);}); -test('requires code at the resolved address', async()=>{await assert.rejects(checkNetwork(rpc({missing:true}).request),/code/);}); -test('rejects the former chain before reading the registry', async()=>{await assert.rejects(checkNetwork(rpc({oldGenesis:true}).request),/genesis/);}); diff --git a/scripts/check-bradbury-network.mjs b/scripts/check-bradbury-network.mjs deleted file mode 100644 index 721da46..0000000 --- a/scripts/check-bradbury-network.mjs +++ /dev/null @@ -1,57 +0,0 @@ -import { pathToFileURL } from 'node:url'; - -export const GENESIS = '0x17d89764d4f4f963158fc4c5e8f2cb670c2837740b35f37081c12860c3df97e4'; -export const ADDRESS_MANAGER = '0x3F71AE080BD6270A91dBcc7960d88797828538E0'; - -function lookupData(name) { - const word = value => value.toString(16).padStart(64, '0'); - const bytes = Buffer.from(name, 'utf8'); - // getAddress(string), ABI-encoded without a package dependency. - return '0xbf40fac1' + word(32) + word(bytes.length) + bytes.toString('hex').padEnd(Math.ceil(bytes.length / 32) * 64, '0'); -} - -export async function checkNetwork(request) { - if (BigInt(await request('eth_chainId', [])) !== 4221n) throw new Error('Wrong chain ID'); - const genesis = await request('eth_getBlockByNumber', ['0x0', false]); - if (genesis?.hash?.toLowerCase() !== GENESIS) throw new Error('Wrong genesis: this is not Bradbury Phase 2 (chain ID 4221 is reused)'); - async function requireCode(name, address) { - const code = await request('eth_getCode', [address, 'latest']); - if (typeof code !== 'string' || !/^0x[0-9a-f]+$/i.test(code) || code.length <= 2) throw new Error(name + ' has no deployed code'); - } - await requireCode('AddressManager', ADDRESS_MANAGER); - const resolved = {AddressManager: ADDRESS_MANAGER}; - for (const name of ['Staking', 'ConsensusMain']) { - const result = await request('eth_call', [{to: ADDRESS_MANAGER, data: lookupData(name)}, 'latest']); - if (typeof result !== 'string' || !/^0x0{24}[0-9a-f]{40}$/i.test(result) || BigInt(result) === 0n) throw new Error(name + ' has no valid AddressManager entry'); - const address = '0x' + result.slice(-40); - await requireCode(name, address); - resolved[name] = address; - } - return resolved; -} - -export function rpcRequest(url, key) { - return async (method, params) => { - // Do not print endpoint URLs, headers, provider errors or response bodies: they may contain credentials. - let response; - try { - response = await fetch(url, {method: 'POST', headers: {'content-type': 'application/json', ...(key ? {'X-AccessKey': key} : {})}, - body: JSON.stringify({jsonrpc: '2.0', id: 1, method, params}), signal: AbortSignal.timeout(15000)}); - } catch { throw new Error(`${method}: RPC connection failed`); } - if (!response.ok) throw new Error(`${method}: HTTP ${response.status}`); - let data; - try { data = await response.json(); } catch { throw new Error(`${method}: invalid JSON response`); } - if (data.error || data.result === undefined) throw new Error(`${method}: RPC request rejected`); - return data.result; - }; -} - -if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { - try { - await checkNetwork(rpcRequest(process.env.BRADBURY_RPC_URL || 'https://rpc.testnet-chain.genlayer.com', process.env.BRADBURY_RPC_KEY || process.env.GENLAYERNODE_ROLLUP_GENLAYERCHAINRPCKEY)); - console.log('Bradbury Phase 2: chain ID, genesis and required contract code verified.'); - } catch (error) { - console.error(error.message); - process.exitCode = 1; - } -} diff --git a/scripts/check-chains-drift.mjs b/scripts/check-chains-drift.mjs index 486b884..3b3d52e 100644 --- a/scripts/check-chains-drift.mjs +++ b/scripts/check-chains-drift.mjs @@ -21,13 +21,20 @@ const REPO_ROOT = join(dirname(fileURLToPath(import.meta.url)), ".."); const NETWORKS_REF = process.env.GENLAYER_NETWORKS_REF || "main"; const NETWORKS_BASE = `https://raw.githubusercontent.com/genlayerlabs/genlayer-networks/${NETWORKS_REF}`; -// Phase 2 is not yet represented by genlayer-networks/bradbury. Verify its -// pinned, explorer-verified implementation ABIs instead of the legacy deployment. -const BRADBURY = JSON.parse(readFileSync(join(REPO_ROOT, "scripts/bradbury-phase-2-contracts.json"), "utf8")); - const CHAINS = [ { name: "asimov", deploymentKey: "deployment_asimov_phase5" }, - { name: "bradbury", deploymentKey: "deployment_bradbury" }, + // Bradbury Phase 2 is not in genlayer-networks yet. Its deployment file is a + // copy of genlayer-consensus deployments/bradbury-phase-2.json @ 7a46314 (a private + // repo), and its ABIs come from the explorer-verified implementations. + // Point this entry back at genlayer-networks once Phase 2 is published there. + { + name: "bradbury", + deploymentKey: "deployment_bradbury_phase_2", + networkKey: "genlayerOrbitTestnet", + deploymentsFile: "scripts/deployments/bradbury-phase-2.json", + abiUrl: (group, networksKey) => + `https://contracts.conduit.xyz/v2/contract/4221/${group[`${networksKey}Implementation`]}?fields=abi`, + }, ]; // For each contract: where to find the ABI in genlayer-networks and whether @@ -138,21 +145,19 @@ async function main() { const chains = await loadChains(); const failures = []; - for (const { name, deploymentKey } of CHAINS) { + for (const { name, deploymentKey, networkKey = "genlayerTestnet", deploymentsFile, abiUrl } of CHAINS) { const chain = chains[name]; if (!chain) { failures.push(`[${name}] chain export missing from dist/chains`); continue; } - const deployments = name === "bradbury" ? null : await fetchJson( - `${NETWORKS_BASE}/${name}/testnet_deployments.json`, - ); - const group = name === "bradbury" - ? Object.fromEntries(Object.entries(BRADBURY).map(([key, value]) => [key, value.address])) - : deployments.genlayerTestnet?.[deploymentKey]; + const deployments = deploymentsFile + ? JSON.parse(readFileSync(join(REPO_ROOT, deploymentsFile), "utf8")) + : await fetchJson(`${NETWORKS_BASE}/${name}/testnet_deployments.json`); + const group = deployments[networkKey]?.[deploymentKey]; if (!group) { failures.push( - `[${name}] testnet_deployments.json has no .genlayerTestnet.${deploymentKey}`, + `[${name}] deployments JSON has no .${networkKey}.${deploymentKey}`, ); continue; } @@ -178,9 +183,9 @@ async function main() { } const nwAbi = ( - await fetchJson(name === "bradbury" - ? `https://contracts.conduit.xyz/v2/contract/4221/${BRADBURY[networksKey].implementation}?fields=abi` - : `${NETWORKS_BASE}/${name}/${abiPath}`) + await fetchJson( + abiUrl ? abiUrl(group, networksKey) : `${NETWORKS_BASE}/${name}/${abiPath}`, + ) ).abi; const jsSet = canonicalSet(jsContract.abi); const nwSet = canonicalSet(nwAbi); @@ -207,7 +212,7 @@ async function main() { process.exit(1); } console.log( - "No drift. Bradbury matches its verified Phase 2 implementations; other chains match genlayer-networks/" + NETWORKS_REF + ".", + "No drift. Chain files match genlayer-networks/" + NETWORKS_REF + ".", ); } diff --git a/scripts/deployments/bradbury-phase-2.json b/scripts/deployments/bradbury-phase-2.json new file mode 100644 index 0000000..536062e --- /dev/null +++ b/scripts/deployments/bradbury-phase-2.json @@ -0,0 +1,224 @@ +{ + "genlayerOrbitTestnet": { + "deployment_bradbury_phase_2": { + "AddressManager": "0x3F71AE080BD6270A91dBcc7960d88797828538E0", + "AddressManagerImplementation": "0xDeb0D115881505393cabb6FC764eEe6Bb51ad944", + "VestingFactory": "0x82cA5e0e7A9345CF3ED5ee68A7fba41EF2202316", + "VestingFactoryImplementation": "0x1C7D938E3aEdB2E683E3F8cCAE9459ADd0eC3cD5", + "VestingBlueprint": "0xd52998F07eF136d44B41Dc73c131492c8985e204", + "VestingBeacon": "0x6A5f7bb80b8760B8978e3E2D57a4639111ebba05", + "ArrayUtils": "0x87B8BC807392DeD881b49d544032a3A8ac411613", + "RandomnessUtils": "0xd7DE7Feeed4B6f51D851AAf347CB0895D1275342", + "FeeProfileHelpers": "0x7EBa83806Cd72ba96A10995840B4Aefc2802F8EF", + "ConsensusHelpers": "0x9F757AeC38Bd4d217A3F05fC9c715112ca5279f6", + "AppealFundingHelpers": "0x6ea7466625A45272AC786bdCbED179C6fBcEc376", + "FeeAppealHelpers": "0x76F6ECdFb9256BD96bf7Da9Dc724873D8F78429f", + "MessagesPolicyHelpers": "0x6b8EEaF7258e3ef5476E0B835e1c832228bc1b7d", + "MessagePaymentsHelpers": "0x8101882d8a2Fea752Bf041Aaeb068C3B4FD62B97", + "FeeSplitUtils": "0x868D93f0f6ee923DD609788842e635ae27A16A0D", + "MessagePaymentsTerminalHelpers": "0x7534f102EF52EdC0FCb835eE58e8b15Df757092c", + "IdlenessHelpers": "0x894B9b1Fbc238318f10200cbE03eBf6e2ccCa637", + "IdlenessPolicyHelpers": "0xC15E310c030a33a070aF0A1B05651DA8d640a858", + "ResolutionKernel": "0x274663eB1F7E1c23E7192Fd102212F05dbb02e85", + "TerminalRoundKernel": "0x62d3aaBF65d58D51D32B8781C32ca40174a39a5F", + "ValidatorSelectionUtils": "0x549dC20c5F22D59b0F662Bb5bC800daE0a7b7a2F", + "ValidatorUtils": "0xe13742A806c532972964A25d5A3795FB1702eBc2", + "SnapshotSelectionKernel": "0x84c06bc3d53c5859334BA32d707604750D761196", + "DelegatorUtils": "0xddF2a0491745B238818bcc02CE71aD5145bfd93A", + "ValidatorPrimeUtils": "0x1CDE9c9f3a17cBeB6bCFBE1fd732745309f81576", + "ValidatorSlashProgress": "0x71fD566E1143cf97d3448e641D7A04f1e2C6dE41", + "RecoveryHelpers": "0x2dAE85871C61b8896Ec0485050E66F2Cba4925fB", + "QueueStepUtils": "0xb4d264c5f8D51FDfE48fd3b7dbd2F3943eC8c073", + "TribunalInitializationManager": "0xb80D257061358fF158B6F3e68CE659a3b74443Ff", + "TransitionEnforcer": "0xA30098a857e9246268cf9c8E7F126bDa882289aC", + "GovernanceVotingPowerLib": "0x9fae49037cB7E936749123509ca80415F74B9B53", + "GovernanceVotingLib": "0x01d2af0B247Db3914BD2A9fcc778ab132b4A5393", + "GovernanceElectionsLib": "0x430F5D133aF0b930b556E4D54132b69aeE73388A", + "ConsensusProposalHelpers": "0x06871c41b23D42E940dFD09CA84117d21dC88C8B", + "FeeManagerHelpers": "0x4b21cF7CDe9F4a72C618204aAA2509A1c37De2C6", + "ConsensusFinalizationHelpers": "0xa2F211EE0D1CcC372695766a47c18af3C4FE46fC", + "MinimumStakeTransitionManager": "0x37f083c99A72e71B9f564B85cAE9eFa26ebA59F8", + "RemedySelectionKernel": "0x0CB262aD8b7964CC88Ec3C96eb6E1474f16D5bf6", + "ValidatorSlashSettlement": "0x217530Bf7227CF6BC290Bab5ece5e9375E4fa3Cf", + "GovernancePostVoteLib": "0xC806625eC0a470FFBAA50342Ed723599513Bd4a7", + "GovernanceSettlementLib": "0xC35FAcFba561137FC302887a0F29fEF5BB1Aa65a", + "ConsensusManager": "0x3F748d4CbDA4FDfe8356690aFD73ac4cFc4eE56B", + "ConsensusManagerImplementation": "0x7927C4A3DF163c7772BB8d3019Fa16e6398Ec833", + "GhostFactory": "0x901ECAeFc35aed5Dd9967feF4E161d42199aAd9d", + "GhostFactoryImplementation": "0x9d297C8E1AD2A811b12ACD0AD6ea87190f55bA7a", + "GhostManager": "0x2E2766cbc3E5e61Ce93bBcdCBb3eAcB82082A019", + "GhostManagerImplementation": "0x7EfCEaE0cB2bEd3B2dA9209bd096d2F88E07343b", + "GhostBlueprint": "0x450d2B06aB240773d1E23e69d0c5d616bEF4Ba2d", + "GhostBlueprintImplementation": "0xdcF2Cfc7c6B848D6a9B5BCe9EBc10a50c911F55D", + "Messages": "0xD14B0489157FE420555F1e5A6AFBA031E978aCE5", + "MessagesImplementation": "0xC99Bc447AA1436D51F4eEc13992Fe0393Cc01464", + "Appeals": "0xdc953c3bCf8837987853ca05a78D52fFC3E18651", + "AppealsImplementation": "0xfA88c97083f51CCB498248a43f8E5e573CA5475f", + "Queues": "0xBfE2ece1f2c62Ab3700C94Ed6bB76286bccC8CB3", + "QueuesImplementation": "0x8a40F27F3706CEF9598E484cb98B278504ef904f", + "NFTMinter": "0xEe307BCE38733cD16c15A13FE7e928BBE40e96E1", + "NFTMinterImplementation": "0xf2872aB79F98177E19710d80567D3658C95d8971", + "DeepthoughtReserve": "0x9d8c991Fe71d27589f004c24505f4ce4C6fD3F78", + "DeepthoughtReserveImplementation": "0x978607b4d5bf19C5dB8FACe35c43EC8bCF01f64D", + "DeepthoughtFoundation": "0x9E02cE50C79A19D9c1A194B0daEE481394661D6A", + "Staking": "0xD8fBa96C0dBB0257028dBc0107060b958e5c7113", + "StakingImplementation": "0x5ed40150710C64318607CC684211ff6c7b3592Fa", + "TransactionManager": "0xaCe5e4191Bf408957538Caa9493aBB64F63D92c4", + "TransactionManagerImplementation": "0xBFD56eC25881170096470716Aa76dD0387D50090", + "RoundsStorage": "0x4038d4F72C7aAbA5a442cC0dA946012B9E3f4B8a", + "RoundsStorageImplementation": "0x9d1516378757dabd8E3DFd41894e1BCB2Df8b9D1", + "RoundsCreation": "0x35A36496861b11199486121621EEb86E0528630C", + "RoundsCreationImplementation": "0x2311F4EB06D4943b541925115C9Ae2110d02AFCA", + "RoundsVoting": "0xFBA6A1F9a1FB76Cdb1559241A7e0Ddeb4C1DF5a1", + "RoundsVotingImplementation": "0xe0c3bD4De52D2D492A29b619A0eB21507E5dA74C", + "RoundsLight": "0xe1B234B6959deA2AD0873fc7248a91a53a6185f9", + "RoundsLightImplementation": "0x6602415B303a238d62A23588326168BBFA150f2B", + "CreationPhase": "0x56a1517B263c849Be4a0c861540C14e1d51E6273", + "CreationPhaseImplementation": "0xD1F278b3a8156aa20A912a96bc0D06aaC9ff3654", + "ActivationPhase": "0x62541A8314b9112407E53B3bc5cf8970906E845c", + "ActivationPhaseImplementation": "0xb1A40372b630988738a27dD36cd5e3dA947625D9", + "ProposalPhase": "0x44aFCc45720c6ab951BabB726C07A651De9aA4b3", + "ProposalPhaseImplementation": "0x99591508acE2dddC93eC4d513719Ff93f237C557", + "CommittingPhase": "0xC08fDE7309d590e01FB93E37a808DEf2a8aB6bc2", + "CommittingPhaseImplementation": "0x27A1667Ad66787382207bF3d46e3B4367f7FBa05", + "RevealingPhase": "0x88c6D8Ff2BC235eEf758014dd92C2E45D1E5C8F7", + "RevealingPhaseImplementation": "0x3EE88E5Fb9fC44D6321D4903719E8114E14f0ee3", + "FinalizationPhase": "0x0c746f9c1b5F4cD135cB152fdb10CFd36d6560B5", + "FinalizationPhaseImplementation": "0x599138DfaB2e0eecA0Cf44d7664124f87edEf333", + "IdlenessPhase": "0xa2f3360c3359e45AD07E889018567BaBB914d3eB", + "IdlenessPhaseImplementation": "0x922afF75e65a5E4EA489923337F2bf8bBe655FF2", + "IdlenessCrank": "0xea447c0a9656cf5C6983578Da910bb88eF8e0e30", + "IdlenessCrankImplementation": "0xfb55C8a85F4a3e0DE7306E69dCeCE575B64824AD", + "IdlenessViews": "0x0861c1c7ACAAA2a56c6c49FB13261171DcB10855", + "ConsensusMain": "0x2E2766cbc3E5e61Ce93bBcdCBb3eAcB82082A019", + "ConsensusMainWithFees": "0x2E2766cbc3E5e61Ce93bBcdCBb3eAcB82082A019", + "ConsensusMainImplementation": "0xe9F572e836ea3640c022D09Aa41108fba3574731", + "ConsensusMainWithFeesImplementation": "0xe9F572e836ea3640c022D09Aa41108fba3574731", + "ConsensusData": "0xc5FA6f82BEe53598825d6edf7E3e24613082c75B", + "ConsensusDataImplementation": "0x7A92A2036102c27eE9989f1D2f2E16152338c4b0", + "ConsensusDataBigRounds": "0xc0aB228Ba46b4825fcd6461ea56d5B732AcA0E3B", + "ConsensusDataBigRoundsImplementation": "0x4e909C7A4fc1d7A68BB3C6B9f3948AD3438df434", + "Utils": "0x215952B66D801c805e68E2503AfC751cAA84Af7c", + "FeesVerifier": "0xE5DaA0860E1a1dc08a219762f96Fe2e5006504b3", + "MessageFeeAllocations": "0x1B1eA007C42C1087d889233Ff7157237e7DAe3A9", + "MessageFeeAllocationsImplementation": "0xD8f349b319eBe6f0D92ECD58c650219Db2155e9C", + "FeesRecorder": "0x8beE3d0b24e07183A840bd0B51041C1f71914797", + "FeesRecorderImplementation": "0x3A375E2bf2bA197CE5d51365b8226FA710c5e812", + "Idleness": "0x8f4167edC14Ce4E0640de65cF70DcdE3dfba9FF1", + "IdlenessImplementation": "0xBecCf4f68360FAb9ABbeb0bf177ed7c420270cfa", + "Voting": "0xB8E01fA102f91ec2E402CfBD23f162e088C2CD3A", + "TribunalAppeal": "0x7cf2D3Fa7f63F3547C5036dC955ba1a70235682a", + "TribunalAppealImplementation": "0xD713AcD6aAB0dEA91A79aDeEb3BAB679287bA1fB", + "Slash": "0x9C30189686B7d6ec5e525eA6f155B57987d2086f", + "SlashImplementation": "0x5cd0C14c7a8C0f326D8333fA36437A4fEB7B7002", + "StakingInflation": "0xF6e020677d4799281942BA868B04f824D9B194C1", + "StakingConfig": "0xe56D9dEdD88b600D36663c3E3a57099616Da1494", + "StakingDelegators": "0x05F3157E873dD68De43ED82920D6a799873Cf7F5", + "StakingBan": "0x9c251FB71832C470D7a30B08107fF8ad85825CFB", + "StakingValidators": "0x6750F65b74B73FA529a7A4fe283b705d509B3306", + "StakingEpoch": "0xdeF1262F9A0CFFD7Fc26F0C8F7Ef1af724136E19", + "StakingReadFacet": "0x47a404edE8F68F0b9253aB009e5Aa0362517B1e1", + "StakingReadModel": "0xf1fBdE733A9ceE2C0A44b8f724d944F89aE6D8A4", + "StakingData": "0x8951E93ae3E95F44Bc700fd8D145d30f5eeD408E", + "StakingDataImplementation": "0xb17160b160885616cac24CA46cDE0FCBf66DE2e8", + "ValidatorWalletFactory": "0x399FCBe6b442903cbA4d3B647B4b30EddF729314", + "ValidatorWalletFactoryImplementation": "0xf9451abD90122A7f0DE1fF35F337Ff31344cdd50", + "ValidatorWalletBlueprint": "0xAE308333af9e4aB7418E0CA6f1Fd5fAb8915BAf2", + "ValidatorWalletBeacon": "0xb9F17C1799DdCd26C0e621d65D8Ce0A3191B0495", + "MessagePayments": "0x5Ac4717C772107c335f2db699e2cDA4ebC192faE", + "MessagePaymentsImplementation": "0xc2Fc56fC211eCE37Eb97402184498Cdb086c63DF", + "FeeManager": "0x7678587A847712f2A96082AC07883A88D0fc7245", + "FeeManagerImplementation": "0x8797Ef886ebBd2492A137f5279E537ba29B1E542", + "FeesProcessor": "0x040a455CA9c6A8Cdc696F6fE603152692D4CA775", + "FeesProcessorImplementation": "0x085565c4ae049D47E2485D5Db0c82fC443Ec6De4", + "TransactionFeesManager": "0xd122de4CB6704C0FDdbb061275F0171e1119A429", + "TransactionFeesManagerImplementation": "0x462ff7E2Ea6323Ee7C1DA466f5c1fdb13B2a5747", + "ContributionLedger": "0x9dC6642157b88da4E05ec2F57a186d5F2C03c106", + "ContributionLedgerImplementation": "0x9e778cc1B60Cf173f151Fa8FF6F4d98fA2A04cDD", + "BatchTransactionHandler": "0x318d04EbeB53d121e0a8566a9448ffE84af0D1C4", + "BatchTransactionHandlerImplementation": "0x09A2aa555C15018e521E538Bc3E7f330E93B2955", + "StakingInvariant": "0xf9F9bed2008EcD50AdbB101eA455CBe42F1b6Be4", + "GovernanceClock": "0xBDb6b4cAEdF3Bfca166745c2a4C16053351A57a6", + "GovernanceClockImplementation": "0xcf53D59DcdC59D54D00941cB7B0B8E2425Eb49E0", + "GovernanceClockProxyAdmin": "0x472C1929AB55eEf95C50560Ef849799Da7450D40", + "GovernanceGESRegistry": "0x9a59348e756f9dD54C58B31ac764fB0130B51e06", + "GovernanceGESRegistryImplementation": "0x735702b10ccAC8279a37e9394a5d3B484C1F239b", + "GovernanceGESRegistryProxyAdmin": "0xD5B5767cF38B61DD5CA6Bf708E10C74e5E52AFcc", + "GovernanceVotingPower": "0xc42590416fF93dD12a038b601088Ff2629559aBf", + "GovernanceVotingPowerImplementation": "0x7360e90Fa3E29eAAF223912E186A99726de9102B", + "GovernanceVotingPowerProxyAdmin": "0xF8da3FD735023416ABba6Eb45B5C33bE640Ba65d", + "Governance": "0x14b647BE7358aE0678DB5B60eC8B8fd90e895917", + "GovernanceImplementation": "0xB6321e2b3AaE08Af76e3f7F13863625645bd5055", + "GovernanceProxyAdmin": "0xF6ad1F88B554758c251D357B586c293A708Ce0F2", + "GovernanceL1Bridge": "0x94b1907087590241e3B55e6655A7EdaFfEC10300", + "GovernanceL1BridgeImplementation": "0x83F71F679195fEDb7f191FF05489f78212eAD9f3", + "GovernanceL1BridgeProxyAdmin": "0x8da7c4C83f9A43277C529185f58D45A746aBA3a7", + "GovernancePause": "0x57b84903112c958b5561d56393e76BD227ba97cF", + "GovernanceVoting": "0xF4Fbb5C9FEe31cF45ECb37a3578699F8E88A52C3", + "GovernanceVotingImplementation": "0xBfDe0360107644d95cb7c27FB7750829A76f3e6A", + "GovernanceVotingProxyAdmin": "0x1C9EDA1A813D02FEAc4776edb90462A0A9A15e5f", + "SecurityCouncil": "0x48713683CdB19ece4f6f9601Ffe64c8862827cFC", + "SecurityCouncilImplementation": "0x21062076A29568272C0E404922aa5ba3ceACCD90", + "SecurityCouncilProxyAdmin": "0xDf26e1836FCB9696884f3B1c08C933026E1Cb080", + "GovernanceCouncilElections": "0xFF203aBb22412c81Fa04Dfb1F9620790F7ca581c", + "GovernanceCouncilElectionsImplementation": "0x4fFF3b79b90625c225999Ee6C77E9a4A21Ba33d0", + "GovernanceCouncilElectionsProxyAdmin": "0x079e7d3DE30A0aD906977b89EDFFd227F578f299", + "AddressManagerProxyAdmin": "0x80DC73b233Cc4aBd70F437b93bC1054C8089f8BA", + "VestingFactoryProxyAdmin": "0x12117A1B794F472E4Cc8258a435827dBDF7C1F4A", + "ConsensusManagerProxyAdmin": "0x3a262c10A07cAAF1C26101ce2701190D57963A00", + "GhostFactoryProxyAdmin": "0x8c661D78E43293808115c259d4f82c113d800dC9", + "GhostManagerProxyAdmin": "0xc9AAa53dA179484f163Fae427bf8a26a9Cc676E9", + "GhostBlueprintProxyAdmin": "0x97B5deA1a474d4788eEEeF46acbB77D207ba1722", + "MessagesProxyAdmin": "0x840CBd2572C18293981572AbAa0707adA547d965", + "AppealsProxyAdmin": "0x961E1a426A0BFbA5A0Ba935F5de7f295992aABE5", + "QueuesProxyAdmin": "0xaaF7FB4e70d3f1C15bBc1a6e615bcbba53BBe5B8", + "NFTMinterProxyAdmin": "0x474e4855851b9F29C91331c8dA4f02f8a0857a94", + "StakingProxyAdmin": "0xCEd58676939229fD3d4cD326895CeA0178fd7F8C", + "TransactionManagerProxyAdmin": "0xE8FF47d66816649888421Bab2BeaABC12994C55E", + "RoundsStorageProxyAdmin": "0xd0E773ee7b6c6192C2d70cAAa93C5165B8a22145", + "RoundsCreationProxyAdmin": "0xA39183AE982fE0E877150a1e76D6B8565b82FfCc", + "RoundsVotingProxyAdmin": "0xdBC786CD6E6Cd361679926b37b3614904354Ea24", + "RoundsLightProxyAdmin": "0x12cb7b6292874db45db43E79ca23c26fe698795b", + "CreationPhaseProxyAdmin": "0x0A88507285bD16Ac6CF56876dA3Fa0524026D16C", + "ActivationPhaseProxyAdmin": "0xe64d26507E9e141DdceDA41c9ad976D3857a35Ea", + "ProposalPhaseProxyAdmin": "0xa1ee03197D6fB2420d91FF5bab2e511d4F92C66d", + "CommittingPhaseProxyAdmin": "0x42ceF82065adB99c0dEf2A75Bb2C2f6702f3B439", + "RevealingPhaseProxyAdmin": "0x817FdA6125cB3d1Ed76670619052620b55d6fBE2", + "FinalizationPhaseProxyAdmin": "0xB98dD719f706eDF6F2b04A0d4C42e1C6B1F18cA9", + "IdlenessPhaseProxyAdmin": "0x0E60BABa88fA034dfA4386506fB6B857Fe2a6D6c", + "IdlenessCrankProxyAdmin": "0x2F161945c92119ADA4959DbCCb64d2E1b8DF302c", + "ConsensusMainProxyAdmin": "0x2Eb0145d43dbC3A889c0Fd1076506627e2f3c896", + "ConsensusMainWithFeesProxyAdmin": "0x2Eb0145d43dbC3A889c0Fd1076506627e2f3c896", + "ConsensusDataProxyAdmin": "0xE5B9D629C206097b05d9337c72011615F624D0d8", + "ConsensusDataBigRoundsProxyAdmin": "0x79aCeb3AaEA6B5962BA2B81a56a4A9f918662d11", + "MessageFeeAllocationsProxyAdmin": "0xaFC1Bf1d448E474D5828F64Efda535C220d91BB3", + "FeesRecorderProxyAdmin": "0xBbf1B21097f1D909451c6ea95cC7d1C4Db20C875", + "IdlenessProxyAdmin": "0x944E5534a8CFDE821365e332Ba2Fc166f6380cF9", + "TribunalAppealProxyAdmin": "0xcF9f7C59147dC23f4294d66DA0DC308EB7d72E89", + "SlashProxyAdmin": "0xf9C9B13dA73887733Bbf99988ceb42dc2bf6809D", + "StakingDataProxyAdmin": "0xE8cB25a095699B391ccc6e7F792c8b4cC375f88c", + "ValidatorWalletFactoryProxyAdmin": "0x5E3dC20BfBB5803D73E944F339F7c93e350Df8A3", + "MessagePaymentsProxyAdmin": "0xB6f7a73D0Fd54BB8c667809792b0cc48d2f20684", + "FeeManagerProxyAdmin": "0x7aD053c9A00a835Ae453678AAf107092115BD103", + "FeesProcessorProxyAdmin": "0xfD43C59E56C2d25A13537D85D79b42F03B0d2d71", + "TransactionFeesManagerProxyAdmin": "0xd158244416Ba9aC4804eb6dcB64adB5eB7D56162", + "ContributionLedgerProxyAdmin": "0x458ce937D8c966E43410Ec4894c4a07d319C0dcf", + "BatchTransactionHandlerProxyAdmin": "0x4147652857E738f3Ffe13ABd2546C6F3178A4688", + "GovernanceClassRegistry": "0x172AE46D9eceE2f7c93c2e0226D78266DB77270f", + "GovernanceClassRegistryImplementation": "0x10FC285bcf5d7A5862B0B4bD6fE640B941d649B9", + "GovernanceClassRegistryProxyAdmin": "0x3F8D418E867F714F57220BbFBC0b8ce58d79590b", + "GhostFleetInitialImplementation": "0x74C9617e5Ec6EFAD6c7793064877CFfDb6E736e5", + "Gen": "0x424242424b68330CcFb022881d25a6acC29852ea", + "GhostManagerSupersededRecord": "0x6309BF331Acf5287AaDe8334D29C75EFAa96F863", + "GenManager": "0x3F748d4CbDA4FDfe8356690aFD73ac4cFc4eE56B", + "Rounds": "0xe1B234B6959deA2AD0873fc7248a91a53a6185f9", + "Slashing": "0x9C30189686B7d6ec5e525eA6f155B57987d2086f", + "IGenLayerStaking": "0xD8fBa96C0dBB0257028dBc0107060b958e5c7113", + "StakingViews": "0xf1fBdE733A9ceE2C0A44b8f724d944F89aE6D8A4", + "Transactions": "0xaCe5e4191Bf408957538Caa9493aBB64F63D92c4", + "Vesting": "0xd52998F07eF136d44B41Dc73c131492c8985e204", + "ArbitrumInflationEscrow": "0xe7Dc9f8ed1b21f76215635254F01FC02D740AD13", + "InflationFeeVault": "0x7e47934AAD662Abc8294e1e412440Ac0DA1Fe206" + } + } +} \ No newline at end of file diff --git a/src/chains/testnetBradbury.ts b/src/chains/testnetBradbury.ts index 13b7f36..a4deca3 100644 --- a/src/chains/testnetBradbury.ts +++ b/src/chains/testnetBradbury.ts @@ -3,7 +3,7 @@ import {GenLayerChain} from "@/types"; import {STAKING_ABI} from "@/abi/staking"; const TESTNET_JSON_RPC_URL = "https://rpc.testnet-chain.genlayer.com"; -// Validator WebSocket access is configured separately by its RPC operator. +// WebSocket not available on testnet GenLayer RPC nodes const STAKING_CONTRACT = { address: "0xD8fBa96C0dBB0257028dBc0107060b958e5c7113" as Address, @@ -12,2829 +12,2687 @@ const STAKING_CONTRACT = { const FEE_MANAGER_CONTRACT = { address: "0x7678587A847712f2A96082AC07883A88D0fc7245" as Address, abi: [ - { - "name": "calculateMinAppealBond", - "type": "function", - "inputs": [ - { - "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "_round", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "_status", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" - } - ], - "outputs": [ - { - "name": "totalFeesToPay", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - } -], + { + type: "function" as const, + name: "calculateMinAppealBond", + stateMutability: "view" as const, + inputs: [ + { name: "_txId", type: "bytes32" }, + { name: "_round", type: "uint256" }, + { name: "_status", type: "uint8" }, + ], + outputs: [ + { name: "totalFeesToPay", type: "uint256" }, + ], + }, + ], }; const ROUNDS_STORAGE_CONTRACT = { address: "0x4038d4F72C7aAbA5a442cC0dA946012B9E3f4B8a" as Address, abi: [ - { - "name": "getLastRoundData", - "type": "function", - "inputs": [ - { - "name": "txId", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "round", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "roundData", - "type": "tuple", - "components": [ - { - "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": "uint256" - }, - { - "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" - }, - { - "name": "roundValidators", - "type": "address[]", - "internalType": "address[]" - }, - { - "name": "validatorVotes", - "type": "uint8[]", - "internalType": "enum ITransactions.VoteType[]" - }, - { - "name": "validatorVotesHash", - "type": "bytes32[]", - "internalType": "bytes32[]" - }, - { - "name": "validatorResultHash", - "type": "bytes32[]", - "internalType": "bytes32[]" - } - ], - "internalType": "struct ITransactions.RoundData" - } - ], - "stateMutability": "view" - }, - { - "name": "getRoundData", - "type": "function", - "inputs": [ - { - "name": "txId", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "round", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "tuple", - "components": [ - { - "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": "uint256" - }, - { - "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" - }, - { - "name": "roundValidators", - "type": "address[]", - "internalType": "address[]" - }, - { - "name": "validatorVotes", - "type": "uint8[]", - "internalType": "enum ITransactions.VoteType[]" - }, - { - "name": "validatorVotesHash", - "type": "bytes32[]", - "internalType": "bytes32[]" - }, - { - "name": "validatorResultHash", - "type": "bytes32[]", - "internalType": "bytes32[]" - } - ], - "internalType": "struct ITransactions.RoundData" - } - ], - "stateMutability": "view" - }, - { - "name": "getRoundNumber", - "type": "function", - "inputs": [ - { - "name": "txId", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - } -], + { + type: "function" as const, + name: "getLastRoundData", + stateMutability: "view" as const, + inputs: [ + { name: "txId", type: "bytes32" }, + ], + outputs: [ + { name: "round", type: "uint256" }, + { + name: "roundData", + type: "tuple", + components: [ + { name: "round", type: "uint256" }, + { name: "leaderIndex", type: "uint256" }, + { name: "votesCommitted", type: "uint256" }, + { name: "votesRevealed", type: "uint256" }, + { name: "appealBond", type: "uint256" }, + { name: "rotationsLeft", type: "uint256" }, + { name: "result", type: "uint8" }, + { name: "roundValidators", type: "address[]" }, + { name: "validatorVotes", type: "uint8[]" }, + { name: "validatorVotesHash", type: "bytes32[]" }, + { name: "validatorResultHash", type: "bytes32[]" }, + ], + }, + ], + }, + { + type: "function" as const, + name: "getRoundData", + stateMutability: "view" as const, + inputs: [ + { name: "txId", type: "bytes32" }, + { name: "round", type: "uint256" }, + ], + outputs: [ + { + name: "", + type: "tuple", + components: [ + { name: "round", type: "uint256" }, + { name: "leaderIndex", type: "uint256" }, + { name: "votesCommitted", type: "uint256" }, + { name: "votesRevealed", type: "uint256" }, + { name: "appealBond", type: "uint256" }, + { name: "rotationsLeft", type: "uint256" }, + { name: "result", type: "uint8" }, + { name: "roundValidators", type: "address[]" }, + { name: "validatorVotes", type: "uint8[]" }, + { name: "validatorVotesHash", type: "bytes32[]" }, + { name: "validatorResultHash", type: "bytes32[]" }, + ], + }, + ], + }, + { + type: "function" as const, + name: "getRoundNumber", + stateMutability: "view" as const, + inputs: [ + { name: "txId", type: "bytes32" }, + ], + outputs: [ + { name: "", type: "uint256" }, + ], + }, + ], }; const APPEALS_CONTRACT = { address: "0xdc953c3bCf8837987853ca05a78D52fFC3E18651" as Address, abi: [ - { - "name": "canAppeal", - "type": "function", - "inputs": [ - { - "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "_expectedDecisionId", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - } -], + { + type: "function" as const, + name: "canAppeal", + stateMutability: "view" as const, + inputs: [ + { name: "_txId", type: "bytes32" }, + { name: "_expectedDecisionId", type: "uint256" }, + ], + outputs: [ + { name: "", type: "bool" }, + ], + }, + ], }; const EXPLORER_URL = "https://scan.testnet-chain.genlayer.com"; const CONSENSUS_MAIN_CONTRACT = { address: "0x2E2766cbc3E5e61Ce93bBcdCBb3eAcB82082A019" as Address, abi: [ { - "type": "constructor", "inputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "constructor" }, { + "inputs": [], "name": "CallerNotMessages", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "CanNotAppeal", - "type": "error", - "inputs": [] + "type": "error" }, { - "name": "ExecutionBudgetExceeded", - "type": "error", "inputs": [ { + "internalType": "uint256", "name": "attemptedConsumption", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "budget", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } - ] + ], + "name": "ExecutionBudgetExceeded", + "type": "error" }, { + "inputs": [], "name": "InsufficientFees", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "InvalidDeploymentWithSalt", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "InvalidInitialization", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "InvalidRegistry", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "InvalidRevealLeaderData", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "LegacyProposeReceiptRetired", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "MessageEnvelopeRequired", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "MessageFeesTotalMustBeNonZero", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "NotInitializing", - "type": "error", - "inputs": [] + "type": "error" }, { - "name": "OwnableInvalidOwner", - "type": "error", "inputs": [ { + "internalType": "address", "name": "owner", - "type": "address", - "internalType": "address" + "type": "address" } - ] + ], + "name": "OwnableInvalidOwner", + "type": "error" }, { - "name": "OwnableUnauthorizedAccount", - "type": "error", "inputs": [ { + "internalType": "address", "name": "account", - "type": "address", - "internalType": "address" + "type": "address" } - ] + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" }, { + "inputs": [], "name": "ProtocolNotSealed", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "ReentrancyGuardReentrantCall", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "RegistryBindingLocked", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "RollupBudgetBelowFloor", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "Unauthorized", - "type": "error", - "inputs": [] + "type": "error" }, { - "name": "ActivatorReplaced", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "oldActivator", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "oldActivator", + "type": "address" }, { - "name": "newActivator", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "newActivator", + "type": "address" } ], - "anonymous": false + "name": "ActivatorReplaced", + "type": "event" }, { - "name": "AddressManagerSet", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "addressManager", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "addressManager", + "type": "address" } ], - "anonymous": false + "name": "AddressManagerSet", + "type": "event" }, { - "name": "AllVotesCommitted", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "newStatus", - "type": "uint8", "indexed": false, - "internalType": "enum ITransactions.TransactionStatus" + "internalType": "enum ITransactions.TransactionStatus", + "name": "newStatus", + "type": "uint8" } ], - "anonymous": false + "name": "AllVotesCommitted", + "type": "event" }, { - "name": "AppealBondReturned", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "appealer", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "appealer", + "type": "address" }, { - "name": "amount", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "amount", + "type": "uint256" } ], - "anonymous": false + "name": "AppealBondReturned", + "type": "event" }, { - "name": "AppealStarted", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "appellant", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "appellant", + "type": "address" }, { - "name": "bond", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "bond", + "type": "uint256" }, { - "name": "validators", - "type": "address[]", "indexed": false, - "internalType": "address[]" + "internalType": "address[]", + "name": "validators", + "type": "address[]" } ], - "anonymous": false + "name": "AppealStarted", + "type": "event" }, { - "name": "AppealerProfitPayoutFailed", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "appealer", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "appealer", + "type": "address" }, { - "name": "bondReturned", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "bondReturned", + "type": "uint256" }, { - "name": "profitUnpaid", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "profitUnpaid", + "type": "uint256" } ], - "anonymous": false + "name": "AppealerProfitPayoutFailed", + "type": "event" }, { - "name": "BatchCommandFailed", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "commandKind", - "type": "uint8", "indexed": true, - "internalType": "uint8" + "internalType": "uint8", + "name": "commandKind", + "type": "uint8" }, { - "name": "errorSelector", - "type": "bytes4", "indexed": false, - "internalType": "bytes4" + "internalType": "bytes4", + "name": "errorSelector", + "type": "bytes4" }, { - "name": "failureFingerprint", - "type": "bytes32", "indexed": false, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "failureFingerprint", + "type": "bytes32" } ], - "anonymous": false + "name": "BatchCommandFailed", + "type": "event" }, { - "name": "BatchFinalizationCompleted", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "attempted", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "attempted", + "type": "uint256" }, { - "name": "finalized", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "finalized", + "type": "uint256" }, { - "name": "progressed", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "progressed", + "type": "uint256" }, { - "name": "failed", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "failed", + "type": "uint256" } ], - "anonymous": false + "name": "BatchFinalizationCompleted", + "type": "event" }, { - "name": "BatchResolutionCompleted", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "attempted", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "attempted", + "type": "uint256" }, { - "name": "resolved", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "resolved", + "type": "uint256" }, { - "name": "failed", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "failed", + "type": "uint256" } ], - "anonymous": false + "name": "BatchResolutionCompleted", + "type": "event" }, { - "name": "CreatedTransaction", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "txSlot", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "txSlot", + "type": "uint256" } ], - "anonymous": false + "name": "CreatedTransaction", + "type": "event" }, { - "name": "FeesRefunded", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "sender", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "sender", + "type": "address" }, { - "name": "amount", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "amount", + "type": "uint256" } ], - "anonymous": false + "name": "FeesRefunded", + "type": "event" }, { - "name": "FinalizationEffectsDeferred", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "decisionId", - "type": "uint256", "indexed": true, - "internalType": "uint256" + "internalType": "uint256", + "name": "decisionId", + "type": "uint256" }, { - "name": "recipient", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "recipient", + "type": "address" } ], - "anonymous": false + "name": "FinalizationEffectsDeferred", + "type": "event" }, { - "name": "Initialized", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "version", - "type": "uint64", "indexed": false, - "internalType": "uint64" + "internalType": "uint64", + "name": "version", + "type": "uint64" } ], - "anonymous": false + "name": "Initialized", + "type": "event" }, { - "name": "InternalMessageProcessed", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "recipient", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "recipient", + "type": "address" }, { - "name": "activator", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "activator", + "type": "address" } ], - "anonymous": false + "name": "InternalMessageProcessed", + "type": "event" }, { - "name": "LeaderIdlenessProcessed", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "oldLeader", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "oldLeader", + "type": "address" }, { - "name": "newLeader", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "newLeader", + "type": "address" } ], - "anonymous": false + "name": "LeaderIdlenessProcessed", + "type": "event" }, { - "name": "NewTransaction", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "recipient", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "recipient", + "type": "address" }, { - "name": "activator", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "activator", + "type": "address" } ], - "anonymous": false + "name": "NewTransaction", + "type": "event" }, { - "name": "NewTransactionAlreadyAnnounced", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "recipient", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "recipient", + "type": "address" }, { - "name": "firstAnnouncedAt", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "firstAnnouncedAt", + "type": "uint256" } ], - "anonymous": false + "name": "NewTransactionAlreadyAnnounced", + "type": "event" }, { - "name": "OwnershipTransferStarted", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "previousOwner", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "previousOwner", + "type": "address" }, { - "name": "newOwner", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "newOwner", + "type": "address" } ], - "anonymous": false + "name": "OwnershipTransferStarted", + "type": "event" }, { - "name": "OwnershipTransferred", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "previousOwner", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "previousOwner", + "type": "address" }, { - "name": "newOwner", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "newOwner", + "type": "address" } ], - "anonymous": false + "name": "OwnershipTransferred", + "type": "event" }, { - "name": "ProcessIdlenessAccepted", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" } ], - "anonymous": false + "name": "ProcessIdlenessAccepted", + "type": "event" }, { - "name": "ReceiptFeeEstimated", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "receiptFee", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "receiptFee", + "type": "uint256" }, { - "name": "gasPrice", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "gasPrice", + "type": "uint256" }, { - "name": "estimatedGas", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "estimatedGas", + "type": "uint256" }, { - "name": "receiptBytes", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "receiptBytes", + "type": "uint256" } ], - "anonymous": false + "name": "ReceiptFeeEstimated", + "type": "event" }, { - "name": "TransactionAccepted", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" } ], - "anonymous": false + "name": "TransactionAccepted", + "type": "event" }, { - "name": "TransactionActivated", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "leader", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "leader", + "type": "address" } ], - "anonymous": false + "name": "TransactionActivated", + "type": "event" }, { - "name": "TransactionCancelled", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "cancelledBy", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "cancelledBy", + "type": "address" } ], - "anonymous": false + "name": "TransactionCancelled", + "type": "event" }, { - "name": "TransactionFinalized", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" } ], - "anonymous": false + "name": "TransactionFinalized", + "type": "event" }, { - "name": "TransactionLeaderRevealed", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" } ], - "anonymous": false + "name": "TransactionLeaderRevealed", + "type": "event" }, { - "name": "TransactionLeaderRotated", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "newLeader", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "newLeader", + "type": "address" } ], - "anonymous": false + "name": "TransactionLeaderRotated", + "type": "event" }, { - "name": "TransactionLeaderTimeout", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" } ], - "anonymous": false + "name": "TransactionLeaderTimeout", + "type": "event" }, { - "name": "TransactionNeedsRecomputation", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txIds", - "type": "bytes32[]", "indexed": false, - "internalType": "bytes32[]" + "internalType": "bytes32[]", + "name": "txIds", + "type": "bytes32[]" } ], - "anonymous": false + "name": "TransactionNeedsRecomputation", + "type": "event" }, { - "name": "TransactionReceiptProposed", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "validators", - "type": "address[]", "indexed": false, - "internalType": "address[]" + "internalType": "address[]", + "name": "validators", + "type": "address[]" } ], - "anonymous": false + "name": "TransactionReceiptProposed", + "type": "event" }, { - "name": "TransactionUndetermined", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" } ], - "anonymous": false + "name": "TransactionUndetermined", + "type": "event" }, { - "name": "TribunalAppealVoteCommitted", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "tribunalIndex", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "tribunalIndex", + "type": "uint256" }, { - "name": "validator", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "validator", + "type": "address" } ], - "anonymous": false + "name": "TribunalAppealVoteCommitted", + "type": "event" }, { - "name": "TribunalAppealVoteRevealed", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "tribunalIndex", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "tribunalIndex", + "type": "uint256" }, { - "name": "validator", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "validator", + "type": "address" }, { - "name": "voteType", - "type": "uint8", "indexed": false, - "internalType": "enum ITransactions.VoteType" + "internalType": "enum ITransactions.VoteType", + "name": "voteType", + "type": "uint8" } ], - "anonymous": false + "name": "TribunalAppealVoteRevealed", + "type": "event" }, { - "name": "UnifiedFeesDistributed", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "chunkIndex", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "chunkIndex", + "type": "uint256" }, { - "name": "recipients", - "type": "address[]", "indexed": false, - "internalType": "address[]" + "internalType": "address[]", + "name": "recipients", + "type": "address[]" }, { - "name": "amounts", - "type": "uint256[]", "indexed": false, - "internalType": "uint256[]" + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" } ], - "anonymous": false + "name": "UnifiedFeesDistributed", + "type": "event" }, { - "name": "UserValueRefunded", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "recipient", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "recipient", + "type": "address" }, { - "name": "amount", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "amount", + "type": "uint256" } ], - "anonymous": false + "name": "UserValueRefunded", + "type": "event" }, { - "name": "ValidatorReplaced", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "oldValidator", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "oldValidator", + "type": "address" }, { - "name": "newValidator", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "newValidator", + "type": "address" }, { - "name": "validatorIndex", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "validatorIndex", + "type": "uint256" } ], - "anonymous": false + "name": "ValidatorReplaced", + "type": "event" }, { - "name": "ValueWithdrawalFailed", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "recipient", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "recipient", + "type": "address" }, { - "name": "value", - "type": "uint256", "indexed": false, - "internalType": "uint256" + "internalType": "uint256", + "name": "value", + "type": "uint256" } ], - "anonymous": false + "name": "ValueWithdrawalFailed", + "type": "event" }, { - "name": "VoteCommitted", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "validator", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "validator", + "type": "address" }, { - "name": "isLastVote", - "type": "bool", "indexed": false, - "internalType": "bool" + "internalType": "bool", + "name": "isLastVote", + "type": "bool" } ], - "anonymous": false + "name": "VoteCommitted", + "type": "event" }, { - "name": "VoteRevealed", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "txId", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "txId", + "type": "bytes32" }, { - "name": "validator", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "validator", + "type": "address" }, { - "name": "voteType", - "type": "uint8", "indexed": false, - "internalType": "enum ITransactions.VoteType" + "internalType": "enum ITransactions.VoteType", + "name": "voteType", + "type": "uint8" }, { - "name": "isLastVote", - "type": "bool", "indexed": false, - "internalType": "bool" + "internalType": "bool", + "name": "isLastVote", + "type": "bool" }, { - "name": "result", - "type": "uint8", "indexed": false, - "internalType": "enum ITransactions.ResultType" + "internalType": "enum ITransactions.ResultType", + "name": "result", + "type": "uint8" } ], - "anonymous": false + "name": "VoteRevealed", + "type": "event" }, { - "name": "EVENTS_BATCH_SIZE", - "type": "function", "inputs": [], + "name": "EVENTS_BATCH_SIZE", "outputs": [ { + "internalType": "uint256", "name": "", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "VERSION", - "type": "function", "inputs": [], + "name": "VERSION", "outputs": [ { + "internalType": "string", "name": "", - "type": "string", - "internalType": "string" + "type": "string" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "acceptOwnership", - "type": "function", "inputs": [], + "name": "acceptOwnership", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "activateTransaction", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes", "name": "_vrfProof", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes32", "name": "_expectedAttemptId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "activateTransaction", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "activatorIdleness", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "_expectedAttemptId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "activatorIdleness", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "addTransaction", - "type": "function", "inputs": [ { - "name": "_params", - "type": "tuple", "components": [ { + "internalType": "address", "name": "sender", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "numOfInitialValidators", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "maxRotations", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "validUntil", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "saltNonce", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "userValue", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { - "name": "feesDistribution", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "leaderTimeunitsAllocation", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "validatorTimeunitsAllocation", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "appealRounds", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "executionBudgetPerRound", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "executionConsumed", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "totalMessageFees", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256[]", "name": "rotations", - "type": "uint256[]", - "internalType": "uint256[]" + "type": "uint256[]" }, { + "internalType": "uint256", "name": "maxPriceGenPerTimeUnit", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "storageFeeMaxGasPrice", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "receiptFeeMaxGasPrice", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "internalType": "struct IFeeManager.FeesDistribution" + "internalType": "struct IFeeManager.FeesDistribution", + "name": "feesDistribution", + "type": "tuple" }, { + "internalType": "bytes", "name": "txCalldata", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { - "name": "messageAllocations", - "type": "tuple[]", "components": [ { + "internalType": "enum IMessages.MessageType", "name": "messageType", - "type": "uint8", - "internalType": "enum IMessages.MessageType" + "type": "uint8" }, { + "internalType": "bool", "name": "onAcceptance", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "uint256", "name": "parentIndex", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "bytes32", "name": "callKey", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "budget", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "feeParams", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" } ], - "internalType": "struct IMessages.MessageFeeAllocationNode[]" + "internalType": "struct IMessages.MessageFeeAllocationNode[]", + "name": "messageAllocations", + "type": "tuple[]" } ], - "internalType": "struct IConsensusMainWithFees.AddTransactionParams" + "internalType": "struct IConsensusMainWithFees.AddTransactionParams", + "name": "_params", + "type": "tuple" } ], + "name": "addTransaction", "outputs": [ { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], - "stateMutability": "payable" + "stateMutability": "payable", + "type": "function" }, { - "name": "addressManager", - "type": "function", "inputs": [], + "name": "addressManager", "outputs": [ { + "internalType": "contract IAddressManager", "name": "", - "type": "address", - "internalType": "contract IAddressManager" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "cancelTransaction", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "cancelTransaction", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "commitVote", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "_commitHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "_validatorIndex", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes32", "name": "_expectedAttemptId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "commitVote", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "continueAcceptanceMessages", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "expectedDecisionId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "expectedGeneration", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], + "name": "continueAcceptanceMessages", "outputs": [ { + "internalType": "bool", "name": "complete", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "continueRecomputation", - "type": "function", "inputs": [ { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "continueRecomputation", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "deploySalted", - "type": "function", "inputs": [ { - "name": "_params", - "type": "tuple", "components": [ { + "internalType": "address", "name": "sender", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "numOfInitialValidators", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "maxRotations", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "validUntil", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "saltNonce", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "userValue", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { - "name": "feesDistribution", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "leaderTimeunitsAllocation", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "validatorTimeunitsAllocation", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "appealRounds", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "executionBudgetPerRound", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "executionConsumed", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "totalMessageFees", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256[]", "name": "rotations", - "type": "uint256[]", - "internalType": "uint256[]" + "type": "uint256[]" }, { + "internalType": "uint256", "name": "maxPriceGenPerTimeUnit", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "storageFeeMaxGasPrice", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "receiptFeeMaxGasPrice", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "internalType": "struct IFeeManager.FeesDistribution" + "internalType": "struct IFeeManager.FeesDistribution", + "name": "feesDistribution", + "type": "tuple" }, { + "internalType": "bytes", "name": "txCalldata", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { - "name": "messageAllocations", - "type": "tuple[]", "components": [ { + "internalType": "enum IMessages.MessageType", "name": "messageType", - "type": "uint8", - "internalType": "enum IMessages.MessageType" + "type": "uint8" }, { + "internalType": "bool", "name": "onAcceptance", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "uint256", "name": "parentIndex", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "bytes32", "name": "callKey", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "budget", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "feeParams", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" } ], - "internalType": "struct IMessages.MessageFeeAllocationNode[]" + "internalType": "struct IMessages.MessageFeeAllocationNode[]", + "name": "messageAllocations", + "type": "tuple[]" } ], - "internalType": "struct IConsensusMainWithFees.AddTransactionParams" + "internalType": "struct IConsensusMainWithFees.AddTransactionParams", + "name": "_params", + "type": "tuple" } ], + "name": "deploySalted", "outputs": [], - "stateMutability": "payable" + "stateMutability": "payable", + "type": "function" }, { - "name": "estimateAppealCharge", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "_expectedDecisionId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], + "name": "estimateAppealCharge", "outputs": [ { + "internalType": "uint256", "name": "bond", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "funding", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "executeMessage", - "type": "function", "inputs": [ { + "internalType": "address", "name": "_recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "_value", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "_data", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "uint256", "name": "_gasLimit", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], + "name": "executeMessage", "outputs": [ { + "internalType": "bool", "name": "success", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "finalizeDecisionBatchItem", - "type": "function", "inputs": [ { - "name": "command", - "type": "tuple", "components": [ { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "expectedDecisionId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "internalType": "struct IFinalizationPhase.FinalizeTransactionParams" + "internalType": "struct IFinalizationPhase.FinalizeTransactionParams", + "name": "command", + "type": "tuple" } ], + "name": "finalizeDecisionBatchItem", "outputs": [ { + "internalType": "uint8", "name": "outcome", - "type": "uint8", - "internalType": "uint8" + "type": "uint8" } ], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "finalizeDecisions", - "type": "function", "inputs": [ { - "name": "_commands", - "type": "tuple[]", "components": [ { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "expectedDecisionId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "internalType": "struct IFinalizationPhase.FinalizeTransactionParams[]" + "internalType": "struct IFinalizationPhase.FinalizeTransactionParams[]", + "name": "_commands", + "type": "tuple[]" } ], + "name": "finalizeDecisions", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "finalizeTransaction", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "_expectedDecisionId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], + "name": "finalizeTransaction", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "finalizeTransactionDeferred", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "expectedDecisionId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], + "name": "finalizeTransactionDeferred", "outputs": [], - "stateMutability": "payable" + "stateMutability": "payable", + "type": "function" }, { - "name": "flushExternalMessages", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "flushExternalMessages", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "flushInternalMessages", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "flushInternalMessages", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "getAddressManager", - "type": "function", "inputs": [], + "name": "getAddressManager", "outputs": [ { + "internalType": "contract IAddressManager", "name": "", - "type": "address", - "internalType": "contract IAddressManager" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getPendingTransactionValue", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "getPendingTransactionValue", "outputs": [ { + "internalType": "uint256", "name": "", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "initialize", - "type": "function", "inputs": [ { + "internalType": "address", "name": "_addressManager", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "initialize", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "invalidatePreemptedHead", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "invalidatePreemptedHead", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "isAuthorizedGhostCaller", - "type": "function", "inputs": [ { + "internalType": "address", "name": "caller", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "isAuthorizedGhostCaller", "outputs": [ { + "internalType": "bool", "name": "", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "isGhostContract", - "type": "function", "inputs": [ { + "internalType": "address", "name": "addr", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "isGhostContract", "outputs": [ { + "internalType": "bool", "name": "", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "leaderIdleness", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "_expectedAttemptId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "leaderIdleness", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "leaderRevealVote", - "type": "function", "inputs": [ { - "name": "leaderRevealVoteParams", - "type": "tuple", "components": [ { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "expectedAttemptId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "saltAsAValidator", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes32", "name": "txExecutionHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "messagesAndOtherFieldsHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "otherExecutionFieldsHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "enum ITransactions.VoteType", "name": "resultValue", - "type": "uint8", - "internalType": "enum ITransactions.VoteType" + "type": "uint8" }, { - "name": "messages", - "type": "tuple[]", "components": [ { + "internalType": "enum IMessages.MessageType", "name": "messageType", - "type": "uint8", - "internalType": "enum IMessages.MessageType" + "type": "uint8" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "value", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "data", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bool", "name": "onAcceptance", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "uint256", "name": "saltNonce", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "feeParams", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "uint256", "name": "declaredBudget", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "allocationSubtree", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes32", "name": "callKey", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bool", "name": "useBalance", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "internalType": "struct IMessages.SubmittedMessage[]" + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" } ], - "internalType": "struct IConsensusMainWithFees.LeaderRevealVoteParams" + "internalType": "struct IConsensusMainWithFees.LeaderRevealVoteParams", + "name": "leaderRevealVoteParams", + "type": "tuple" } ], + "name": "leaderRevealVote", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "owner", - "type": "function", "inputs": [], + "name": "owner", "outputs": [ { + "internalType": "address", "name": "", - "type": "address", - "internalType": "address" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "pendingOwner", - "type": "function", "inputs": [], + "name": "pendingOwner", "outputs": [ { + "internalType": "address", "name": "", - "type": "address", - "internalType": "address" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "processIdleness", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "_expectedAttemptId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "processIdleness", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "promoteNextPendingTransactions", - "type": "function", "inputs": [ { + "internalType": "address[]", "name": "recipients", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" } ], + "name": "promoteNextPendingTransactions", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "proposeReceipt", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "address", "name": "", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "bytes", "name": "", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes", "name": "", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" } ], + "name": "proposeReceipt", "outputs": [], - "stateMutability": "pure" + "stateMutability": "pure", + "type": "function" }, { - "name": "proposeReceipt", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "_txExecutionHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "_processingBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "_storageFeeUsed", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "_eqBlocksOutputs", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes", "name": "_vrfProof", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes32", "name": "_expectedAttemptId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "proposeReceipt", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "proposeReceipt", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "_txExecutionHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "_processingBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "_eqBlocksOutputs", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes", "name": "_vrfProof", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes32", "name": "_expectedAttemptId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "proposeReceipt", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "proposeReceiptWithMessageEnvelope", - "type": "function", "inputs": [ { - "name": "p", - "type": "tuple", "components": [ { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "txExecutionHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "processingBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "storageFeeUsed", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "eqBlocksOutputs", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes", "name": "vrfProof", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "uint256", "name": "reportedMessageFeesTotal", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes32", "name": "expectedAttemptId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "messageBytes", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "messageCount", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "internalType": "struct IConsensusMainWithFees.MessageEnvelopeProposal" + "internalType": "struct IConsensusMainWithFees.MessageEnvelopeProposal", + "name": "p", + "type": "tuple" } ], + "name": "proposeReceiptWithMessageEnvelope", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "proposeReceiptWithMessages", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes", "name": "", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "uint256", "name": "reportedTotal", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes32", "name": "", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "proposeReceiptWithMessages", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "protocolComponentId", - "type": "function", "inputs": [], + "name": "protocolComponentId", "outputs": [ { + "internalType": "bytes32", "name": "", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], - "stateMutability": "pure" + "stateMutability": "pure", + "type": "function" }, { - "name": "registerGhostContract", - "type": "function", "inputs": [ { + "internalType": "address", "name": "ghost", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "registerGhostContract", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "renounceOwnership", - "type": "function", "inputs": [], + "name": "renounceOwnership", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "resolveTransactionBatchItem", - "type": "function", "inputs": [ { - "name": "command", - "type": "tuple", "components": [ { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "expectedAttemptId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], - "internalType": "struct IIdlenessPhase.ProcessIdlenessParams" + "internalType": "struct IIdlenessPhase.ProcessIdlenessParams", + "name": "command", + "type": "tuple" } ], + "name": "resolveTransactionBatchItem", "outputs": [ { + "internalType": "uint8", "name": "outcome", - "type": "uint8", - "internalType": "uint8" + "type": "uint8" } ], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "resolveTransactions", - "type": "function", "inputs": [ { - "name": "_commands", - "type": "tuple[]", "components": [ { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "expectedAttemptId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], - "internalType": "struct IIdlenessPhase.ProcessIdlenessParams[]" + "internalType": "struct IIdlenessPhase.ProcessIdlenessParams[]", + "name": "_commands", + "type": "tuple[]" } ], + "name": "resolveTransactions", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "retryFinalizationPromotion", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "retryFinalizationPromotion", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "revealVote", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "_voteHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "enum ITransactions.VoteType", "name": "_voteType", - "type": "uint8", - "internalType": "enum ITransactions.VoteType" + "type": "uint8" }, { + "internalType": "bytes32", "name": "_otherExecutionFieldsHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "_nonce", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "_validatorIndex", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes32", "name": "_expectedAttemptId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "revealVote", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "setAddressManager", - "type": "function", "inputs": [ { + "internalType": "address", "name": "_addressManager", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "setAddressManager", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "submitAppeal", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "_expectedDecisionId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], + "name": "submitAppeal", "outputs": [], - "stateMutability": "payable" + "stateMutability": "payable", + "type": "function" }, { - "name": "topUpAndProgressFinalization", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "_expectedDecisionId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], + "name": "topUpAndProgressFinalization", "outputs": [ { + "internalType": "bool", "name": "finalized", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "stateMutability": "payable" + "stateMutability": "payable", + "type": "function" }, { - "name": "topUpAndSubmitAppeal", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "_expectedDecisionId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { - "name": "", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "leaderTimeunitsAllocation", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "validatorTimeunitsAllocation", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "appealRounds", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "executionBudgetPerRound", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "executionConsumed", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "totalMessageFees", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256[]", "name": "rotations", - "type": "uint256[]", - "internalType": "uint256[]" + "type": "uint256[]" }, { + "internalType": "uint256", "name": "maxPriceGenPerTimeUnit", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "storageFeeMaxGasPrice", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "receiptFeeMaxGasPrice", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "internalType": "struct IFeeManager.FeesDistribution" + "internalType": "struct IFeeManager.FeesDistribution", + "name": "", + "type": "tuple" } ], + "name": "topUpAndSubmitAppeal", "outputs": [], - "stateMutability": "payable" + "stateMutability": "payable", + "type": "function" }, { - "name": "topUpFees", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { - "name": "_feesDistribution", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "leaderTimeunitsAllocation", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "validatorTimeunitsAllocation", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "appealRounds", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "executionBudgetPerRound", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "executionConsumed", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "totalMessageFees", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256[]", "name": "rotations", - "type": "uint256[]", - "internalType": "uint256[]" + "type": "uint256[]" }, { + "internalType": "uint256", "name": "maxPriceGenPerTimeUnit", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "storageFeeMaxGasPrice", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "receiptFeeMaxGasPrice", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "internalType": "struct IFeeManager.FeesDistribution" + "internalType": "struct IFeeManager.FeesDistribution", + "name": "_feesDistribution", + "type": "tuple" } ], + "name": "topUpFees", "outputs": [], - "stateMutability": "payable" + "stateMutability": "payable", + "type": "function" }, { - "name": "transferEthOnBehalf", - "type": "function", "inputs": [ { + "internalType": "address", "name": "to", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "amount", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], + "name": "transferEthOnBehalf", "outputs": [ { + "internalType": "bool", "name": "success", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "transferOwnership", - "type": "function", "inputs": [ { + "internalType": "address", "name": "newOwner", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "transferOwnership", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "type": "receive", - "stateMutability": "payable" + "stateMutability": "payable", + "type": "receive" } ], bytecode: "", @@ -2844,2632 +2702,2632 @@ const CONSENSUS_DATA_CONTRACT = { address: "0xc5FA6f82BEe53598825d6edf7E3e24613082c75B" as Address, abi: [ { - "type": "constructor", "inputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "constructor" }, { + "inputs": [], "name": "AccessControlBadConfirmation", - "type": "error", - "inputs": [] + "type": "error" }, { - "name": "AccessControlUnauthorizedAccount", - "type": "error", "inputs": [ { + "internalType": "address", "name": "account", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "bytes32", "name": "neededRole", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } - ] + ], + "name": "AccessControlUnauthorizedAccount", + "type": "error" }, { + "inputs": [], "name": "InvalidInitialization", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "InvalidRegistry", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "InvalidTransactionStatus", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "NotInitializing", - "type": "error", - "inputs": [] + "type": "error" }, { - "name": "OwnableInvalidOwner", - "type": "error", "inputs": [ { + "internalType": "address", "name": "owner", - "type": "address", - "internalType": "address" + "type": "address" } - ] + ], + "name": "OwnableInvalidOwner", + "type": "error" }, { - "name": "OwnableUnauthorizedAccount", - "type": "error", "inputs": [ { + "internalType": "address", "name": "account", - "type": "address", - "internalType": "address" + "type": "address" } - ] + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" }, { - "name": "PhaseDeadlineNotInitialized", - "type": "error", "inputs": [ { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint8", "name": "status", - "type": "uint8", - "internalType": "uint8" + "type": "uint8" } - ] + ], + "name": "PhaseDeadlineNotInitialized", + "type": "error" }, { + "inputs": [], "name": "ReentrancyGuardReentrantCall", - "type": "error", - "inputs": [] + "type": "error" }, { + "inputs": [], "name": "RegistryBindingLocked", - "type": "error", - "inputs": [] + "type": "error" }, { - "name": "Initialized", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "version", - "type": "uint64", "indexed": false, - "internalType": "uint64" + "internalType": "uint64", + "name": "version", + "type": "uint64" } ], - "anonymous": false + "name": "Initialized", + "type": "event" }, { - "name": "OwnershipTransferStarted", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "previousOwner", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "previousOwner", + "type": "address" }, { - "name": "newOwner", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "newOwner", + "type": "address" } ], - "anonymous": false + "name": "OwnershipTransferStarted", + "type": "event" }, { - "name": "OwnershipTransferred", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "previousOwner", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "previousOwner", + "type": "address" }, { - "name": "newOwner", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "newOwner", + "type": "address" } ], - "anonymous": false + "name": "OwnershipTransferred", + "type": "event" }, { - "name": "RoleAdminChanged", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "role", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "role", + "type": "bytes32" }, { - "name": "previousAdminRole", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" }, { - "name": "newAdminRole", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" } ], - "anonymous": false + "name": "RoleAdminChanged", + "type": "event" }, { - "name": "RoleGranted", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "role", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "role", + "type": "bytes32" }, { - "name": "account", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "account", + "type": "address" }, { - "name": "sender", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "sender", + "type": "address" } ], - "anonymous": false + "name": "RoleGranted", + "type": "event" }, { - "name": "RoleRevoked", - "type": "event", + "anonymous": false, "inputs": [ { - "name": "role", - "type": "bytes32", "indexed": true, - "internalType": "bytes32" + "internalType": "bytes32", + "name": "role", + "type": "bytes32" }, { - "name": "account", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "account", + "type": "address" }, { - "name": "sender", - "type": "address", "indexed": true, - "internalType": "address" + "internalType": "address", + "name": "sender", + "type": "address" } ], - "anonymous": false + "name": "RoleRevoked", + "type": "event" }, { - "name": "DEFAULT_ADMIN_ROLE", - "type": "function", "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", "outputs": [ { + "internalType": "bytes32", "name": "", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "acceptOwnership", - "type": "function", "inputs": [], + "name": "acceptOwnership", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "addressManager", - "type": "function", "inputs": [], + "name": "addressManager", "outputs": [ { + "internalType": "contract IAddressManager", "name": "", - "type": "address", - "internalType": "contract IAddressManager" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "canFinalize", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "_currentTimestamp", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "_expectedDecisionId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], + "name": "canFinalize", "outputs": [ { + "internalType": "bool", "name": "ready", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "uint256", "name": "evaluatedAt", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "appealDeadline", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "estimateAppealBond", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "estimateAppealBond", "outputs": [ { + "internalType": "uint256", "name": "", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "estimateLatestAppealCharge", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "estimateLatestAppealCharge", "outputs": [ { + "internalType": "uint256", "name": "decisionId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "bond", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "funding", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "appealDeadline", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getCurrentActivator", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "getCurrentActivator", "outputs": [ { + "internalType": "address", "name": "newActivator", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "bool", "name": "activatorIsIdle", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "uint256", "name": "slots", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "secondsUntilNextBoundary", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "enum ITransactions.TransactionStatus", "name": "currentStatus", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" + "type": "uint8" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getCurrentLeader", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "getCurrentLeader", "outputs": [ { + "internalType": "address", "name": "newLeader", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "bool", "name": "leaderIsIdle", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "uint256", "name": "slots", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "secondsUntilNextBoundary", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "enum ITransactions.TransactionStatus", "name": "currentStatus", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" + "type": "uint8" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getCurrentValidators", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "getCurrentValidators", "outputs": [ { + "internalType": "address[]", "name": "validators", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" }, { + "internalType": "uint256", "name": "leaderIndex", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256[]", "name": "idleIndexes", - "type": "uint256[]", - "internalType": "uint256[]" + "type": "uint256[]" }, { + "internalType": "bool", "name": "leaderIsIdle", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "uint256", "name": "slots", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "secondsUntilNextBoundary", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "enum ITransactions.TransactionStatus", "name": "currentStatus", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" + "type": "uint8" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getLatestAcceptedTransaction", - "type": "function", "inputs": [ { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "getLatestAcceptedTransaction", "outputs": [ { - "name": "inputData", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "observedAt", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "address", "name": "sender", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "initialRotations", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "txSlot", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "createdTimestamp", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "lastVoteTimestamp", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes32", "name": "randomSeed", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" + "type": "uint8" }, { + "internalType": "bytes32", "name": "txExecutionHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes", "name": "txCalldata", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes", "name": "eqBlocksOutputs", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { - "name": "messages", - "type": "tuple[]", "components": [ { + "internalType": "enum IMessages.MessageType", "name": "messageType", - "type": "uint8", - "internalType": "enum IMessages.MessageType" + "type": "uint8" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "value", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "data", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bool", "name": "onAcceptance", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "uint256", "name": "saltNonce", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "feeParams", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "uint256", "name": "declaredBudget", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "allocationSubtree", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes32", "name": "callKey", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bool", "name": "useBalance", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "internalType": "struct IMessages.SubmittedMessage[]" + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" }, { + "internalType": "enum IQueues.QueueType", "name": "queueType", - "type": "uint8", - "internalType": "enum IQueues.QueueType" + "type": "uint8" }, { + "internalType": "uint256", "name": "queuePosition", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "address", "name": "activator", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "lastLeader", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "enum ITransactions.TransactionStatus", "name": "status", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" + "type": "uint8" }, { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { - "name": "readStateBlockRange", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "activationBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "processingBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "proposalBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "internalType": "struct ITransactions.ReadStateBlockRange" + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" }, { + "internalType": "uint256", "name": "numOfRounds", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { - "name": "lastRound", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "round", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "leaderIndex", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "votesCommitted", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "votesRevealed", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "appealBond", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "rotationsLeft", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" + "type": "uint8" }, { + "internalType": "address[]", "name": "roundValidators", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" }, { + "internalType": "enum ITransactions.VoteType[]", "name": "validatorVotes", - "type": "uint8[]", - "internalType": "enum ITransactions.VoteType[]" + "type": "uint8[]" }, { + "internalType": "bytes32[]", "name": "validatorVotesHash", - "type": "bytes32[]", - "internalType": "bytes32[]" + "type": "bytes32[]" }, { + "internalType": "bytes32[]", "name": "validatorResultHash", - "type": "bytes32[]", - "internalType": "bytes32[]" + "type": "bytes32[]" } ], - "internalType": "struct ITransactions.RoundData" + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" }, { + "internalType": "address[]", "name": "consumedValidators", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" } ], - "internalType": "struct ConsensusData.TransactionData" + "internalType": "struct ConsensusData.TransactionData", + "name": "inputData", + "type": "tuple" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getLatestAcceptedTransactions", - "type": "function", "inputs": [ { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "startIndex", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "pageSize", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], + "name": "getLatestAcceptedTransactions", "outputs": [ { - "name": "", - "type": "tuple[]", "components": [ { + "internalType": "uint256", "name": "observedAt", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "address", "name": "sender", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "initialRotations", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "txSlot", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "createdTimestamp", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "lastVoteTimestamp", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes32", "name": "randomSeed", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" + "type": "uint8" }, { + "internalType": "bytes32", "name": "txExecutionHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes", "name": "txCalldata", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes", "name": "eqBlocksOutputs", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { - "name": "messages", - "type": "tuple[]", "components": [ { + "internalType": "enum IMessages.MessageType", "name": "messageType", - "type": "uint8", - "internalType": "enum IMessages.MessageType" + "type": "uint8" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "value", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "data", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bool", "name": "onAcceptance", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "uint256", "name": "saltNonce", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "feeParams", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "uint256", "name": "declaredBudget", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "allocationSubtree", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes32", "name": "callKey", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bool", "name": "useBalance", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "internalType": "struct IMessages.SubmittedMessage[]" + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" }, { + "internalType": "enum IQueues.QueueType", "name": "queueType", - "type": "uint8", - "internalType": "enum IQueues.QueueType" + "type": "uint8" }, { + "internalType": "uint256", "name": "queuePosition", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "address", "name": "activator", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "lastLeader", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "enum ITransactions.TransactionStatus", "name": "status", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" + "type": "uint8" }, { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { - "name": "readStateBlockRange", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "activationBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "processingBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "proposalBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "internalType": "struct ITransactions.ReadStateBlockRange" + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" }, { + "internalType": "uint256", "name": "numOfRounds", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { - "name": "lastRound", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "round", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "leaderIndex", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "votesCommitted", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "votesRevealed", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "appealBond", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "rotationsLeft", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" + "type": "uint8" }, { + "internalType": "address[]", "name": "roundValidators", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" }, { + "internalType": "enum ITransactions.VoteType[]", "name": "validatorVotes", - "type": "uint8[]", - "internalType": "enum ITransactions.VoteType[]" + "type": "uint8[]" }, { + "internalType": "bytes32[]", "name": "validatorVotesHash", - "type": "bytes32[]", - "internalType": "bytes32[]" + "type": "bytes32[]" }, { + "internalType": "bytes32[]", "name": "validatorResultHash", - "type": "bytes32[]", - "internalType": "bytes32[]" + "type": "bytes32[]" } ], - "internalType": "struct ITransactions.RoundData" + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" }, { + "internalType": "address[]", "name": "consumedValidators", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" } ], - "internalType": "struct ConsensusData.TransactionData[]" + "internalType": "struct ConsensusData.TransactionData[]", + "name": "", + "type": "tuple[]" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getLatestAcceptedTxCount", - "type": "function", "inputs": [ { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "getLatestAcceptedTxCount", "outputs": [ { + "internalType": "uint256", "name": "", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getLatestFinalizedTransaction", - "type": "function", "inputs": [ { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "getLatestFinalizedTransaction", "outputs": [ { - "name": "inputData", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "observedAt", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "address", "name": "sender", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "initialRotations", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "txSlot", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "createdTimestamp", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "lastVoteTimestamp", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes32", "name": "randomSeed", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" + "type": "uint8" }, { + "internalType": "bytes32", "name": "txExecutionHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes", "name": "txCalldata", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes", "name": "eqBlocksOutputs", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { - "name": "messages", - "type": "tuple[]", "components": [ { + "internalType": "enum IMessages.MessageType", "name": "messageType", - "type": "uint8", - "internalType": "enum IMessages.MessageType" + "type": "uint8" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "value", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "data", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bool", "name": "onAcceptance", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "uint256", "name": "saltNonce", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "feeParams", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "uint256", "name": "declaredBudget", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "allocationSubtree", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes32", "name": "callKey", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bool", "name": "useBalance", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "internalType": "struct IMessages.SubmittedMessage[]" + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" }, { + "internalType": "enum IQueues.QueueType", "name": "queueType", - "type": "uint8", - "internalType": "enum IQueues.QueueType" + "type": "uint8" }, { + "internalType": "uint256", "name": "queuePosition", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "address", "name": "activator", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "lastLeader", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "enum ITransactions.TransactionStatus", "name": "status", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" + "type": "uint8" }, { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { - "name": "readStateBlockRange", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "activationBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "processingBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "proposalBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "internalType": "struct ITransactions.ReadStateBlockRange" + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" }, { + "internalType": "uint256", "name": "numOfRounds", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { - "name": "lastRound", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "round", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "leaderIndex", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "votesCommitted", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "votesRevealed", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "appealBond", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "rotationsLeft", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" + "type": "uint8" }, { + "internalType": "address[]", "name": "roundValidators", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" }, { + "internalType": "enum ITransactions.VoteType[]", "name": "validatorVotes", - "type": "uint8[]", - "internalType": "enum ITransactions.VoteType[]" + "type": "uint8[]" }, { + "internalType": "bytes32[]", "name": "validatorVotesHash", - "type": "bytes32[]", - "internalType": "bytes32[]" + "type": "bytes32[]" }, { + "internalType": "bytes32[]", "name": "validatorResultHash", - "type": "bytes32[]", - "internalType": "bytes32[]" + "type": "bytes32[]" } ], - "internalType": "struct ITransactions.RoundData" + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" }, { + "internalType": "address[]", "name": "consumedValidators", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" } ], - "internalType": "struct ConsensusData.TransactionData" + "internalType": "struct ConsensusData.TransactionData", + "name": "inputData", + "type": "tuple" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getLatestFinalizedTransactions", - "type": "function", "inputs": [ { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "startIndex", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "pageSize", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], + "name": "getLatestFinalizedTransactions", "outputs": [ { - "name": "", - "type": "tuple[]", "components": [ { + "internalType": "uint256", "name": "observedAt", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "address", "name": "sender", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "initialRotations", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "txSlot", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "createdTimestamp", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "lastVoteTimestamp", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes32", "name": "randomSeed", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" + "type": "uint8" }, { + "internalType": "bytes32", "name": "txExecutionHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes", "name": "txCalldata", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes", "name": "eqBlocksOutputs", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { - "name": "messages", - "type": "tuple[]", "components": [ { + "internalType": "enum IMessages.MessageType", "name": "messageType", - "type": "uint8", - "internalType": "enum IMessages.MessageType" + "type": "uint8" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "value", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "data", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bool", "name": "onAcceptance", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "uint256", "name": "saltNonce", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "feeParams", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "uint256", "name": "declaredBudget", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "allocationSubtree", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes32", "name": "callKey", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bool", "name": "useBalance", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "internalType": "struct IMessages.SubmittedMessage[]" + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" }, { + "internalType": "enum IQueues.QueueType", "name": "queueType", - "type": "uint8", - "internalType": "enum IQueues.QueueType" + "type": "uint8" }, { + "internalType": "uint256", "name": "queuePosition", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "address", "name": "activator", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "lastLeader", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "enum ITransactions.TransactionStatus", "name": "status", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" + "type": "uint8" }, { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { - "name": "readStateBlockRange", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "activationBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "processingBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "proposalBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "internalType": "struct ITransactions.ReadStateBlockRange" + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" }, { + "internalType": "uint256", "name": "numOfRounds", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { - "name": "lastRound", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "round", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "leaderIndex", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "votesCommitted", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "votesRevealed", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "appealBond", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "rotationsLeft", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" + "type": "uint8" }, { + "internalType": "address[]", "name": "roundValidators", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" }, { + "internalType": "enum ITransactions.VoteType[]", "name": "validatorVotes", - "type": "uint8[]", - "internalType": "enum ITransactions.VoteType[]" + "type": "uint8[]" }, { + "internalType": "bytes32[]", "name": "validatorVotesHash", - "type": "bytes32[]", - "internalType": "bytes32[]" + "type": "bytes32[]" }, { + "internalType": "bytes32[]", "name": "validatorResultHash", - "type": "bytes32[]", - "internalType": "bytes32[]" + "type": "bytes32[]" } ], - "internalType": "struct ITransactions.RoundData" + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" }, { + "internalType": "address[]", "name": "consumedValidators", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" } ], - "internalType": "struct ConsensusData.TransactionData[]" + "internalType": "struct ConsensusData.TransactionData[]", + "name": "", + "type": "tuple[]" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getLatestFinalizedTxCount", - "type": "function", "inputs": [ { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "getLatestFinalizedTxCount", "outputs": [ { + "internalType": "uint256", "name": "", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getRoleAdmin", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "role", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "getRoleAdmin", "outputs": [ { + "internalType": "bytes32", "name": "", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getStoredTransactionData", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "getStoredTransactionData", "outputs": [ { - "name": "", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "observedAt", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "address", "name": "sender", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "initialRotations", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "txSlot", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "createdTimestamp", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "lastVoteTimestamp", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes32", "name": "randomSeed", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" + "type": "uint8" }, { + "internalType": "bytes32", "name": "txExecutionHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes", "name": "txCalldata", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes", "name": "eqBlocksOutputs", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { - "name": "messages", - "type": "tuple[]", "components": [ { + "internalType": "enum IMessages.MessageType", "name": "messageType", - "type": "uint8", - "internalType": "enum IMessages.MessageType" + "type": "uint8" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "value", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "data", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bool", "name": "onAcceptance", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "uint256", "name": "saltNonce", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "feeParams", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "uint256", "name": "declaredBudget", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "allocationSubtree", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes32", "name": "callKey", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bool", "name": "useBalance", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "internalType": "struct IMessages.SubmittedMessage[]" + "internalType": "struct IMessages.SubmittedMessage[]", + "name": "messages", + "type": "tuple[]" }, { + "internalType": "enum IQueues.QueueType", "name": "queueType", - "type": "uint8", - "internalType": "enum IQueues.QueueType" + "type": "uint8" }, { + "internalType": "uint256", "name": "queuePosition", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "address", "name": "activator", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "lastLeader", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "enum ITransactions.TransactionStatus", "name": "status", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" + "type": "uint8" }, { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { - "name": "readStateBlockRange", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "activationBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "processingBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "proposalBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "internalType": "struct ITransactions.ReadStateBlockRange" + "internalType": "struct ITransactions.ReadStateBlockRange", + "name": "readStateBlockRange", + "type": "tuple" }, { + "internalType": "uint256", "name": "numOfRounds", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { - "name": "lastRound", - "type": "tuple", "components": [ { + "internalType": "uint256", "name": "round", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "leaderIndex", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "votesCommitted", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "votesRevealed", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "appealBond", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "rotationsLeft", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" + "type": "uint8" }, { + "internalType": "address[]", "name": "roundValidators", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" }, { + "internalType": "enum ITransactions.VoteType[]", "name": "validatorVotes", - "type": "uint8[]", - "internalType": "enum ITransactions.VoteType[]" + "type": "uint8[]" }, { + "internalType": "bytes32[]", "name": "validatorVotesHash", - "type": "bytes32[]", - "internalType": "bytes32[]" + "type": "bytes32[]" }, { + "internalType": "bytes32[]", "name": "validatorResultHash", - "type": "bytes32[]", - "internalType": "bytes32[]" + "type": "bytes32[]" } ], - "internalType": "struct ITransactions.RoundData" + "internalType": "struct ITransactions.RoundData", + "name": "lastRound", + "type": "tuple" }, { + "internalType": "address[]", "name": "consumedValidators", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" } ], - "internalType": "struct ConsensusData.TransactionData" + "internalType": "struct ConsensusData.TransactionData", + "name": "", + "type": "tuple" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getStoredTransactionStatus", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "getStoredTransactionStatus", "outputs": [ { + "internalType": "enum ITransactions.TransactionStatus", "name": "", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" + "type": "uint8" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getTransactionAllData", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "getTransactionAllData", "outputs": [ { - "name": "transaction", - "type": "tuple", "components": [ { + "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" + "type": "uint8" }, { + "internalType": "enum ITransactions.VoteType", "name": "txExecutionResult", - "type": "uint8", - "internalType": "enum ITransactions.VoteType" + "type": "uint8" }, { + "internalType": "enum ITransactions.TransactionStatus", "name": "status", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" + "type": "uint8" }, { + "internalType": "address", "name": "txOrigin", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "sender", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "activator", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "txSlot", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "initialRotations", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "numOfInitialValidators", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "epoch", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes32", "name": "id", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "randomSeed", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "txExecutionHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "resultHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes", "name": "txCalldata", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "bytes", "name": "eqBlocksOutputs", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { - "name": "readStateBlockRanges", - "type": "tuple[]", "components": [ { + "internalType": "uint256", "name": "activationBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "processingBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "proposalBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "internalType": "struct ITransactions.ReadStateBlockRange[]" + "internalType": "struct ITransactions.ReadStateBlockRange[]", + "name": "readStateBlockRanges", + "type": "tuple[]" }, { + "internalType": "uint256", "name": "validUntil", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "value", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "lockedStorageUnitPrice", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "storageFeeUsed", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "lockedReceiptGasPrice", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "address", "name": "txSigner", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "enum ITransactions.QueueContext", "name": "queueContext", - "type": "uint8", - "internalType": "enum ITransactions.QueueContext" + "type": "uint8" } ], - "internalType": "struct ITransactions.Transaction" + "internalType": "struct ITransactions.Transaction", + "name": "transaction", + "type": "tuple" }, { - "name": "roundsData", - "type": "tuple[]", "components": [ { + "internalType": "uint256", "name": "round", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "leaderIndex", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "votesCommitted", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "votesRevealed", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "appealBond", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "rotationsLeft", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" + "type": "uint8" }, { + "internalType": "address[]", "name": "roundValidators", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" }, { + "internalType": "enum ITransactions.VoteType[]", "name": "validatorVotes", - "type": "uint8[]", - "internalType": "enum ITransactions.VoteType[]" + "type": "uint8[]" }, { + "internalType": "bytes32[]", "name": "validatorVotesHash", - "type": "bytes32[]", - "internalType": "bytes32[]" + "type": "bytes32[]" }, { + "internalType": "bytes32[]", "name": "validatorResultHash", - "type": "bytes32[]", - "internalType": "bytes32[]" + "type": "bytes32[]" } ], - "internalType": "struct ITransactions.RoundData[]" + "internalType": "struct ITransactions.RoundData[]", + "name": "roundsData", + "type": "tuple[]" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getTransactionLifecycle", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "_timestamp", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], + "name": "getTransactionLifecycle", "outputs": [ { - "name": "lifecycle", - "type": "tuple", "components": [ { + "internalType": "enum ITransactions.TransactionStatus", "name": "storedStatus", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" + "type": "uint8" }, { - "name": "resolution", - "type": "tuple", "components": [ { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "enum ITransactions.TransactionStatus", "name": "storedStatus", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" + "type": "uint8" }, { + "internalType": "enum ITransactions.TransactionStatus", "name": "projectedStatus", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" + "type": "uint8" }, { + "internalType": "enum IIdlenessPhase.ResolutionAction", "name": "action", - "type": "uint8", - "internalType": "enum IIdlenessPhase.ResolutionAction" + "type": "uint8" }, { + "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" + "type": "uint8" }, { + "internalType": "bytes32", "name": "resultHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "enum ITransactionManager.ResolutionSource", "name": "source", - "type": "uint8", - "internalType": "enum ITransactionManager.ResolutionSource" + "type": "uint8" }, { + "internalType": "uint256", "name": "sourceRound", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "sourceGeneration", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes32", "name": "sourceRoundContextHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "roundPlanHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "resultRound", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "resultGeneration", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "basisDecisionId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "enum ITransactionManager.ResolutionContext", "name": "context", - "type": "uint8", - "internalType": "enum ITransactionManager.ResolutionContext" + "type": "uint8" }, { + "internalType": "bytes32", "name": "attemptId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "boundaryAt", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "evaluatedAt", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "snapshotBlock", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "decisionWindow", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "appealDeadline", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bool", "name": "materializesDecision", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "bool", "name": "actionOutcomeDeterministic", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "bool", "name": "nonCurrentEvaluation", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "internalType": "struct IIdlenessPhase.ResolutionPlan" + "internalType": "struct IIdlenessPhase.ResolutionPlan", + "name": "resolution", + "type": "tuple" }, { - "name": "latestDecision", - "type": "tuple", "components": [ { + "internalType": "bool", "name": "exists", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "uint256", "name": "decisionId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "basisDecisionId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "enum ITransactionManager.ResolutionContext", "name": "context", - "type": "uint8", - "internalType": "enum ITransactionManager.ResolutionContext" + "type": "uint8" }, { + "internalType": "enum ITransactionManager.ResolutionSource", "name": "source", - "type": "uint8", - "internalType": "enum ITransactionManager.ResolutionSource" + "type": "uint8" }, { + "internalType": "bytes32", "name": "sourceAttemptId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "enum ITransactions.TransactionStatus", "name": "sourceStatus", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" + "type": "uint8" }, { + "internalType": "enum ITransactions.TransactionStatus", "name": "status", - "type": "uint8", - "internalType": "enum ITransactions.TransactionStatus" + "type": "uint8" }, { + "internalType": "uint256", "name": "sourceRound", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "sourceGeneration", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes32", "name": "sourceRoundContextHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "bytes32", "name": "roundPlanHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "resultRound", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "resultGeneration", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "enum ITransactions.ResultType", "name": "result", - "type": "uint8", - "internalType": "enum ITransactions.ResultType" + "type": "uint8" }, { + "internalType": "bytes32", "name": "resultHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "effectiveAt", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "materializedAt", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256", "name": "appealDeadline", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "internalType": "struct ITransactionManager.DecisionRecord" + "internalType": "struct ITransactionManager.DecisionRecord", + "name": "latestDecision", + "type": "tuple" }, { + "internalType": "bool", "name": "decisionActive", - "type": "bool", - "internalType": "bool" + "type": "bool" }, { + "internalType": "uint256", "name": "executionGeneration", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "internalType": "struct ConsensusData.TransactionLifecycle" + "internalType": "struct ConsensusData.TransactionLifecycle", + "name": "lifecycle", + "type": "tuple" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "getValidatorsForLastRound", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "_txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], + "name": "getValidatorsForLastRound", "outputs": [ { + "internalType": "address[]", "name": "validators", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "grantRole", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "role", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "address", "name": "account", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "grantRole", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "hasRole", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "role", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "address", "name": "account", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "hasRole", "outputs": [ { + "internalType": "bool", "name": "", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "initialize", - "type": "function", "inputs": [ { + "internalType": "address", "name": "_addressManager", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "initialize", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "isRoundValidator", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "txId", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "uint256", "name": "round", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "address", "name": "validator", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "isRoundValidator", "outputs": [ { + "internalType": "bool", "name": "", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "owner", - "type": "function", "inputs": [], + "name": "owner", "outputs": [ { + "internalType": "address", "name": "", - "type": "address", - "internalType": "address" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "pendingOwner", - "type": "function", "inputs": [], + "name": "pendingOwner", "outputs": [ { + "internalType": "address", "name": "", - "type": "address", - "internalType": "address" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "protocolComponentId", - "type": "function", "inputs": [], + "name": "protocolComponentId", "outputs": [ { + "internalType": "bytes32", "name": "", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], - "stateMutability": "pure" + "stateMutability": "pure", + "type": "function" }, { - "name": "renounceOwnership", - "type": "function", "inputs": [], + "name": "renounceOwnership", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "renounceRole", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "role", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "address", "name": "callerConfirmation", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "renounceRole", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "revokeRole", - "type": "function", "inputs": [ { + "internalType": "bytes32", "name": "role", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "address", "name": "account", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "revokeRole", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "setAddressManager", - "type": "function", "inputs": [ { + "internalType": "address", "name": "_addressManager", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "setAddressManager", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "name": "supportsInterface", - "type": "function", "inputs": [ { + "internalType": "bytes4", "name": "interfaceId", - "type": "bytes4", - "internalType": "bytes4" + "type": "bytes4" } ], + "name": "supportsInterface", "outputs": [ { + "internalType": "bool", "name": "", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "name": "transferOwnership", - "type": "function", "inputs": [ { + "internalType": "address", "name": "newOwner", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "transferOwnership", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" } ], bytecode: "", @@ -5478,8 +5336,6 @@ const CONSENSUS_DATA_CONTRACT = { export const testnetBradbury: GenLayerChain = defineChain({ id: 0x107d, isStudio: false, - genesisHash: "0x17d89764d4f4f963158fc4c5e8f2cb670c2837740b35f37081c12860c3df97e4", - addressManager: "0x3F71AE080BD6270A91dBcc7960d88797828538E0", name: "Genlayer Bradbury Testnet", rpcUrls: { default: { diff --git a/src/client/client.ts b/src/client/client.ts index 4e2f61a..14ef790 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -18,7 +18,6 @@ import {stakingActions} from "../staking/actions"; import {vestingActions} from "../vesting/actions"; import {GenLayerClient, GenLayerChain} from "@/types"; import {chainActions} from "@/chains/actions"; -import {assertNetworkIdentity} from "./networkIdentity"; import {localnet} from "@/chains"; // Define the configuration interface for the client @@ -62,7 +61,7 @@ const assertChainMatch = async ( const currentId = parseInt(currentChainId as string, 16); throw new Error( `Wallet is on chain ${currentId} but client is configured for chain ${chainConfig.id} (${chainConfig.name}). ` + - `Call client.connect("${chainConfig.name}") or switch your wallet to the correct network before sending transactions.`, + `Call client.connect("${chainConfig.name}") or switch your wallet to the correct network before sending transactions.`, ); } } catch (err) { @@ -73,54 +72,14 @@ const assertChainMatch = async ( const getCustomTransportConfig = (config: ClientConfig, chainConfig: GenLayerChain) => { const isAddress = typeof config.account !== "object"; - const rpc = async ({method, params = []}: {method: string; params?: any[]}) => { - const retryable = - /^(eth_get\w+|eth_call|eth_chainId|eth_blockNumber|eth_gasPrice|eth_estimateGas|net_version)$/.test( - method, - ); - for (let attempt = 0; ; attempt++) { - const response = await fetch(chainConfig.rpcUrls.default.http[0], { - method: "POST", - headers: {"Content-Type": "application/json"}, - body: JSON.stringify({jsonrpc: "2.0", id: Date.now(), method, params}), - }); - if (response.status === 429 && retryable && attempt < 3) { - const retryAfter = Number(response.headers.get("retry-after")); - const delay = retryAfter > 0 ? Math.min(retryAfter * 1000, 10000) : 1000 * 2 ** attempt; - await new Promise(resolve => setTimeout(resolve, delay)); - continue; - } - if (!response.ok) throw new Error(`RPC HTTP ${response.status}`); - const data = await response.json(); - if (data.error) throw data.error; - return data.result; - } - }; - let identityCheck: Promise | undefined; return { async request({method, params = []}: {method: string; params: any[]}) { - if (chainConfig.genesisHash) { - // Recheck before every broadcast, including locally signed transactions. - if ( - !identityCheck || - method === "eth_sendRawTransaction" || - method === "eth_sendTransaction" || - method === "eth_signTransaction" - ) { - identityCheck = assertNetworkIdentity(rpc, chainConfig).catch(error => { - identityCheck = undefined; - throw error; - }); - } - await identityCheck; - } if (PROVIDER_METHODS.has(method) && isAddress) { const provider = config.provider || (typeof window !== "undefined" ? window.ethereum : undefined); if (provider) { try { if (method === "eth_sendTransaction" || method === "eth_signTransaction") { await assertChainMatch(provider, chainConfig); - await assertNetworkIdentity(args => provider.request(args), chainConfig); } return await provider.request({method, params}); } catch (err) { @@ -131,7 +90,26 @@ const getCustomTransportConfig = (config: ClientConfig, chainConfig: GenLayerCha } try { - return await rpc({method, params}); + const response = await fetch(chainConfig.rpcUrls.default.http[0], { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + jsonrpc: "2.0", + id: Date.now(), + method, + params, + }), + }); + + const data = await response.json(); + + if (data.error) { + throw data.error; + } + + return data.result; } catch (err) { console.error(`GenLayer RPC error (${method}):`, (err as Error).message || err); throw err; @@ -151,15 +129,13 @@ const getCustomTransportConfig = (config: ClientConfig, chainConfig: GenLayerCha * @returns Configured client with contract, transaction, and staking methods */ export const createClient = (config: ClientConfig = {chain: localnet}): GenLayerClient => { - const source = config.chain || localnet; + const baseChain = config.chain || localnet; + // Copy instead of mutating: exported chain presets are shared by every client. const chainConfig = config.endpoint - ? {...source, rpcUrls: {...source.rpcUrls, default: {...source.rpcUrls.default, http: [config.endpoint]}}} - : source; + ? {...baseChain, rpcUrls: {...baseChain.rpcUrls, default: {...baseChain.rpcUrls.default, http: [config.endpoint]}}} + : baseChain; - const customTransport = custom(getCustomTransportConfig(config, chainConfig as GenLayerChain), { - retryCount: 0, - retryDelay: 0, - }); + const customTransport = custom(getCustomTransportConfig(config, chainConfig as GenLayerChain), {retryCount: 0, retryDelay: 0}); const publicClient = createPublicClient(chainConfig as GenLayerChain, customTransport).extend( publicActions, ); @@ -184,10 +160,7 @@ export const createClient = (config: ClientConfig = {chain: localnet}): GenLayer const clientWithAllActions = { ...clientWithTransactionActions, - ...contractActions( - clientWithTransactionActions as unknown as GenLayerClient, - publicClient, - ), + ...contractActions(clientWithTransactionActions as unknown as GenLayerClient, publicClient), } as unknown as GenLayerClient; const clientWithReceiptActions = { diff --git a/src/client/networkIdentity.ts b/src/client/networkIdentity.ts deleted file mode 100644 index 145ac18..0000000 --- a/src/client/networkIdentity.ts +++ /dev/null @@ -1,54 +0,0 @@ -import {GenLayerChain} from "@/types"; -import {decodeFunctionResult, encodeFunctionData, parseAbi} from "viem"; - -type Request = (args: {method: string; params?: any[]}) => Promise; -export const ADDRESS_MANAGER_ABI = parseAbi(["function getAddress(string key) view returns (address)"]); - -/** Validate deployment identity separately from the SDK's qualified contract/ABI snapshot. */ -export async function assertNetworkIdentity(request: Request, chain: GenLayerChain): Promise { - if (!chain.genesisHash) return; - const id = await request({method: "eth_chainId"}); - const block = await request({method: "eth_getBlockByNumber", params: ["0x0", false]}); - if (BigInt(id) !== BigInt(chain.id) || block?.hash?.toLowerCase() !== chain.genesisHash.toLowerCase()) { - throw new Error( - "RPC network identity does not match Bradbury Phase 2; chain ID 4221 alone is insufficient.", - ); - } - const requireCode = async (address: string) => { - const code = await request({method: "eth_getCode", params: [address, "latest"]}); - if (typeof code !== "string" || !/^0x[0-9a-f]+$/i.test(code) || code.length <= 2) { - throw new Error("Bradbury Phase 2 contract code is missing from the configured RPC."); - } - }; - if (!chain.addressManager) return; - await requireCode(chain.addressManager); - const contracts = { - ConsensusMain: chain.consensusMainContract, - ConsensusData: chain.consensusDataContract, - Staking: chain.stakingContract, - FeeManager: chain.feeManagerContract, - RoundsStorage: chain.roundsStorageContract, - Appeals: chain.appealsContract, - }; - for (const [name, contract] of Object.entries(contracts)) { - if (!contract) continue; - const data = await request({ - method: "eth_call", - params: [ - { - to: chain.addressManager, - data: encodeFunctionData({abi: ADDRESS_MANAGER_ABI, functionName: "getAddress", args: [name]}), - }, - "latest", - ], - }); - const address = decodeFunctionResult({abi: ADDRESS_MANAGER_ABI, functionName: "getAddress", data}); - if (/^0x0{40}$/i.test(address)) throw new Error(`AddressManager has no ${name} entry.`); - await requireCode(address); - if (address.toLowerCase() !== contract.address.toLowerCase()) { - throw new Error( - `AddressManager ${name} differs from this SDK contract configuration. The network identity matches; use an SDK/chain configuration with the current addresses and compatible ABIs before sending transactions.`, - ); - } - } -} diff --git a/src/types/chains.ts b/src/types/chains.ts index c10cf73..e3e4ed5 100644 --- a/src/types/chains.ts +++ b/src/types/chains.ts @@ -3,10 +3,6 @@ import {Address} from "./accounts"; export type GenLayerChain = Chain & { isStudio: boolean; - /** Genesis identity for networks that reuse a chain ID. */ - genesisHash?: `0x${string}`; - /** Stable deployment registry; contract addresses below are a qualified ABI/configuration snapshot. */ - addressManager?: Address; consensusMainContract: { address: Address; abi: readonly unknown[]; diff --git a/tests/bradbury-network.test.ts b/tests/bradbury-network.test.ts deleted file mode 100644 index eb18c4f..0000000 --- a/tests/bradbury-network.test.ts +++ /dev/null @@ -1,136 +0,0 @@ -import {decodeFunctionData, encodeFunctionResult} from "viem"; -import {afterEach, describe, expect, it, vi} from "vitest"; -import {ADDRESS_MANAGER_ABI, assertNetworkIdentity} from "../src/client/networkIdentity"; -import {createClient} from "../src/client/client"; -import {testnetBradbury} from "../src/chains/testnetBradbury"; - -const GENESIS = "0x17d89764d4f4f963158fc4c5e8f2cb670c2837740b35f37081c12860c3df97e4"; -const request = () => - vi.fn(async ({method, params}: {method: string; params?: any[]}) => { - if (method === "eth_chainId") return "0x107d"; - if (method === "eth_getBlockByNumber") return {hash: GENESIS}; - if (method === "eth_getCode") return "0x6001"; - if (method === "eth_call") { - const {args} = decodeFunctionData({abi: ADDRESS_MANAGER_ABI, data: params![0].data}); - const contracts = { - ConsensusMain: testnetBradbury.consensusMainContract, - ConsensusData: testnetBradbury.consensusDataContract, - Staking: testnetBradbury.stakingContract, - FeeManager: testnetBradbury.feeManagerContract, - RoundsStorage: testnetBradbury.roundsStorageContract, - Appeals: testnetBradbury.appealsContract, - }; - return encodeFunctionResult({ - abi: ADDRESS_MANAGER_ABI, - functionName: "getAddress", - result: contracts[args[0] as keyof typeof contracts]!.address, - }); - } - throw new Error(`Unexpected method ${method}`); - }); -afterEach(() => vi.restoreAllMocks()); - -describe("Bradbury Phase 2 network identity", () => { - it("distinguishes a changed registry from the wrong network and rejects stale SDK targets", async () => { - const valid = request(); - const moved = "0x1111111111111111111111111111111111111111"; - const rpc = async (args: {method: string; params?: any[]}) => - args.method === "eth_call" - ? encodeFunctionResult({abi: ADDRESS_MANAGER_ABI, functionName: "getAddress", result: moved}) - : valid(args); - await expect(assertNetworkIdentity(rpc, testnetBradbury)).rejects.toThrow("network identity matches"); - const updated = { - ...testnetBradbury, - consensusMainContract: {...testnetBradbury.consensusMainContract!, address: moved as `0x${string}`}, - consensusDataContract: null, - stakingContract: null, - feeManagerContract: null, - roundsStorageContract: null, - appealsContract: null, - }; - await expect(assertNetworkIdentity(rpc, updated)).resolves.toBeUndefined(); - }); - it("accepts the deployed genesis and requires contract code", async () => { - const rpc = request(); - await expect(assertNetworkIdentity(rpc, testnetBradbury)).resolves.toBeUndefined(); - expect(rpc).toHaveBeenCalledWith({ - method: "eth_getCode", - params: ["0xD8fBa96C0dBB0257028dBc0107060b958e5c7113", "latest"], - }); - }); - it("rejects the legacy network even though its chain ID matches", async () => { - const rpc = request(); - rpc.mockImplementationOnce(async () => "0x107d"); - rpc.mockImplementationOnce(async () => ({ - hash: "0xef97917ce9bd9fa7d12ad6a8d81ea26c80ac1d727acc37cbb9799ae199788dc5", - })); - await expect(assertNetworkIdentity(rpc, testnetBradbury)).rejects.toThrow("identity"); - }); - it("rejects an endpoint without the deployed staking contract", async () => { - const valid = request(); - await expect( - assertNetworkIdentity( - async args => (args.method === "eth_getCode" ? "0x" : valid(args)), - testnetBradbury, - ), - ).rejects.toThrow("code is missing"); - }); - it("does not add calls to chains without a genesis pin", async () => { - const rpc = request(); - await assertNetworkIdentity(rpc, {...testnetBradbury, genesisHash: undefined}); - expect(rpc).not.toHaveBeenCalled(); - }); - it("does not mutate exported defaults when a client overrides its endpoint", () => { - const first = createClient({chain: testnetBradbury, endpoint: "https://first.example"}); - const second = createClient({chain: testnetBradbury, endpoint: "https://second.example"}); - expect(first.chain.rpcUrls.default.http).toEqual(["https://first.example"]); - expect(second.chain.rpcUrls.default.http).toEqual(["https://second.example"]); - expect(testnetBradbury.rpcUrls.default.http).toEqual(["https://rpc.testnet-chain.genlayer.com"]); - }); - it("blocks a locally signed broadcast before contacting a wrong network", async () => { - const methods: string[] = []; - vi.spyOn(globalThis, "fetch").mockImplementation(async (_url, init) => { - const {method} = JSON.parse(init!.body as string); - methods.push(method); - return new Response( - JSON.stringify({ - jsonrpc: "2.0", - id: 1, - result: method === "eth_chainId" ? "0x107d" : {hash: "0xdead"}, - }), - ); - }); - const client = createClient({chain: testnetBradbury}); - await expect(client.request({method: "eth_sendRawTransaction", params: ["0x01"]})).rejects.toThrow( - "identity", - ); - expect(methods).not.toContain("eth_sendRawTransaction"); - }); -}); - -describe("RPC rate limiting", () => { - it("retries a rate-limited read", async () => { - vi.useFakeTimers(); - const fetch = vi - .spyOn(globalThis, "fetch") - .mockResolvedValueOnce(new Response("", {status: 429})) - .mockResolvedValueOnce(new Response(JSON.stringify({result: "0x107d"}))); - try { - const chain = {...testnetBradbury, genesisHash: undefined}; - const client = createClient({chain}); - const result = client.request({method: "eth_chainId"}); - await vi.runAllTimersAsync(); - await expect(result).resolves.toBe("0x107d"); - expect(fetch).toHaveBeenCalledTimes(2); - } finally { - vi.useRealTimers(); - } - }); - it("never retries a rate-limited broadcast", async () => { - const fetch = vi.spyOn(globalThis, "fetch").mockResolvedValue(new Response("", {status: 429})); - const chain = {...testnetBradbury, genesisHash: undefined}; - const client = createClient({chain}); - await expect(client.request({method: "eth_sendRawTransaction", params: ["0x01"]})).rejects.toThrow("429"); - expect(fetch).toHaveBeenCalledTimes(1); - }); -}); diff --git a/tests/chains-config.test.ts b/tests/chains-config.test.ts index a8e8028..fae2e05 100644 --- a/tests/chains-config.test.ts +++ b/tests/chains-config.test.ts @@ -1,5 +1,5 @@ import {describe, expect, it} from "vitest"; -import {studioDevnet, studionet} from "../src/chains"; +import {studioDevnet, studionet, testnetBradbury} from "../src/chains"; describe("Studio chain presets", () => { it("exports the dedicated Studio preview deployment", () => { @@ -30,3 +30,20 @@ describe("Studio chain presets", () => { ]); }); }); + +describe("Bradbury chain preset", () => { + it("targets the Bradbury Phase 2 deployment", () => { + expect(testnetBradbury).toMatchObject({ + id: 4221, + isStudio: false, + rpcUrls: {default: {http: ["https://rpc.testnet-chain.genlayer.com"]}}, + blockExplorers: {default: {url: "https://scan.testnet-chain.genlayer.com"}}, + }); + expect(testnetBradbury.consensusMainContract?.address).toBe("0x2E2766cbc3E5e61Ce93bBcdCBb3eAcB82082A019"); + expect(testnetBradbury.consensusDataContract?.address).toBe("0xc5FA6f82BEe53598825d6edf7E3e24613082c75B"); + expect(testnetBradbury.stakingContract?.address).toBe("0xD8fBa96C0dBB0257028dBc0107060b958e5c7113"); + expect(testnetBradbury.feeManagerContract?.address).toBe("0x7678587A847712f2A96082AC07883A88D0fc7245"); + expect(testnetBradbury.roundsStorageContract?.address).toBe("0x4038d4F72C7aAbA5a442cC0dA946012B9E3f4B8a"); + expect(testnetBradbury.appealsContract?.address).toBe("0xdc953c3bCf8837987853ca05a78D52fFC3E18651"); + }); +}); diff --git a/tests/client.test.ts b/tests/client.test.ts index c050038..7f2c837 100644 --- a/tests/client.test.ts +++ b/tests/client.test.ts @@ -20,6 +20,15 @@ describe("Client Creation", () => { expect(client).toBeDefined(); expect(client.chain).toBe(localnet); }); + + it("should not change the shared chain preset when overriding the endpoint", () => { + const defaultRpc = localnet.rpcUrls.default.http; + const first = createClient({chain: localnet, endpoint: "https://first.example"}); + const second = createClient({chain: localnet, endpoint: "https://second.example"}); + expect(first.chain.rpcUrls.default.http).toEqual(["https://first.example"]); + expect(second.chain.rpcUrls.default.http).toEqual(["https://second.example"]); + expect(localnet.rpcUrls.default.http).toEqual(defaultRpc); + }); }); describe("Client Overrides", () => { From 7ce4330a3f29bcad3286a65a99ccc40fb62cf6f7 Mon Sep 17 00:00:00 2001 From: Darien Hernandez Date: Tue, 20 Oct 2026 00:17:52 +0200 Subject: [PATCH 5/5] fix(client): retry rate-limited RPC reads The Bradbury Phase 2 public RPC answers HTTP 429 once a burst passes about five concurrent calls, so getEpochInfo and getValidatorInfo failed on most runs. Retry reads up to three times, honouring Retry-After. Writes are never retried, so a transaction cannot be broadcast twice (#110). Co-Authored-By: Claude Opus 5.5 --- src/client/client.ts | 37 +++++++++++++++++++++++++------------ tests/client.test.ts | 31 +++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 12 deletions(-) diff --git a/src/client/client.ts b/src/client/client.ts index 14ef790..54d3c17 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -69,6 +69,11 @@ const assertChainMatch = async ( } }; +// Public chain RPCs rate-limit bursts with HTTP 429. Reads are retried with +// backoff; writes never are, so a transaction cannot be broadcast twice (#110). +const RATE_LIMIT_RETRIES = 3; +const RETRYABLE_READS = /^(eth_call|eth_get\w+|eth_chainId|eth_blockNumber|eth_gasPrice|eth_estimateGas|net_version)$/; + const getCustomTransportConfig = (config: ClientConfig, chainConfig: GenLayerChain) => { const isAddress = typeof config.account !== "object"; @@ -90,18 +95,26 @@ const getCustomTransportConfig = (config: ClientConfig, chainConfig: GenLayerCha } try { - const response = await fetch(chainConfig.rpcUrls.default.http[0], { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - jsonrpc: "2.0", - id: Date.now(), - method, - params, - }), - }); + let response: Response; + for (let attempt = 0; ; attempt++) { + response = await fetch(chainConfig.rpcUrls.default.http[0], { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + jsonrpc: "2.0", + id: Date.now(), + method, + params, + }), + }); + if (response.status !== 429 || attempt >= RATE_LIMIT_RETRIES || !RETRYABLE_READS.test(method)) break; + const retryAfter = Number(response.headers.get("retry-after")); + await new Promise(resolve => + setTimeout(resolve, retryAfter > 0 ? Math.min(retryAfter * 1000, 10_000) : 1000 * 2 ** attempt), + ); + } const data = await response.json(); diff --git a/tests/client.test.ts b/tests/client.test.ts index 7f2c837..6147770 100644 --- a/tests/client.test.ts +++ b/tests/client.test.ts @@ -193,3 +193,34 @@ describe("Client Overrides", () => { ]); }); }); + +describe("RPC rate limiting", () => { + beforeEach(() => mockFetch.mockReset()); + + it("retries a rate-limited read", async () => { + vi.useFakeTimers(); + try { + mockFetch + .mockResolvedValueOnce(new Response("", {status: 429})) + .mockResolvedValueOnce(new Response(JSON.stringify({jsonrpc: "2.0", id: 1, result: "0x107d"}))); + const client = createClient({chain: localnet}); + const result = client.request({method: "eth_chainId"}); + await vi.runAllTimersAsync(); + await expect(result).resolves.toBe("0x107d"); + expect(mockFetch).toHaveBeenCalledTimes(2); + } finally { + vi.useRealTimers(); + } + }); + + it("never retries a rate-limited broadcast", async () => { + mockFetch.mockResolvedValue( + new Response(JSON.stringify({jsonrpc: "2.0", id: 1, error: {code: 429, message: "Rate Limit Exceeded"}}), { + status: 429, + }), + ); + const client = createClient({chain: localnet}); + await expect(client.request({method: "eth_sendRawTransaction", params: ["0x01"]})).rejects.toBeDefined(); + expect(mockFetch).toHaveBeenCalledTimes(1); + }); +});