From f98545f4ae52cc27bb6f6b2ec5fcd1555426d24b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Yaz=C4=B1c=C4=B1?= <75089142+yaziciahmet@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:46:51 +0200 Subject: [PATCH 01/23] ci: fix udeps (#935) * udeps v * add rust flag, duh * update nightly v * its 2024 u dummy * try with latest action version --- .github/workflows/checks.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 926e190f1..5da5df0ff 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -114,7 +114,7 @@ jobs: - name: Toolchain uses: actions-rs/toolchain@v1 with: - toolchain: nightly + toolchain: nightly-2024-07-27 override: true - name: Rust Cache uses: Swatinem/rust-cache@v2 @@ -131,8 +131,8 @@ jobs: RUSTFLAGS: -A warnings uses: aig787/cargo-udeps-action@v1 with: - version: 'latest' - args: '--workspace --all-features --all-targets' + version: "latest" + args: "--workspace --all-features --all-targets" deny: runs-on: ubuntu-latest @@ -393,7 +393,6 @@ jobs: BONSAI_API_URL: ${{ secrets.BONSAI_API_URL }} # TODO: remove this once we don't use the client on tests BONSAI_API_KEY: ${{ secrets.BONSAI_API_KEY }} # TODO: remove this once we don't use the client on tests - system-contracts: strategy: fail-fast: true @@ -443,9 +442,8 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.x' + python-version: "3.x" - name: Run check_genesis.sh run: ./.github/scripts/check_genesis.sh shell: bash - From 44c10f091b86f04dcd94809b0dd5b4fc2b8ce1a8 Mon Sep 17 00:00:00 2001 From: erdkocak <93616117+erdkocak@users.noreply.github.com> Date: Thu, 1 Aug 2024 00:33:21 +0300 Subject: [PATCH 02/23] Added optimized byte comparison function to Bridge contract (#930) * Added optimized byte comparison function * Ahmet's optimization * fixed offset <= len * make genesis * edge case tests added --- .../out/Bridge.sol/Bridge.json | 2 +- .../src/evm/system_contracts/src/Bridge.sol | 34 ++++++++++++++----- .../evm/system_contracts/test/Bridge.t.sol | 31 ++++++++++++++--- resources/genesis/bitcoin-regtest/evm.json | 2 +- resources/genesis/mock-dockerized/evm.json | 2 +- resources/genesis/mock/evm.json | 2 +- .../demo-tests/bitcoin-regtest/evm.json | 2 +- resources/test-data/demo-tests/mock/evm.json | 2 +- .../evm.json | 2 +- .../evm.json | 2 +- .../test-data/integration-tests/evm.json | 2 +- 11 files changed, 60 insertions(+), 23 deletions(-) diff --git a/crates/evm/src/evm/system_contracts/out/Bridge.sol/Bridge.json b/crates/evm/src/evm/system_contracts/out/Bridge.sol/Bridge.json index 764f90525..b891615a0 100644 --- a/crates/evm/src/evm/system_contracts/out/Bridge.sol/Bridge.json +++ b/crates/evm/src/evm/system_contracts/out/Bridge.sol/Bridge.json @@ -1 +1 @@ -{"abi":[{"type":"function","name":"DEPOSIT_AMOUNT","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"LIGHT_CLIENT","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract BitcoinLightClient"}],"stateMutability":"view"},{"type":"function","name":"SYSTEM_CALLER","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"acceptOwnership","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"batchWithdraw","inputs":[{"name":"bitcoin_addresses","type":"bytes32[]","internalType":"bytes32[]"}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"deposit","inputs":[{"name":"p","type":"tuple","internalType":"struct Bridge.DepositParams","components":[{"name":"version","type":"bytes4","internalType":"bytes4"},{"name":"flag","type":"bytes2","internalType":"bytes2"},{"name":"vin","type":"bytes","internalType":"bytes"},{"name":"vout","type":"bytes","internalType":"bytes"},{"name":"witness","type":"bytes","internalType":"bytes"},{"name":"locktime","type":"bytes4","internalType":"bytes4"},{"name":"intermediate_nodes","type":"bytes","internalType":"bytes"},{"name":"block_height","type":"uint256","internalType":"uint256"},{"name":"index","type":"uint256","internalType":"uint256"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"depositScript","inputs":[],"outputs":[{"name":"","type":"bytes","internalType":"bytes"}],"stateMutability":"view"},{"type":"function","name":"getWithdrawalCount","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"initialize","inputs":[{"name":"_depositScript","type":"bytes","internalType":"bytes"},{"name":"_scriptSuffix","type":"bytes","internalType":"bytes"},{"name":"_requiredSigsCount","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"initialized","inputs":[],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"operator","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"owner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"pendingOwner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"renounceOwnership","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"requiredSigsCount","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"scriptSuffix","inputs":[],"outputs":[{"name":"","type":"bytes","internalType":"bytes"}],"stateMutability":"view"},{"type":"function","name":"setDepositScript","inputs":[{"name":"_depositScript","type":"bytes","internalType":"bytes"},{"name":"_scriptSuffix","type":"bytes","internalType":"bytes"},{"name":"_requiredSigsCount","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"setOperator","inputs":[{"name":"_operator","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"spentWtxIds","inputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"transferOwnership","inputs":[{"name":"newOwner","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"withdraw","inputs":[{"name":"bitcoin_address","type":"bytes32","internalType":"bytes32"}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"withdrawalAddrs","inputs":[{"name":"","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"event","name":"Deposit","inputs":[{"name":"wtxId","type":"bytes32","indexed":false,"internalType":"bytes32"},{"name":"recipient","type":"address","indexed":false,"internalType":"address"},{"name":"timestamp","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"DepositScriptUpdate","inputs":[{"name":"depositScript","type":"bytes","indexed":false,"internalType":"bytes"},{"name":"scriptSuffix","type":"bytes","indexed":false,"internalType":"bytes"},{"name":"requiredSigsCount","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"name":"version","type":"uint64","indexed":false,"internalType":"uint64"}],"anonymous":false},{"type":"event","name":"OperatorUpdated","inputs":[{"name":"oldOperator","type":"address","indexed":false,"internalType":"address"},{"name":"newOperator","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"OwnershipTransferStarted","inputs":[{"name":"previousOwner","type":"address","indexed":true,"internalType":"address"},{"name":"newOwner","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"name":"previousOwner","type":"address","indexed":true,"internalType":"address"},{"name":"newOwner","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"Withdrawal","inputs":[{"name":"bitcoin_address","type":"bytes32","indexed":false,"internalType":"bytes32"},{"name":"index","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"timestamp","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"error","name":"InvalidInitialization","inputs":[]},{"type":"error","name":"NotInitializing","inputs":[]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"name":"owner","type":"address","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"name":"account","type":"address","internalType":"address"}]}],"bytecode":{"object":"0x6080604052348015600f57600080fd5b5061244b8061001f6000396000f3fe6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611ea0565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f19565b610624565b34801561020b57600080fd5b5061015461021a366004611f90565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fa9565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611f90565b610853565b3480156102c457600080fd5b506101896102d3366004611ea0565b61091c565b3480156102e457600080fd5b506101896102f3366004611ff7565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611f90565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612020565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db366004611ff7565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff1916600117905560026105568587836120fb565b5060036105648385836120fb565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121e4565b60405180910390a15050505050565b61063581662386f26fc10000612234565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f61224b565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f461224b565b9050602002013582846107079190612261565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612072565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612072565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d28587836120fb565b5060036109e08385836120fb565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121e4565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612072565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612274565b610b3e604085016020860161229e565b610b4b60408601866122c8565b610b5860608801886122c8565b610b6560808a018a6122c8565b610b7560c08c0160a08d01612274565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122c8565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122c8565b8861010001356040518663ffffffff1660e01b8152600401610e9995949392919061230f565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612341565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612261565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612072565b915060009050611007838284611840565b905061109d816002805461101a90612072565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612072565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612261565b6110fd856014612261565b86516111099190612363565b869190611840565b9050611124816003805461101a90612072565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119c6565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f826119fc565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a999989796959493929190612376565b604051602081830303815290604052611a6d565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612261565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611a94565b9050600019810361144d575060009695505050505050565b6114578184612261565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612261565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611add565b905060001981036114f1575060009695505050505050565b6114fb8184612261565b9250506001016114b1565b600080611514836000611b41565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611ce5565b90506000198103611571576000935050505061158d565b61157b8184612261565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611ce5565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612261565b915060010161159b565b506116178582611ce5565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612261565b905060005b868110156117bf5761174b8883611b41565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612261565b6117ab9190612261565b6117b59083612261565b9150600101611739565b506117ca8782611b41565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612261565b61182d906001612261565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612261565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b6000815183511461194e5760405162461bcd60e51b8152602060048201526014602482015273098cadccee8d0e640c8de40dcdee840dac2e8c6d60631b604482015260640161043f565b825160005b818110156119bb5783818151811061196d5761196d61224b565b602001015160f81c60f81b6001600160f81b0319168582815181106119945761199461224b565b01602001516001600160f81b031916146119b35760009250505061158d565b600101611953565b506001949350505050565b600080600280546119d690612072565b9150600090506119e884836014611840565b6119f1906123df565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611aa38585611d87565b909250905060018201611abc576000199250505061158d565b80611ac8836025612261565b611ad29190612261565b61166d906004612261565b6000611aea826009612261565b83511015611afb575060001961158d565b600080611b1285611b0d866008612261565b611b41565b909250905060018201611b2b576000199250505061158d565b80611b37836009612261565b61166d9190612261565b6000806000611b508585611dc9565b90508060ff16600003611b85576000858581518110611b7157611b7161224b565b016020015190935060f81c9150611cde9050565b83611b91826001612432565b60ff16611b9e9190612261565b85511015611bb55760001960009250925050611cde565b60008160ff16600203611bf957611bee611bda611bd3876001612261565b8890611e4f565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611cd4565b8160ff16600403611c4857611c3b611c15611bd3876001612261565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611cd4565b8160ff16600803611cd457611cc7611c64611bd3876001612261565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611cf48585611b41565b909250905060018201611d0d576000199250505061158d565b600080611d1b846001612261565b905060005b83811015611d7c57611d3688611b0d848a612261565b909550925060018301611d52576000199550505050505061158d565b82611d5e866001612261565b611d689190612261565b611d729083612261565b9150600101611d20565b509695505050505050565b600080611d95836025612261565b84511015611daa575060001990506000611cde565b600080611dbc86611b0d876024612261565b9097909650945050505050565b6000828281518110611ddd57611ddd61224b565b016020015160f81c60ff03611df45750600861158d565b828281518110611e0657611e0661224b565b016020015160f81c60fe03611e1d5750600461158d565b828281518110611e2f57611e2f61224b565b016020015160f81c60fd03611e465750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e7057600080fd5b50813567ffffffffffffffff811115611e8857600080fd5b602083019150836020828501011115611cde57600080fd5b600080600080600060608688031215611eb857600080fd5b853567ffffffffffffffff811115611ecf57600080fd5b611edb88828901611e5e565b909650945050602086013567ffffffffffffffff811115611efb57600080fd5b611f0788828901611e5e565b96999598509660400135949350505050565b60008060208385031215611f2c57600080fd5b823567ffffffffffffffff811115611f4357600080fd5b8301601f81018513611f5457600080fd5b803567ffffffffffffffff811115611f6b57600080fd5b8560208260051b8401011115611f8057600080fd5b6020919091019590945092505050565b600060208284031215611fa257600080fd5b5035919050565b602081526000825180602084015260005b81811015611fd75760208186018101516040868401015201611fba565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561200957600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561203257600080fd5b813567ffffffffffffffff81111561204957600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061208657607f821691505b6020821081036120a657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156120f657806000526020600020601f840160051c810160208510156120d35750805b601f840160051c820191505b818110156120f357600081556001016120df565b50505b505050565b67ffffffffffffffff8311156121135761211361205c565b612127836121218354612072565b836120ac565b6000601f84116001811461215b57600085156121435750838201355b600019600387901b1c1916600186901b1783556120f3565b600083815260209020601f19861690835b8281101561218c578685013582556020948501946001909201910161216c565b50868210156121a95760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006121f86060830187896121bb565b828103602084015261220b8186886121bb565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d61221e565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d61221e565b60006020828403121561228657600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122b057600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122df57600080fd5b83018035915067ffffffffffffffff8211156122fa57600080fd5b602001915036819003821315611cde57600080fd5b85815284602082015260806040820152600061232f6080830185876121bb565b90508260608301529695505050505050565b60006020828403121561235357600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d61221e565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff1981169190601482101561242b576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61221e56","sourceMap":"430:8760:33:-:0;;;;;;;;;;;;;;;;;;;","linkReferences":{}},"deployedBytecode":{"object":"0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611ea0565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f19565b610624565b34801561020b57600080fd5b5061015461021a366004611f90565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fa9565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611f90565b610853565b3480156102c457600080fd5b506101896102d3366004611ea0565b61091c565b3480156102e457600080fd5b506101896102f3366004611ff7565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611f90565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612020565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db366004611ff7565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff1916600117905560026105568587836120fb565b5060036105648385836120fb565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121e4565b60405180910390a15050505050565b61063581662386f26fc10000612234565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f61224b565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f461224b565b9050602002013582846107079190612261565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612072565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612072565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d28587836120fb565b5060036109e08385836120fb565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121e4565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612072565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612274565b610b3e604085016020860161229e565b610b4b60408601866122c8565b610b5860608801886122c8565b610b6560808a018a6122c8565b610b7560c08c0160a08d01612274565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122c8565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122c8565b8861010001356040518663ffffffff1660e01b8152600401610e9995949392919061230f565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612341565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612261565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612072565b915060009050611007838284611840565b905061109d816002805461101a90612072565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612072565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612261565b6110fd856014612261565b86516111099190612363565b869190611840565b9050611124816003805461101a90612072565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119c6565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f826119fc565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a999989796959493929190612376565b604051602081830303815290604052611a6d565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612261565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611a94565b9050600019810361144d575060009695505050505050565b6114578184612261565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612261565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611add565b905060001981036114f1575060009695505050505050565b6114fb8184612261565b9250506001016114b1565b600080611514836000611b41565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611ce5565b90506000198103611571576000935050505061158d565b61157b8184612261565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611ce5565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612261565b915060010161159b565b506116178582611ce5565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612261565b905060005b868110156117bf5761174b8883611b41565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612261565b6117ab9190612261565b6117b59083612261565b9150600101611739565b506117ca8782611b41565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612261565b61182d906001612261565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612261565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b6000815183511461194e5760405162461bcd60e51b8152602060048201526014602482015273098cadccee8d0e640c8de40dcdee840dac2e8c6d60631b604482015260640161043f565b825160005b818110156119bb5783818151811061196d5761196d61224b565b602001015160f81c60f81b6001600160f81b0319168582815181106119945761199461224b565b01602001516001600160f81b031916146119b35760009250505061158d565b600101611953565b506001949350505050565b600080600280546119d690612072565b9150600090506119e884836014611840565b6119f1906123df565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611aa38585611d87565b909250905060018201611abc576000199250505061158d565b80611ac8836025612261565b611ad29190612261565b61166d906004612261565b6000611aea826009612261565b83511015611afb575060001961158d565b600080611b1285611b0d866008612261565b611b41565b909250905060018201611b2b576000199250505061158d565b80611b37836009612261565b61166d9190612261565b6000806000611b508585611dc9565b90508060ff16600003611b85576000858581518110611b7157611b7161224b565b016020015190935060f81c9150611cde9050565b83611b91826001612432565b60ff16611b9e9190612261565b85511015611bb55760001960009250925050611cde565b60008160ff16600203611bf957611bee611bda611bd3876001612261565b8890611e4f565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611cd4565b8160ff16600403611c4857611c3b611c15611bd3876001612261565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611cd4565b8160ff16600803611cd457611cc7611c64611bd3876001612261565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611cf48585611b41565b909250905060018201611d0d576000199250505061158d565b600080611d1b846001612261565b905060005b83811015611d7c57611d3688611b0d848a612261565b909550925060018301611d52576000199550505050505061158d565b82611d5e866001612261565b611d689190612261565b611d729083612261565b9150600101611d20565b509695505050505050565b600080611d95836025612261565b84511015611daa575060001990506000611cde565b600080611dbc86611b0d876024612261565b9097909650945050505050565b6000828281518110611ddd57611ddd61224b565b016020015160f81c60ff03611df45750600861158d565b828281518110611e0657611e0661224b565b016020015160f81c60fe03611e1d5750600461158d565b828281518110611e2f57611e2f61224b565b016020015160f81c60fd03611e465750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e7057600080fd5b50813567ffffffffffffffff811115611e8857600080fd5b602083019150836020828501011115611cde57600080fd5b600080600080600060608688031215611eb857600080fd5b853567ffffffffffffffff811115611ecf57600080fd5b611edb88828901611e5e565b909650945050602086013567ffffffffffffffff811115611efb57600080fd5b611f0788828901611e5e565b96999598509660400135949350505050565b60008060208385031215611f2c57600080fd5b823567ffffffffffffffff811115611f4357600080fd5b8301601f81018513611f5457600080fd5b803567ffffffffffffffff811115611f6b57600080fd5b8560208260051b8401011115611f8057600080fd5b6020919091019590945092505050565b600060208284031215611fa257600080fd5b5035919050565b602081526000825180602084015260005b81811015611fd75760208186018101516040868401015201611fba565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561200957600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561203257600080fd5b813567ffffffffffffffff81111561204957600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061208657607f821691505b6020821081036120a657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156120f657806000526020600020601f840160051c810160208510156120d35750805b601f840160051c820191505b818110156120f357600081556001016120df565b50505b505050565b67ffffffffffffffff8311156121135761211361205c565b612127836121218354612072565b836120ac565b6000601f84116001811461215b57600085156121435750838201355b600019600387901b1c1916600186901b1783556120f3565b600083815260209020601f19861690835b8281101561218c578685013582556020948501946001909201910161216c565b50868210156121a95760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006121f86060830187896121bb565b828103602084015261220b8186886121bb565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d61221e565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d61221e565b60006020828403121561228657600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122b057600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122df57600080fd5b83018035915067ffffffffffffffff8211156122fa57600080fd5b602001915036819003821315611cde57600080fd5b85815284602082015260806040820152600061232f6080830185876121bb565b90508260608301529695505050505050565b60006020828403121561235357600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d61221e565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff1981169190601482101561242b576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61221e56","sourceMap":"430:8760:33:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1018:23;;;;;;;;;;-1:-1:-1;1018:23:33;;;;;;;;;;;179:14:36;;172:22;154:41;;142:2;127:18;1018:23:33;;;;;;;;2269:810;;;;;;;;;;-1:-1:-1;2269:810:33;;;;;:::i;:::-;;:::i;:::-;;1133:32;;;;;;;;;;;;;;;;;;;1535:25:36;;;1523:2;1508:18;1133:32:33;1389:177:36;1104:23:33;;;;;;;;;;-1:-1:-1;1104:23:33;;;;;;;-1:-1:-1;;;;;1104:23:33;;;;;;-1:-1:-1;;;;;1735:32:36;;;1717:51;;1705:2;1690:18;1104:23:33;1571:203:36;7309:440:33;;;;;;:::i;:::-;;:::i;1239:43::-;;;;;;;;;;-1:-1:-1;1239:43:33;;;;;:::i;:::-;;;;;;;;;;;;;;;;3155:101:29;;;;;;;;;;;;;:::i;7812:108:33:-;;;;;;;;;;-1:-1:-1;7891:15:33;:22;7812:108;;2774:229:28;;;;;;;;;;;;;:::i;1203:25:33:-;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;2441:144:29:-;;;;;;;;;;;;;:::i;6763:301:33:-;;;;;;:::i;:::-;;:::i;3572:505::-;;;;;;;;;;-1:-1:-1;3572:505:33;;;;;:::i;:::-;;:::i;8063:147::-;;;;;;;;;;-1:-1:-1;8063:147:33;;;;;:::i;:::-;;:::i;1171:26::-;;;;;;;;;;;;;:::i;1288:32::-;;;;;;;;;;-1:-1:-1;1288:32:33;;;;;:::i;:::-;;:::i;920:91::-;;;;;;;;;;;;968:42;920:91;;4324:2185;;;;;;;;;;-1:-1:-1;4324:2185:33;;;;;:::i;:::-;;:::i;1680:168:28:-;;;;;;;;;;;;;:::i;793:121:33:-;;;;;;;;;;;;-1:-1:-1;;;;;793:121:33;;1047:51;;;;;;;;;;;;1088:10;1047:51;;2041:247:28;;;;;;;;;;-1:-1:-1;2041:247:28;;;;;:::i;:::-;;:::i;2269:810:33:-;1693:10;968:42;1693:27;1685:71;;;;-1:-1:-1;;;1685:71:33;;4650:2:36;1685:71:33;;;4632:21:36;4689:2;4669:18;;;4662:30;4728:33;4708:18;;;4701:61;4779:18;;1685:71:33;;;;;;;;;2417:11:::1;::::0;::::1;;2416:12;2408:56;;;::::0;-1:-1:-1;;;2408:56:33;;5010:2:36;2408:56:33::1;::::0;::::1;4992:21:36::0;5049:2;5029:18;;;5022:30;5088:33;5068:18;;;5061:61;5139:18;;2408:56:33::1;4808:355:36::0;2408:56:33::1;2482:18;2504:1;2482:23:::0;2474:62:::1;;;::::0;-1:-1:-1;;;2474:62:33;;5370:2:36;2474:62:33::1;::::0;::::1;5352:21:36::0;5409:2;5389:18;;;5382:30;5448:28;5428:18;;;5421:56;5494:18;;2474:62:33::1;5168:350:36::0;2474:62:33::1;2579:1;2554:26:::0;;;2546:69:::1;;;::::0;-1:-1:-1;;;2546:69:33;;5725:2:36;2546:69:33::1;::::0;::::1;5707:21:36::0;5764:2;5744:18;;;5737:30;5803:32;5783:18;;;5776:60;5853:18;;2546:69:33::1;5523:354:36::0;2546:69:33::1;2626:11;:18:::0;;-1:-1:-1;;2626:18:33::1;2640:4;2626:18;::::0;;2654:13:::1;:30;2670:14:::0;;2654:13;:30:::1;:::i;:::-;-1:-1:-1::0;2694:12:33::1;:28;2709:13:::0;;2694:12;:28:::1;:::i;:::-;-1:-1:-1::0;2732:17:33::1;:38:::0;;;2905:8:::1;:24:::0;;-1:-1:-1;;;;;;2905:24:33::1;::::0;::::1;::::0;;2945:42:::1;::::0;;8598:51:36;;;968:42:33::1;8680:2:36::0;8665:18;;8658:60;2945:42:33::1;::::0;8571:18:36;2945:42:33::1;;;;;;;3002:70;3022:14;;3038:13;;3053:18;3002:70;;;;;;;;;;:::i;:::-;;;;;;;;2269:810:::0;;;;;:::o;7309:440::-;7418:41;7435:17;1088:10;7418:41;:::i;:::-;7405:9;:54;7397:90;;;;-1:-1:-1;;;7397:90:33;;10014:2:36;7397:90:33;;;9996:21:36;10053:2;10033:18;;;10026:30;-1:-1:-1;;;10072:18:36;;;10065:53;10135:18;;7397:90:33;9812:347:36;7397:90:33;7513:15;:22;7497:13;7545:198;7562:28;;;7545:198;;;7611:15;7632:17;;7650:1;7632:20;;;;;;;:::i;:::-;7611:42;;;;;;;-1:-1:-1;7611:42:33;;;7632:20;7611:42;;;;7632:20;;;;;;;;;7611:42;;;;;-1:-1:-1;7672:60:33;7683:17;;7701:1;7683:20;;;;;;;:::i;:::-;;;;;;;7713:1;7705:5;:9;;;;:::i;:::-;7672:60;;;10628:25:36;;;10684:2;10669:18;;10662:34;;;;7716:15:33;10712:18:36;;;10705:34;10616:2;10601:18;7672:60:33;;;;;;;7592:3;;7545:198;;;;7387:362;7309:440;;:::o;3155:101:29:-;2334:13;:11;:13::i;:::-;3219:30:::1;3246:1;3219:18;:30::i;:::-;3155:101::o:0;2774:229:28:-;966:10:31;;2869:14:28;:12;:14::i;:::-;-1:-1:-1;;;;;2869:24:28;;2865:96;;2916:34;;-1:-1:-1;;;2916:34:28;;-1:-1:-1;;;;;1735:32:36;;2916:34:28;;;1717:51:36;1690:18;;2916:34:28;1571:203:36;2865:96:28;2970:26;2989:6;2970:18;:26::i;:::-;2816:187;2774:229::o;1203:25:33:-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2441:144:29:-;2487:7;;1313:22;2533:20;2570:8;-1:-1:-1;;;;;2570:8:29;;2441:144;-1:-1:-1;;2441:144:29:o;6763:301:33:-;1088:10;6841:9;:27;6833:63;;;;-1:-1:-1;;;6833:63:33;;10014:2:36;6833:63:33;;;9996:21:36;10053:2;10033:18;;;10026:30;-1:-1:-1;;;10072:18:36;;;10065:53;10135:18;;6833:63:33;9812:347:36;6833:63:33;6922:15;:22;;6954:37;;;;;-1:-1:-1;6954:37:33;;;;;;;;;;7006:51;;;10628:25:36;;;10684:2;10669:18;;10662:34;;;7041:15:33;10712:18:36;;;10705:34;7006:51:33;;;;;;;10616:2:36;7006:51:33;;;6823:241;6763:301;:::o;3572:505::-;2334:13:29;:11;:13::i;:::-;3724:18:33::1;3746:1;3724:23:::0;3716:62:::1;;;::::0;-1:-1:-1;;;3716:62:33;;5370:2:36;3716:62:33::1;::::0;::::1;5352:21:36::0;5409:2;5389:18;;;5382:30;5448:28;5428:18;;;5421:56;5494:18;;3716:62:33::1;5168:350:36::0;3716:62:33::1;3821:1;3796:26:::0;;;3788:69:::1;;;::::0;-1:-1:-1;;;3788:69:33;;5725:2:36;3788:69:33::1;::::0;::::1;5707:21:36::0;5764:2;5744:18;;;5737:30;5803:32;5783:18;;;5776:60;5853:18;;3788:69:33::1;5523:354:36::0;3788:69:33::1;3868:13;:30;3884:14:::0;;3868:13;:30:::1;:::i;:::-;-1:-1:-1::0;3908:12:33::1;:28;3923:13:::0;;3908:12;:28:::1;:::i;:::-;-1:-1:-1::0;3946:17:33::1;:38:::0;;;4000:70:::1;::::0;::::1;::::0;::::1;::::0;4020:14;;;;4036:13;;;;3966:18;;4000:70:::1;:::i;8063:147::-:0;2334:13:29;:11;:13::i;:::-;8132:8:33::1;:20:::0;;-1:-1:-1;;;;;;8132:20:33::1;;-1:-1:-1::0;;;;;8132:20:33;;::::1;::::0;;::::1;::::0;;;::::1;::::0;;;;8167:36:::1;::::0;;8183:8;;;::::1;;8598:51:36::0;;8680:2;8665:18;;8658:60;;;;8167:36:33::1;::::0;8571:18:36;8167:36:33::1;;;;;;;8063:147:::0;:::o;1171:26::-;;;;;;;:::i;1288:32::-;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1288:32:33;:::o;4324:2185::-;1836:8;;;;;-1:-1:-1;;;;;1836:8:33;1822:10;:22;1814:61;;;;-1:-1:-1;;;1814:61:33;;10952:2:36;1814:61:33;;;10934:21:36;10991:2;10971:18;;;10964:30;11030:28;11010:18;;;11003:56;11076:18;;1814:61:33;10750:350:36;1814:61:33;4750:13:::1;4766:84;4794:9;;::::0;::::1;:1:::0;:9:::1;:::i;:::-;4805:6;::::0;;;::::1;::::0;::::1;;:::i;:::-;4813:5;;::::0;::::1;:1:::0;:5:::1;:::i;:::-;4820:6;;::::0;::::1;:1:::0;:6:::1;:::i;:::-;4828:9;;::::0;::::1;:1:::0;:9:::1;:::i;:::-;4839:10;::::0;;;::::1;::::0;::::1;;:::i;:::-;4766:27;:84::i;:::-;4869:18;::::0;;;:11:::1;:18;::::0;;;;;4750:100;;-1:-1:-1;4869:18:33::1;;4868:19;4860:51;;;::::0;-1:-1:-1;;;4860:51:33;;12410:2:36;4860:51:33::1;::::0;::::1;12392:21:36::0;12449:2;12429:18;;;12422:30;-1:-1:-1;;;12468:18:36;;;12461:49;12527:18;;4860:51:33::1;12208:343:36::0;4860:51:33::1;4921:18;::::0;;;:11:::1;:18;::::0;;;;;;:25;;-1:-1:-1;;4921:25:33::1;4942:4;4921:25;::::0;;4965:27:::1;::::0;4986:5:::1;::::0;;::::1;:1:::0;:5:::1;:::i;:::-;4965:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;;-1:-1:-1;4965:20:33::1;::::0;-1:-1:-1;;;4965:27:33:i:1;:::-;4957:69;;;::::0;-1:-1:-1;;;4957:69:33;;12758:2:36;4957:69:33::1;::::0;::::1;12740:21:36::0;12797:2;12777:18;;;12770:30;12836:31;12816:18;;;12809:59;12885:18;;4957:69:33::1;12556:353:36::0;4957:69:33::1;5044:29;5066:6;;::::0;::::1;:1:::0;:6:::1;:::i;:::-;5044:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;;-1:-1:-1;5044:21:33::1;::::0;-1:-1:-1;;;5044:29:33:i:1;:::-;5036:72;;;::::0;-1:-1:-1;;;5036:72:33;;13116:2:36;5036:72:33::1;::::0;::::1;13098:21:36::0;13155:2;13135:18;;;13128:30;13194:32;13174:18;;;13167:60;13244:18;;5036:72:33::1;12914:354:36::0;5036:72:33::1;5130:13;5147:27;5168:5;;::::0;::::1;:1:::0;:5:::1;:::i;:::-;5147:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;;-1:-1:-1;5147:20:33::1;::::0;-1:-1:-1;;;5147:27:33:i:1;:::-;5127:47;;;5192:5;5201:1;5192:10;5184:45;;;::::0;-1:-1:-1;;;5184:45:33;;13475:2:36;5184:45:33::1;::::0;::::1;13457:21:36::0;13514:2;13494:18;;;13487:30;-1:-1:-1;;;13533:18:36;;;13526:52;13595:18;;5184:45:33::1;13273:346:36::0;5184:45:33::1;5298:46;5327:9;;::::0;::::1;:1:::0;:9:::1;:::i;:::-;5298:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;;-1:-1:-1;5338:5:33;;-1:-1:-1;5298:28:33::1;::::0;-1:-1:-1;;5298:46:33:i:1;:::-;5290:92;;;::::0;-1:-1:-1;;;5290:92:33;;13826:2:36;5290:92:33::1;::::0;::::1;13808:21:36::0;13865:2;13845:18;;;13838:30;13904:34;13884:18;;;13877:62;-1:-1:-1;;;13955:18:36;;;13948:31;13996:19;;5290:92:33::1;13624:397:36::0;5290:92:33::1;-1:-1:-1::0;;;;;5401:28:33::1;5430:14;::::0;::::1;;5446:5:::0;5453:20:::1;;::::0;::::1;5430:1:::0;5453:20:::1;:::i;:::-;5475:1;:7;;;5401:82;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5393:122;;;::::0;-1:-1:-1;;;5393:122:33;;14974:2:36;5393:122:33::1;::::0;::::1;14956:21:36::0;15013:2;14993:18;;;14986:30;15052:29;15032:18;;;15025:57;15099:18;;5393:122:33::1;14772:351:36::0;5393:122:33::1;5526:21;5550:48;5585:9;;::::0;::::1;:1:::0;:9:::1;:::i;:::-;5550:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;-1:-1:-1;5550:48:33;-1:-1:-1;5550:34:33::1;::::0;-1:-1:-1;;5550:48:33:i:1;:::-;5526:72;;5611:15;5630:30;5651:8;5630:20;:30::i;:::-;5608:52;;;5689:17;;5709:1;5689:21;;;;:::i;:::-;5678:7;:32;5670:66;;;::::0;-1:-1:-1;;;5670:66:33;;15330:2:36;5670:66:33::1;::::0;::::1;15312:21:36::0;15369:2;15349:18;;;15342:30;-1:-1:-1;;;15388:18:36;;;15381:51;15449:18;;5670:66:33::1;15128:345:36::0;5670:66:33::1;5798:19;5820:64;5856:8;5866:17;;5820:35;:64::i;:::-;5798:86;;5894:12;5909:13;:20;;;;;:::i;:::-;::::0;-1:-1:-1;5939:27:33::1;::::0;-1:-1:-1;5969:21:33::1;:6:::0;5939:27;5909:20;5969:12:::1;:21::i;:::-;5939:51;;6008:43;6021:14;6037:13;6008:43;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:12;:43::i;:::-;6000:78;;;::::0;-1:-1:-1;;;6000:78:33;;15680:2:36;6000:78:33::1;::::0;::::1;15662:21:36::0;15719:2;15699:18;;;15692:30;-1:-1:-1;;;15738:18:36;;;15731:52;15800:18;;6000:78:33::1;15478:346:36::0;6000:78:33::1;6088:20;6111:52;6124:9;:4:::0;6131:2:::1;6124:9;:::i;:::-;6152;:4:::0;6159:2:::1;6152:9;:::i;:::-;6135:6;:13;:27;;;;:::i;:::-;6111:6:::0;;:52;:12:::1;:52::i;:::-;6088:75;;6205:35;6218:7;6227:12;6205:35;;;;;:::i;:::-;6197:69;;;::::0;-1:-1:-1;;;6197:69:33;;16164:2:36;6197:69:33::1;::::0;::::1;16146:21:36::0;16203:2;16183:18;;;16176:30;-1:-1:-1;;;16222:18:36;;;16215:51;16283:18;;6197:69:33::1;15962:345:36::0;6197:69:33::1;6277:17;6297:31;6321:6;6297:23;:31::i;:::-;6344:42;::::0;;16514:25:36;;;-1:-1:-1;;;;;16575:32:36;;16570:2;16555:18;;16548:60;6370:15:33::1;16624:18:36::0;;;16617:34;6344:42:33;;16575:32:36;;-1:-1:-1;6344:42:33::1;::::0;;;;;16502:2:36;6344:42:33;;::::1;6398:12;6416:9;-1:-1:-1::0;;;;;6416:14:33::1;1088:10;6416:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6397:60;;;6475:7;6467:35;;;::::0;-1:-1:-1;;;6467:35:33;;17074:2:36;6467:35:33::1;::::0;::::1;17056:21:36::0;17113:2;17093:18;;;17086:30;-1:-1:-1;;;17132:18:36;;;17125:45;17187:18;;6467:35:33::1;16872:339:36::0;6467:35:33::1;4403:2106;;;;;;;;;;4324:2185:::0;:::o;1680:168:28:-;1733:7;;1318:27;1784:25;1187:174;2041:247;2334:13:29;:11;:13::i;:::-;1318:27:28;2197:26;;-1:-1:-1;;;;;;2197:26:28::1;-1:-1:-1::0;;;;;2197:26:28;::::1;::::0;;::::1;::::0;;2263:7:::1;:5;:7::i;:::-;-1:-1:-1::0;;;;;2238:43:28::1;;;;;;;;;;;2120:168;2041:247:::0;:::o;2658:162:29:-;966:10:31;2717:7:29;:5;:7::i;:::-;-1:-1:-1;;;;;2717:23:29;;2713:101;;2763:40;;-1:-1:-1;;;2763:40:29;;966:10:31;2763:40:29;;;1717:51:36;1690:18;;2763:40:29;1571:203:36;2472:222:28;1318:27;2621:22;;-1:-1:-1;;;;;;2621:22:28;;;2653:34;2678:8;2653:24;:34::i;:::-;2544:150;2472:222;:::o;431:320:0:-;643:7;669:75;686:7;695:4;701:3;;706:4;;712:7;;721:8;669:61;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;:73;:75::i;:::-;662:82;431:320;-1:-1:-1;;;;;;;;;;431:320:0:o;27793:991:1:-;27856:4;27872:22;27904:13;27954:17;27966:4;27954:11;:17::i;:::-;27928:43;;-1:-1:-1;27928:43:1;-1:-1:-1;28050:10:1;;;:43;;;-1:-1:-1;;28064:14:1;:29;28050:43;28046:86;;;-1:-1:-1;28116:5:1;;27793:991;-1:-1:-1;;;27793:991:1:o;28046:86::-;28142:15;28160:18;28164:14;28160:1;:18;:::i;:::-;28142:36;;28194:9;28189:492;28213:5;28209:1;:9;28189:492;;;28312:4;:11;28301:7;:22;28297:73;;-1:-1:-1;28350:5:1;;27793:991;-1:-1:-1;;;;;27793:991:1:o;28297:73::-;28445:16;28464:37;28487:4;28493:7;28464:22;:37::i;:::-;28445:56;;-1:-1:-1;;28519:8:1;:23;28515:74;;-1:-1:-1;28569:5:1;;27793:991;-1:-1:-1;;;;;;27793:991:1:o;28515:74::-;28651:19;28662:8;28651:19;;:::i;:::-;;-1:-1:-1;;28220:3:1;;28189:492;;;-1:-1:-1;28766:11:1;;28755:22;;;;;-1:-1:-1;;;27793:991:1:o;29056:1004::-;29121:4;29137:22;29169:14;29221:18;29233:5;29221:11;:18::i;:::-;29194:45;;-1:-1:-1;29194:45:1;-1:-1:-1;29319:11:1;;;:44;;;-1:-1:-1;;29334:14:1;:29;29319:44;29315:87;;;-1:-1:-1;29386:5:1;;29056:1004;-1:-1:-1;;;29056:1004:1:o;29315:87::-;29412:15;29430:18;29434:14;29430:1;:18;:::i;:::-;29412:36;;29464:9;29459:497;29483:6;29479:1;:10;29459:497;;;29583:5;:12;29572:7;:23;29568:74;;-1:-1:-1;29622:5:1;;29056:1004;-1:-1:-1;;;;;29056:1004:1:o;29568:74::-;29766:16;29785:39;29809:5;29816:7;29785:23;:39::i;:::-;29766:58;;-1:-1:-1;;29842:8:1;:23;29838:74;;-1:-1:-1;29892:5:1;;29056:1004;-1:-1:-1;;;;;;29056:1004:1:o;29838:74::-;29926:19;29937:8;29926:19;;:::i;:::-;;-1:-1:-1;;29491:3:1;;29459:497;;2414:123;2475:7;2484;2510:20;2524:2;2528:1;2510:13;:20::i;:::-;2503:27;;;;2414:123;;;:::o;1060:871:0:-;1147:4;1222:6;1232:1;1222:11;1218:54;;-1:-1:-1;1256:5:0;1249:12;;1218:54;1282:15;1317:9;1312:512;1336:6;1332:1;:10;1312:512;;;1436:8;:15;1425:7;:26;1421:77;;1478:5;1471:12;;;;;;1421:77;1573:16;1592:43;1617:8;1627:7;1592:24;:43::i;:::-;1573:62;;-1:-1:-1;;1653:8:0;:32;1649:83;;1712:5;1705:12;;;;;;;1649:83;1794:19;1805:8;1794:19;;:::i;:::-;;-1:-1:-1;;1344:3:0;;1312:512;;;-1:-1:-1;1909:15:0;;1898:26;;-1:-1:-1;1060:871:0;;;;;:::o;3420:579::-;3513:12;3537;3563:15;3598:10;3593:221;3619:6;3614:2;:11;3593:221;;;3655:43;3680:8;3690:7;3655:24;:43::i;:::-;3648:50;;-1:-1:-1;;3720:4:0;:28;3712:62;;;;-1:-1:-1;;;3712:62:0;;18276:2:36;3712:62:0;;;18258:21:36;18315:2;18295:18;;;18288:30;-1:-1:-1;;;18334:18:36;;;18327:51;18395:18;;3712:62:0;18074:345:36;3712:62:0;3788:15;3799:4;3788:15;;:::i;:::-;;-1:-1:-1;3627:5:0;;3593:221;;;;3831:43;3856:8;3866:7;3831:24;:43::i;:::-;3824:50;;-1:-1:-1;;3892:4:0;:28;3884:62;;;;-1:-1:-1;;;3884:62:0;;18276:2:36;3884:62:0;;;18258:21:36;18315:2;18295:18;;;18288:30;-1:-1:-1;;;18334:18:36;;;18327:51;18395:18;;3884:62:0;18074:345:36;3884:62:0;3963:29;:8;3978:7;3987:4;3963:14;:29::i;:::-;3956:36;3420:579;-1:-1:-1;;;;;3420:579:0:o;4360:974::-;4454:12;4478:22;4510:15;4572:30;4593:8;4572:20;:30::i;:::-;4544:58;;-1:-1:-1;4544:58:0;-1:-1:-1;4620:38:0;;;4612:85;;;;-1:-1:-1;;;4612:85:0;;18626:2:36;4612:85:0;;;18608:21:36;18665:2;18645:18;;;18638:30;18704:34;18684:18;;;18677:62;-1:-1:-1;;;18755:18:36;;;18748:32;18797:19;;4612:85:0;18424:398:36;4612:85:0;4724:7;4715:6;:16;4707:45;;;;-1:-1:-1;;;4707:45:0;;19029:2:36;4707:45:0;;;19011:21:36;19068:2;19048:18;;;19041:30;-1:-1:-1;;;19087:18:36;;;19080:46;19143:18;;4707:45:0;18827:340:36;4707:45:0;4763:16;;4811:18;4815:14;4811:1;:18;:::i;:::-;4793:36;;4845:9;4840:263;4864:6;4860:1;:10;4840:263;;;4920:41;4943:8;4953:7;4920:22;:41::i;:::-;4891:70;;-1:-1:-1;4891:70:0;-1:-1:-1;4983:32:0;;;4975:63;;;;-1:-1:-1;;;4975:63:0;;19374:2:36;4975:63:0;;;19356:21:36;19413:2;19393:18;;;19386:30;-1:-1:-1;;;19432:18:36;;;19425:48;19490:18;;4975:63:0;19172:342:36;4975:63:0;5084:8;5063:18;5067:14;5063:1;:18;:::i;:::-;:29;;;;:::i;:::-;5052:40;;;;:::i;:::-;;-1:-1:-1;4872:3:0;;4840:263;;;;5142:41;5165:8;5175:7;5142:22;:41::i;:::-;5113:70;;-1:-1:-1;5113:70:0;-1:-1:-1;5201:32:0;;;5193:63;;;;-1:-1:-1;;;5193:63:0;;19374:2:36;5193:63:0;;;19356:21:36;19413:2;19393:18;;;19386:30;-1:-1:-1;;;19432:18:36;;;19425:48;19490:18;;5193:63:0;19172:342:36;5193:63:0;5273:54;5288:7;5297:25;5308:14;5297:8;:25;:::i;:::-;:29;;5325:1;5297:29;:::i;:::-;5273:8;;:54;:14;:54::i;:::-;5266:61;4360:974;-1:-1:-1;;;;;;;4360:974:0:o;10344:924:2:-;10431:16;10463:7;10474:1;10463:12;10459:55;;-1:-1:-1;10491:12:2;;;;;;;;;-1:-1:-1;10491:12:2;;;;10459:55;10523:9;10535:16;10544:7;10535:6;:16;:::i;:::-;10523:28;;10576:6;10569:4;:13;:38;;;;;10603:4;10586:6;:13;:21;;10569:38;10561:70;;;;-1:-1:-1;;;10561:70:2;;19721:2:36;10561:70:2;;;19703:21:36;19760:2;19740:18;;;19733:30;-1:-1:-1;;;19779:18:36;;;19772:49;19838:18;;10561:70:2;19519:343:36;10561:70:2;10768:4;10762:11;10755:18;;10817:7;10812:2;10807:3;10803:12;10799:26;10793:4;10786:40;10851:7;10846:3;10839:20;10978:6;10970;10966:19;10961:3;10957:29;11054:6;11049:2;11041:6;11037:15;11033:28;11098:7;11093:3;11089:17;11000:252;11129:3;11124;11121:12;11000:252;;;11233:3;11227:10;11220:4;11215:3;11211:14;11204:34;11168:2;11163:3;11159:12;11152:19;;11000:252;;;11004:116;;;10651:611;10344:924;;;;;;:::o;8501:440:33:-;8578:11;8621:1;:8;8609:1;:8;:20;8601:53;;;;-1:-1:-1;;;8601:53:33;;20069:2:36;8601:53:33;;;20051:21:36;20108:2;20088:18;;;20081:30;-1:-1:-1;;;20127:18:36;;;20120:50;20187:18;;8601:53:33;19867:344:36;8601:53:33;8740:8;;8726:11;8758:154;8779:6;8775:1;:10;8758:154;;;8818:1;8820;8818:4;;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;;;;;8810:12:33;;:1;8812;8810:4;;;;;;;;:::i;:::-;;;;;-1:-1:-1;;;;;;8810:4:33;:12;8806:96;;8851:5;8842:14;;8874:13;;;;8806:96;8787:3;;8758:154;;;-1:-1:-1;8930:4:33;;8501:440;-1:-1:-1;;;;8501:440:33:o;8947:241::-;9025:7;9044:14;9061:13;:20;;;;;:::i;:::-;;-1:-1:-1;9091:13:33;;-1:-1:-1;9115:25:33;:7;9061:20;9137:2;9115:13;:25::i;:::-;9107:34;;;:::i;:::-;9166:14;;;8947:241;-1:-1:-1;;;;8947:241:33:o;3774:248:29:-;1313:22;3923:8;;-1:-1:-1;;;;;;3941:19:29;;-1:-1:-1;;;;;3941:19:29;;;;;;;;3975:40;;3923:8;;;;;3975:40;;3847:24;;3975:40;3837:185;;3774:248;:::o;9609:335:1:-;9670:11;9835:2;9829:4;9824:2;9818:9;9813:2;9809;9805:11;9802:1;9795:5;9784:54;9780:59;9893:2;9887:4;9883:2;9877:4;9874:1;9867:5;9856:40;-1:-1:-1;;9923:4:1;9917:11;;9609:335;-1:-1:-1;9609:335:1:o;14980:394::-;15069:7;15088:22;15120:21;15185:34;15207:6;15215:3;15185:21;:34::i;:::-;15151:68;;-1:-1:-1;15151:68:1;-1:-1:-1;15233:29:1;;;15229:78;;-1:-1:-1;;15278:18:1;;;;;;15229:78;15350:13;15324:23;15333:14;15324:6;:23;:::i;:::-;:39;;;;:::i;:::-;:43;;15366:1;15324:43;:::i;20911:536::-;21002:7;21042;21046:3;21042:1;:7;:::i;:::-;21025;:14;:24;21021:73;;;-1:-1:-1;;;21065:18:1;;21021:73;21103:22;;21212:31;21226:7;21235;21239:3;21235:1;:7;:::i;:::-;21212:13;:31::i;:::-;21172:71;;-1:-1:-1;21172:71:1;-1:-1:-1;21258:29:1;;;21254:78;;-1:-1:-1;;21303:18:1;;;;;;21254:78;21421:19;21396:22;21404:14;21396:5;:22;:::i;:::-;:44;;;;:::i;2999:704::-;3075:7;3084;3103:14;3120:36;3148:2;3152:3;3120:27;:36::i;:::-;3103:53;;3171:8;:13;;3183:1;3171:13;3167:70;;3208:1;3217:2;3220:3;3217:7;;;;;;;;:::i;:::-;;;;;3200:26;;-1:-1:-1;3217:7:1;;;-1:-1:-1;3200:26:1;;-1:-1:-1;3200:26:1;3167:70;3277:3;3262:12;3266:8;3262:1;:12;:::i;:::-;:18;;;;;;:::i;:::-;3250:2;:9;:30;3246:84;;;-1:-1:-1;;3317:1:1;3296:23;;;;;;;3246:84;3339:15;3368:8;:13;;3380:1;3368:13;3364:297;;3407:41;3428:18;3438:7;3442:3;3438:1;:7;:::i;:::-;3428:2;;:9;:18::i;:::-;7042:7;;;;;;7054;;;;;7041:21;;6959:110;3407:41;3397:51;;;;3364:297;;;3469:8;:13;;3481:1;3469:13;3465:196;;3508:41;3529:18;3539:7;3543:3;3539:1;:7;:::i;3529:18::-;6397:21;;;;;;6402:10;6360:6;;;;;6359:21;;;;6358:61;6485:2;6480:7;;;6468;;;6467:21;;6238:257;3508:41;3498:51;;;;3465:196;;;3570:8;:13;;3582:1;3570:13;3566:95;;3609:41;3630:18;3640:7;3644:3;3640:1;:7;:::i;3630:18::-;3623:26;;5965:22;5866:1;5793:6;;;5965:22;;;;5838:29;;;;5965:22;;;;5992:2;5964:30;;;5838:29;6056:7;5843:18;5792:29;;;;5838;;;;5791:77;;;;5918:7;;;5969:18;5917:30;6056:7;6061:2;6044:7;;;6056;;;6043:21;;5671:400;3609:41;3599:51;;;;3566:95;3670:26;;;;;-1:-1:-1;3688:7:1;-1:-1:-1;2999:704:1;;;;;;:::o;2254:783:0:-;2347:7;2366:22;2398:20;2470:37;2493:8;2503:3;2470:22;:37::i;:::-;2437:70;;-1:-1:-1;2437:70:0;-1:-1:-1;2521:38:0;;;2517:96;;-1:-1:-1;;2575:27:0;;;;;;2517:96;2623:16;;2667:18;2671:14;2667:1;:18;:::i;:::-;2649:36;;2701:9;2696:310;2720:12;2716:1;:16;2696:310;;;2782:47;2805:8;2815:13;2821:7;2815:3;:13;:::i;2782:47::-;2753:76;;-1:-1:-1;2753:76:0;-1:-1:-1;2847:32:0;;;2843:98;;-1:-1:-1;;2899:27:0;;;;;;;;;2843:98;2987:8;2966:18;2970:14;2966:1;:18;:::i;:::-;:29;;;;:::i;:::-;2955:40;;;;:::i;:::-;;-1:-1:-1;2734:3:0;;2696:310;;;-1:-1:-1;3023:7:0;2254:783;-1:-1:-1;;;;;;2254:783:0:o;13785:388:1:-;13873:7;;13921:8;13926:3;13921:2;:8;:::i;:::-;13905:6;:13;:24;13901:78;;;-1:-1:-1;;;654:66:1;-1:-1:-1;13966:1:1;13945:23;;13901:78;13989:22;;14086:31;14100:6;14108:8;:3;14114:2;14108:8;:::i;14086:31::-;14052:65;;;;-1:-1:-1;13785:388:1;-1:-1:-1;;;;;13785:388:1:o;1550:446::-;1640:5;1667:2;1670:3;1667:7;;;;;;;;:::i;:::-;;;;;;;1661:14;:22;1657:93;;-1:-1:-1;1706:1:1;1699:8;;1657:93;1769:2;1772:3;1769:7;;;;;;;;:::i;:::-;;;;;;;1781:4;1763:22;1759:93;;-1:-1:-1;1808:1:1;1801:8;;1759:93;1871:2;1874:3;1871:7;;;;;;;;:::i;:::-;;;;;;;1883:4;1865:22;1861:93;;-1:-1:-1;1910:1:1;1903:8;;1861:93;-1:-1:-1;1971:1:1;1550:446;;;;:::o;13493:136:2:-;13566:6;13598:23;13606:6;13614;12550:28;12566:2;12550:28;12544:35;;12417:178;206:347:36;257:8;267:6;321:3;314:4;306:6;302:17;298:27;288:55;;339:1;336;329:12;288:55;-1:-1:-1;362:20:36;;405:18;394:30;;391:50;;;437:1;434;427:12;391:50;474:4;466:6;462:17;450:29;;526:3;519:4;510:6;502;498:19;494:30;491:39;488:59;;;543:1;540;533:12;558:826;657:6;665;673;681;689;742:2;730:9;721:7;717:23;713:32;710:52;;;758:1;755;748:12;710:52;798:9;785:23;831:18;823:6;820:30;817:50;;;863:1;860;853:12;817:50;902:58;952:7;943:6;932:9;928:22;902:58;:::i;:::-;979:8;;-1:-1:-1;876:84:36;-1:-1:-1;;1067:2:36;1052:18;;1039:32;1096:18;1083:32;;1080:52;;;1128:1;1125;1118:12;1080:52;1167:60;1219:7;1208:8;1197:9;1193:24;1167:60;:::i;:::-;558:826;;;;-1:-1:-1;1246:8:36;1350:2;1335:18;1322:32;;558:826;-1:-1:-1;;;;558:826:36:o;1779:610::-;1865:6;1873;1926:2;1914:9;1905:7;1901:23;1897:32;1894:52;;;1942:1;1939;1932:12;1894:52;1982:9;1969:23;2015:18;2007:6;2004:30;2001:50;;;2047:1;2044;2037:12;2001:50;2070:22;;2123:4;2115:13;;2111:27;-1:-1:-1;2101:55:36;;2152:1;2149;2142:12;2101:55;2192:2;2179:16;2218:18;2210:6;2207:30;2204:50;;;2250:1;2247;2240:12;2204:50;2303:7;2298:2;2288:6;2285:1;2281:14;2277:2;2273:23;2269:32;2266:45;2263:65;;;2324:1;2321;2314:12;2263:65;2355:2;2347:11;;;;;2377:6;;-1:-1:-1;1779:610:36;-1:-1:-1;;;1779:610:36:o;2394:180::-;2453:6;2506:2;2494:9;2485:7;2481:23;2477:32;2474:52;;;2522:1;2519;2512:12;2474:52;-1:-1:-1;2545:23:36;;2394:180;-1:-1:-1;2394:180:36:o;2579:525::-;2726:2;2715:9;2708:21;2689:4;2758:6;2752:13;2801:6;2796:2;2785:9;2781:18;2774:34;2826:1;2836:140;2850:6;2847:1;2844:13;2836:140;;;2961:2;2945:14;;;2941:23;;2935:30;2930:2;2911:17;;;2907:26;2900:66;2865:10;2836:140;;;2840:3;3025:1;3020:2;3011:6;3000:9;2996:22;2992:31;2985:42;3095:2;3088;3084:7;3079:2;3071:6;3067:15;3063:29;3052:9;3048:45;3044:54;3036:62;;;2579:525;;;;:::o;3109:286::-;3168:6;3221:2;3209:9;3200:7;3196:23;3192:32;3189:52;;;3237:1;3234;3227:12;3189:52;3263:23;;-1:-1:-1;;;;;3315:31:36;;3305:42;;3295:70;;3361:1;3358;3351:12;3813:394;3906:6;3959:2;3947:9;3938:7;3934:23;3930:32;3927:52;;;3975:1;3972;3965:12;3927:52;4015:9;4002:23;4048:18;4040:6;4037:30;4034:50;;;4080:1;4077;4070:12;4034:50;4103:22;;4159:3;4141:16;;;4137:26;4134:46;;;4176:1;4173;4166:12;5882:127;5943:10;5938:3;5934:20;5931:1;5924:31;5974:4;5971:1;5964:15;5998:4;5995:1;5988:15;6014:380;6093:1;6089:12;;;;6136;;;6157:61;;6211:4;6203:6;6199:17;6189:27;;6157:61;6264:2;6256:6;6253:14;6233:18;6230:38;6227:161;;6310:10;6305:3;6301:20;6298:1;6291:31;6345:4;6342:1;6335:15;6373:4;6370:1;6363:15;6227:161;;6014:380;;;:::o;6524:517::-;6625:2;6620:3;6617:11;6614:421;;;6661:5;6658:1;6651:16;6705:4;6702:1;6692:18;6775:2;6763:10;6759:19;6756:1;6752:27;6746:4;6742:38;6811:4;6799:10;6796:20;6793:47;;;-1:-1:-1;6834:4:36;6793:47;6889:2;6884:3;6880:12;6877:1;6873:20;6867:4;6863:31;6853:41;;6944:81;6962:2;6955:5;6952:13;6944:81;;;7021:1;7007:16;;6988:1;6977:13;6944:81;;;6948:3;;6614:421;6524:517;;;:::o;7217:1202::-;7339:18;7334:3;7331:27;7328:53;;;7361:18;;:::i;:::-;7390:93;7479:3;7439:38;7471:4;7465:11;7439:38;:::i;:::-;7433:4;7390:93;:::i;:::-;7509:1;7534:2;7529:3;7526:11;7551:1;7546:615;;;;8205:1;8222:3;8219:93;;;-1:-1:-1;8278:19:36;;;8265:33;8219:93;-1:-1:-1;;7174:1:36;7170:11;;;7166:24;7162:29;7152:40;7198:1;7194:11;;;7149:57;8325:78;;7519:894;;7546:615;6471:1;6464:14;;;6508:4;6495:18;;-1:-1:-1;;7582:17:36;;;7682:9;7704:229;7718:7;7715:1;7712:14;7704:229;;;7807:19;;;7794:33;7779:49;;7914:4;7899:20;;;;7867:1;7855:14;;;;7734:12;7704:229;;;7708:3;7961;7952:7;7949:16;7946:159;;;8085:1;8081:6;8075:3;8069;8066:1;8062:11;8058:21;8054:34;8050:39;8037:9;8032:3;8028:19;8015:33;8011:79;8003:6;7996:95;7946:159;;;8148:1;8142:3;8139:1;8135:11;8131:19;8125:4;8118:33;7519:894;;7217:1202;;;:::o;8729:266::-;8817:6;8812:3;8805:19;8869:6;8862:5;8855:4;8850:3;8846:14;8833:43;-1:-1:-1;8921:1:36;8896:16;;;8914:4;8892:27;;;8885:38;;;;8977:2;8956:15;;;-1:-1:-1;;8952:29:36;8943:39;;;8939:50;;8729:266::o;9000:502::-;9241:2;9230:9;9223:21;9204:4;9267:61;9324:2;9313:9;9309:18;9301:6;9293;9267:61;:::i;:::-;9376:9;9368:6;9364:22;9359:2;9348:9;9344:18;9337:50;9404:49;9446:6;9438;9430;9404:49;:::i;:::-;9396:57;;;9489:6;9484:2;9473:9;9469:18;9462:34;9000:502;;;;;;;;:::o;9507:127::-;9568:10;9563:3;9559:20;9556:1;9549:31;9599:4;9596:1;9589:15;9623:4;9620:1;9613:15;9639:168;9712:9;;;9743;;9760:15;;;9754:22;;9740:37;9730:71;;9781:18;;:::i;10164:127::-;10225:10;10220:3;10216:20;10213:1;10206:31;10256:4;10253:1;10246:15;10280:4;10277:1;10270:15;10296:125;10361:9;;;10382:10;;;10379:36;;;10395:18;;:::i;11105:286::-;11163:6;11216:2;11204:9;11195:7;11191:23;11187:32;11184:52;;;11232:1;11229;11222:12;11184:52;11258:23;;-1:-1:-1;;;;;;11310:32:36;;11300:43;;11290:71;;11357:1;11354;11347:12;11396:281;11454:6;11507:2;11495:9;11486:7;11482:23;11478:32;11475:52;;;11523:1;11520;11513:12;11475:52;11549:23;;-1:-1:-1;;;;;;11601:27:36;;11591:38;;11581:66;;11643:1;11640;11633:12;11682:521;11759:4;11765:6;11825:11;11812:25;11919:2;11915:7;11904:8;11888:14;11884:29;11880:43;11860:18;11856:68;11846:96;;11938:1;11935;11928:12;11846:96;11965:33;;12017:20;;;-1:-1:-1;12060:18:36;12049:30;;12046:50;;;12092:1;12089;12082:12;12046:50;12125:4;12113:17;;-1:-1:-1;12156:14:36;12152:27;;;12142:38;;12139:58;;;12193:1;12190;12183:12;14026:459;14267:6;14256:9;14249:25;14310:6;14305:2;14294:9;14290:18;14283:34;14353:3;14348:2;14337:9;14333:18;14326:31;14230:4;14374:62;14431:3;14420:9;14416:19;14408:6;14400;14374:62;:::i;:::-;14366:70;;14472:6;14467:2;14456:9;14452:18;14445:34;14026:459;;;;;;;;:::o;14490:277::-;14557:6;14610:2;14598:9;14589:7;14585:23;14581:32;14578:52;;;14626:1;14623;14616:12;14578:52;14658:9;14652:16;14711:5;14704:13;14697:21;14690:5;14687:32;14677:60;;14733:1;14730;14723:12;15829:128;15896:9;;;15917:11;;;15914:37;;;15931:18;;:::i;17216:853::-;-1:-1:-1;;;;;;17575:33:36;;17563:46;;-1:-1:-1;;;;;;17638:28:36;;17634:1;17625:11;;17618:49;17710:6;17702;17698:1;17689:11;;17676:41;17545:3;17745:6;17740:3;17736:16;17779:1;17775:2;17771:10;17801:1;17797:2;17790:13;17837:6;17829;17825:2;17812:32;-1:-1:-1;17906:1:36;17867:15;;;17884:1;17863:23;17895:13;;;17942:6;17934;17863:23;17917:32;-1:-1:-1;;;;;;18003:33:36;;;;17968:15;;;;17992:45;;;-1:-1:-1;18061:1:36;18053:10;;17216:853;-1:-1:-1;;;;;;;;17216:853:36:o;20216:412::-;20334:12;;20382:4;20371:16;;20365:23;-1:-1:-1;;20406:40:36;;;20334:12;20469:2;20458:14;;20455:167;;;20584:26;20580:31;20549:26;20545:31;20535:6;20531:2;20527:15;20524:1;20520:23;20516:61;20512:2;20508:70;20504:108;20495:117;;20455:167;;;20216:412;;;:::o;20633:148::-;20721:4;20700:12;;;20714;;;20696:31;;20739:13;;20736:39;;;20755:18;;:::i","linkReferences":{}},"methodIdentifiers":{"DEPOSIT_AMOUNT()":"ec6925a7","LIGHT_CLIENT()":"e613ae00","SYSTEM_CALLER()":"d761753e","acceptOwnership()":"79ba5097","batchWithdraw(bytes32[])":"59c19cee","deposit((bytes4,bytes2,bytes,bytes,bytes,bytes4,bytes,uint256,uint256))":"dd95c7c6","depositScript()":"b93780f6","getWithdrawalCount()":"781952a8","initialize(bytes,bytes,uint256)":"41260137","initialized()":"158ef93e","operator()":"570ca735","owner()":"8da5cb5b","pendingOwner()":"e30c3978","renounceOwnership()":"715018a6","requiredSigsCount()":"43e31687","scriptSuffix()":"87f8bf56","setDepositScript(bytes,bytes,uint256)":"9f963f59","setOperator(address)":"b3ab15fb","spentWtxIds(bytes32)":"5e0e5b3e","transferOwnership(address)":"f2fde38b","withdraw(bytes32)":"8e19899e","withdrawalAddrs(uint256)":"d1c44456"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.26+commit.8a97fa7a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"wtxId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"depositScript\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"scriptSuffix\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requiredSigsCount\",\"type\":\"uint256\"}],\"name\":\"DepositScriptUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldOperator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOperator\",\"type\":\"address\"}],\"name\":\"OperatorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"bitcoin_address\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEPOSIT_AMOUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LIGHT_CLIENT\",\"outputs\":[{\"internalType\":\"contract BitcoinLightClient\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SYSTEM_CALLER\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"bitcoin_addresses\",\"type\":\"bytes32[]\"}],\"name\":\"batchWithdraw\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes2\",\"name\":\"flag\",\"type\":\"bytes2\"},{\"internalType\":\"bytes\",\"name\":\"vin\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"vout\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"witness\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"intermediate_nodes\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"block_height\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"internalType\":\"struct Bridge.DepositParams\",\"name\":\"p\",\"type\":\"tuple\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositScript\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWithdrawalCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_depositScript\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_scriptSuffix\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_requiredSigsCount\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"operator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"requiredSigsCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"scriptSuffix\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_depositScript\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_scriptSuffix\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_requiredSigsCount\",\"type\":\"uint256\"}],\"name\":\"setDepositScript\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_operator\",\"type\":\"address\"}],\"name\":\"setOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"spentWtxIds\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"bitcoin_address\",\"type\":\"bytes32\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"withdrawalAddrs\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Citrea\",\"errors\":{\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"batchWithdraw(bytes32[])\":{\"details\":\"Takes in multiple Bitcoin addresses as recipient addresses should be unique\",\"params\":{\"bitcoin_addresses\":\"The Bitcoin addresses of the receivers\"}},\"deposit((bytes4,bytes2,bytes,bytes,bytes,bytes4,bytes,uint256,uint256))\":{\"params\":{\"p\":\"The deposit parameters that contains the info of the deposit transaction on Bitcoin\"}},\"getWithdrawalCount()\":{\"returns\":{\"_0\":\"The count of withdrawals happened so far\"}},\"initialize(bytes,bytes,uint256)\":{\"params\":{\"_depositScript\":\"The deposit script expected in the witness field for all L1 deposits\",\"_requiredSigsCount\":\"The number of signatures that is contained in the deposit script\",\"_scriptSuffix\":\"The suffix of the deposit script that follows the receiver address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"setDepositScript(bytes,bytes,uint256)\":{\"details\":\"Deposit script contains a fixed script that checks signatures of verifiers and pushes EVM address of the receiver\",\"params\":{\"_depositScript\":\"The new deposit script\",\"_requiredSigsCount\":\"The number of signatures that are needed for deposit transaction\",\"_scriptSuffix\":\"The part of the deposit script that succeeds the receiver address\"}},\"setOperator(address)\":{\"params\":{\"_operator\":\"Address of the privileged operator\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"},\"withdraw(bytes32)\":{\"params\":{\"bitcoin_address\":\"The Bitcoin address of the receiver\"}}},\"title\":\"Bridge contract for the Citrea end of Citrea <> Bitcoin bridge\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"batchWithdraw(bytes32[])\":{\"notice\":\"Batch version of `withdraw` that can accept multiple cBTC\"},\"deposit((bytes4,bytes2,bytes,bytes,bytes,bytes4,bytes,uint256,uint256))\":{\"notice\":\"Checks if the deposit amount is sent to the bridge multisig on Bitcoin, and if so, sends the deposit amount to the receiver\"},\"initialize(bytes,bytes,uint256)\":{\"notice\":\"Initializes the bridge contract and sets the deposit script\"},\"setDepositScript(bytes,bytes,uint256)\":{\"notice\":\"Sets the expected deposit script of the deposit transaction on Bitcoin, contained in the witness\"},\"setOperator(address)\":{\"notice\":\"Sets the operator address that can process user deposits\"},\"withdraw(bytes32)\":{\"notice\":\"Accepts 1 cBTC from the sender and inserts this withdrawal request of 1 BTC on Bitcoin into the withdrawals array so that later on can be processed by the operator \"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/Bridge.sol\":\"Bridge\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"appendCBOR\":false,\"bytecodeHash\":\"none\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\",\":@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/\",\":bitcoin-spv/=lib/bitcoin-spv/\",\":ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/openzeppelin-contracts/contracts/\"]},\"sources\":{\"lib/WitnessUtils.sol\":{\"keccak256\":\"0x0b0d59b4e73d6f5b4bbf1032f72bb15c2f1548c2ee319b80ae9e4c22576a70af\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://8499a5fc520941cb1b970637850cabfbc2d5a51abed824886063420c686b57de\",\"dweb:/ipfs/QmaLYLJ36PyFAaP3MgvFWW3knDsSUtVfCfs7Lp7oYFPZ1w\"]},\"lib/bitcoin-spv/solidity/contracts/BTCUtils.sol\":{\"keccak256\":\"0x439eaa97e9239705f3d31e8d39dccbad32311f1f119e295d53c65e0ae3c5a5fc\",\"urls\":[\"bzz-raw://976a361a89c21afc44b5e0a552271d9288b12cf34a9925c25f3c6975ece4e667\",\"dweb:/ipfs/QmNTb4eJyxV5iZj8RJGFBGSKXWsuvoMYqLLBgk16dhWePH\"]},\"lib/bitcoin-spv/solidity/contracts/BytesLib.sol\":{\"keccak256\":\"0x43e0f3b3b23c861bd031588bf410dfdd02e2af17941a89aa38d70e534e0380d1\",\"urls\":[\"bzz-raw://76011d699a8b229dbfdc698b3ece658daad9d96778e86d679aa576bc966209d6\",\"dweb:/ipfs/QmRZEWAeRQtsTUvfzEd1jb2wAqpTNR5KAme92gBRn4SYiT\"]},\"lib/bitcoin-spv/solidity/contracts/SafeMath.sol\":{\"keccak256\":\"0x35930d982394c7ffde439b82e5e696c5b21a6f09699d44861dfe409ef64084a3\",\"urls\":[\"bzz-raw://090e9d78755d4916fa2f5f5d8f9fd2fc59bfc5a25a5e91636a92c4c07aee9c6b\",\"dweb:/ipfs/QmXfz4TPDvgnuYz9eS5AL87GfCLxHQZJV1Y8ieJU9M8yTe\"]},\"lib/bitcoin-spv/solidity/contracts/ValidateSPV.sol\":{\"keccak256\":\"0xce3febbf3ad3a7ff8a8effd0c7ccaf7ccfa2719578b537d49ea196f0bae8062b\",\"urls\":[\"bzz-raw://5f18942483bf20507ae6c0abb5421df96b1aebb7af15f541bda8470f6277312a\",\"dweb:/ipfs/QmPzEpA8w5k6pVFadm3UCLqNdxFAjPwP9Lpi5HMQsQg52J\"]},\"lib/openzeppelin-contracts-upgradeable/contracts/access/Ownable2StepUpgradeable.sol\":{\"keccak256\":\"0xbca4a4f66d98028293dba695851d1b20d3e0ba2fff7453fb241f192fa3fc6b6f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://013b3cfd9d1e34dad409c3b9a340860e8651e61cda509de33599fb5102f62fe7\",\"dweb:/ipfs/QmTVjDKofM9Nst8w8LAA3HHgi1eCnGYBpFb7Nbat71e2xz\"]},\"lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\":{\"keccak256\":\"0xc163fcf9bb10138631a9ba5564df1fa25db9adff73bd9ee868a8ae1858fe093a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9706d43a0124053d9880f6e31a59f31bc0a6a3dc1acd66ce0a16e1111658c5f6\",\"dweb:/ipfs/QmUFmfowzkRwGtDu36cXV9SPTBHJ3n7dG9xQiK5B28jTf2\"]},\"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol\":{\"keccak256\":\"0x631188737069917d2f909d29ce62c4d48611d326686ba6683e26b72a23bfac0b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7a61054ae84cd6c4d04c0c4450ba1d6de41e27e0a2c4f1bcdf58f796b401c609\",\"dweb:/ipfs/QmUvtdp7X1mRVyC3CsHrtPbgoqWaXHp3S1ZR24tpAQYJWM\"]},\"lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol\":{\"keccak256\":\"0xdbef5f0c787055227243a7318ef74c8a5a1108ca3a07f2b3a00ef67769e1e397\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://08e39f23d5b4692f9a40803e53a8156b72b4c1f9902a88cd65ba964db103dab9\",\"dweb:/ipfs/QmPKn6EYDgpga7KtpkA8wV2yJCYGMtc9K4LkJfhKX2RVSV\"]},\"src/BitcoinLightClient.sol\":{\"keccak256\":\"0x9c8acc0e16c7a02b3328bf41cf08922b43f1eaf780199a0cf4aefac61ad2528c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ac95a3440699da490d6830aec1ad4d515d7bba605be570767b39cf7fbdd182e7\",\"dweb:/ipfs/QmUt8FcufKn5afs1n2cf2JF1wwti1pDSaNnxDzJNRcqyWf\"]},\"src/Bridge.sol\":{\"keccak256\":\"0xa7a2f7cacb08eeba59342258e4b417ad64b176848ab1a8a08690075f98b8bcf4\",\"license\":\"UNLICENSED\",\"urls\":[\"bzz-raw://07344bad000cfba385638a58f9a856148b0255c00101ee66bd10a97528c00707\",\"dweb:/ipfs/QmWt9Y3fbhufjjr6TbAt1y6aWYLSaRRSCXY49Ng5EXNoLz\"]},\"src/interfaces/IBitcoinLightClient.sol\":{\"keccak256\":\"0x7b7bce470657991ad77890c0f9a3e01570279e6143038ed1b6f82f783feea33a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://52c1a77b309c61d34eb39b8a77fd5a5f8c154e50fd60db3007f5049d6b06b650\",\"dweb:/ipfs/QmdHbULcAzZtD7u55bkQ8D9FEPMRvy1jgwNC3pFxHtiUfL\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.26+commit.8a97fa7a"},"language":"Solidity","output":{"abi":[{"inputs":[],"type":"error","name":"InvalidInitialization"},{"inputs":[],"type":"error","name":"NotInitializing"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"type":"error","name":"OwnableInvalidOwner"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"type":"error","name":"OwnableUnauthorizedAccount"},{"inputs":[{"internalType":"bytes32","name":"wtxId","type":"bytes32","indexed":false},{"internalType":"address","name":"recipient","type":"address","indexed":false},{"internalType":"uint256","name":"timestamp","type":"uint256","indexed":false}],"type":"event","name":"Deposit","anonymous":false},{"inputs":[{"internalType":"bytes","name":"depositScript","type":"bytes","indexed":false},{"internalType":"bytes","name":"scriptSuffix","type":"bytes","indexed":false},{"internalType":"uint256","name":"requiredSigsCount","type":"uint256","indexed":false}],"type":"event","name":"DepositScriptUpdate","anonymous":false},{"inputs":[{"internalType":"uint64","name":"version","type":"uint64","indexed":false}],"type":"event","name":"Initialized","anonymous":false},{"inputs":[{"internalType":"address","name":"oldOperator","type":"address","indexed":false},{"internalType":"address","name":"newOperator","type":"address","indexed":false}],"type":"event","name":"OperatorUpdated","anonymous":false},{"inputs":[{"internalType":"address","name":"previousOwner","type":"address","indexed":true},{"internalType":"address","name":"newOwner","type":"address","indexed":true}],"type":"event","name":"OwnershipTransferStarted","anonymous":false},{"inputs":[{"internalType":"address","name":"previousOwner","type":"address","indexed":true},{"internalType":"address","name":"newOwner","type":"address","indexed":true}],"type":"event","name":"OwnershipTransferred","anonymous":false},{"inputs":[{"internalType":"bytes32","name":"bitcoin_address","type":"bytes32","indexed":false},{"internalType":"uint256","name":"index","type":"uint256","indexed":false},{"internalType":"uint256","name":"timestamp","type":"uint256","indexed":false}],"type":"event","name":"Withdrawal","anonymous":false},{"inputs":[],"stateMutability":"view","type":"function","name":"DEPOSIT_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"LIGHT_CLIENT","outputs":[{"internalType":"contract BitcoinLightClient","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"SYSTEM_CALLER","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"nonpayable","type":"function","name":"acceptOwnership"},{"inputs":[{"internalType":"bytes32[]","name":"bitcoin_addresses","type":"bytes32[]"}],"stateMutability":"payable","type":"function","name":"batchWithdraw"},{"inputs":[{"internalType":"struct Bridge.DepositParams","name":"p","type":"tuple","components":[{"internalType":"bytes4","name":"version","type":"bytes4"},{"internalType":"bytes2","name":"flag","type":"bytes2"},{"internalType":"bytes","name":"vin","type":"bytes"},{"internalType":"bytes","name":"vout","type":"bytes"},{"internalType":"bytes","name":"witness","type":"bytes"},{"internalType":"bytes4","name":"locktime","type":"bytes4"},{"internalType":"bytes","name":"intermediate_nodes","type":"bytes"},{"internalType":"uint256","name":"block_height","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}]}],"stateMutability":"nonpayable","type":"function","name":"deposit"},{"inputs":[],"stateMutability":"view","type":"function","name":"depositScript","outputs":[{"internalType":"bytes","name":"","type":"bytes"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"getWithdrawalCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[{"internalType":"bytes","name":"_depositScript","type":"bytes"},{"internalType":"bytes","name":"_scriptSuffix","type":"bytes"},{"internalType":"uint256","name":"_requiredSigsCount","type":"uint256"}],"stateMutability":"nonpayable","type":"function","name":"initialize"},{"inputs":[],"stateMutability":"view","type":"function","name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"nonpayable","type":"function","name":"renounceOwnership"},{"inputs":[],"stateMutability":"view","type":"function","name":"requiredSigsCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"scriptSuffix","outputs":[{"internalType":"bytes","name":"","type":"bytes"}]},{"inputs":[{"internalType":"bytes","name":"_depositScript","type":"bytes"},{"internalType":"bytes","name":"_scriptSuffix","type":"bytes"},{"internalType":"uint256","name":"_requiredSigsCount","type":"uint256"}],"stateMutability":"nonpayable","type":"function","name":"setDepositScript"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"setOperator"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function","name":"spentWtxIds","outputs":[{"internalType":"bool","name":"","type":"bool"}]},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"transferOwnership"},{"inputs":[{"internalType":"bytes32","name":"bitcoin_address","type":"bytes32"}],"stateMutability":"payable","type":"function","name":"withdraw"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function","name":"withdrawalAddrs","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]}],"devdoc":{"kind":"dev","methods":{"acceptOwnership()":{"details":"The new owner accepts the ownership transfer."},"batchWithdraw(bytes32[])":{"details":"Takes in multiple Bitcoin addresses as recipient addresses should be unique","params":{"bitcoin_addresses":"The Bitcoin addresses of the receivers"}},"deposit((bytes4,bytes2,bytes,bytes,bytes,bytes4,bytes,uint256,uint256))":{"params":{"p":"The deposit parameters that contains the info of the deposit transaction on Bitcoin"}},"getWithdrawalCount()":{"returns":{"_0":"The count of withdrawals happened so far"}},"initialize(bytes,bytes,uint256)":{"params":{"_depositScript":"The deposit script expected in the witness field for all L1 deposits","_requiredSigsCount":"The number of signatures that is contained in the deposit script","_scriptSuffix":"The suffix of the deposit script that follows the receiver address"}},"owner()":{"details":"Returns the address of the current owner."},"pendingOwner()":{"details":"Returns the address of the pending owner."},"renounceOwnership()":{"details":"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner."},"setDepositScript(bytes,bytes,uint256)":{"details":"Deposit script contains a fixed script that checks signatures of verifiers and pushes EVM address of the receiver","params":{"_depositScript":"The new deposit script","_requiredSigsCount":"The number of signatures that are needed for deposit transaction","_scriptSuffix":"The part of the deposit script that succeeds the receiver address"}},"setOperator(address)":{"params":{"_operator":"Address of the privileged operator"}},"transferOwnership(address)":{"details":"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner."},"withdraw(bytes32)":{"params":{"bitcoin_address":"The Bitcoin address of the receiver"}}},"version":1},"userdoc":{"kind":"user","methods":{"batchWithdraw(bytes32[])":{"notice":"Batch version of `withdraw` that can accept multiple cBTC"},"deposit((bytes4,bytes2,bytes,bytes,bytes,bytes4,bytes,uint256,uint256))":{"notice":"Checks if the deposit amount is sent to the bridge multisig on Bitcoin, and if so, sends the deposit amount to the receiver"},"initialize(bytes,bytes,uint256)":{"notice":"Initializes the bridge contract and sets the deposit script"},"setDepositScript(bytes,bytes,uint256)":{"notice":"Sets the expected deposit script of the deposit transaction on Bitcoin, contained in the witness"},"setOperator(address)":{"notice":"Sets the operator address that can process user deposits"},"withdraw(bytes32)":{"notice":"Accepts 1 cBTC from the sender and inserts this withdrawal request of 1 BTC on Bitcoin into the withdrawals array so that later on can be processed by the operator "}},"version":1}},"settings":{"remappings":["@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/","@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/","bitcoin-spv/=lib/bitcoin-spv/","ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/","forge-std/=lib/forge-std/src/","openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/","openzeppelin-contracts/=lib/openzeppelin-contracts/","openzeppelin/=lib/openzeppelin-contracts/contracts/"],"optimizer":{"enabled":true,"runs":200},"metadata":{"bytecodeHash":"none","appendCBOR":false},"compilationTarget":{"src/Bridge.sol":"Bridge"},"evmVersion":"paris","libraries":{}},"sources":{"lib/WitnessUtils.sol":{"keccak256":"0x0b0d59b4e73d6f5b4bbf1032f72bb15c2f1548c2ee319b80ae9e4c22576a70af","urls":["bzz-raw://8499a5fc520941cb1b970637850cabfbc2d5a51abed824886063420c686b57de","dweb:/ipfs/QmaLYLJ36PyFAaP3MgvFWW3knDsSUtVfCfs7Lp7oYFPZ1w"],"license":"LGPL-3.0-or-later"},"lib/bitcoin-spv/solidity/contracts/BTCUtils.sol":{"keccak256":"0x439eaa97e9239705f3d31e8d39dccbad32311f1f119e295d53c65e0ae3c5a5fc","urls":["bzz-raw://976a361a89c21afc44b5e0a552271d9288b12cf34a9925c25f3c6975ece4e667","dweb:/ipfs/QmNTb4eJyxV5iZj8RJGFBGSKXWsuvoMYqLLBgk16dhWePH"],"license":null},"lib/bitcoin-spv/solidity/contracts/BytesLib.sol":{"keccak256":"0x43e0f3b3b23c861bd031588bf410dfdd02e2af17941a89aa38d70e534e0380d1","urls":["bzz-raw://76011d699a8b229dbfdc698b3ece658daad9d96778e86d679aa576bc966209d6","dweb:/ipfs/QmRZEWAeRQtsTUvfzEd1jb2wAqpTNR5KAme92gBRn4SYiT"],"license":null},"lib/bitcoin-spv/solidity/contracts/SafeMath.sol":{"keccak256":"0x35930d982394c7ffde439b82e5e696c5b21a6f09699d44861dfe409ef64084a3","urls":["bzz-raw://090e9d78755d4916fa2f5f5d8f9fd2fc59bfc5a25a5e91636a92c4c07aee9c6b","dweb:/ipfs/QmXfz4TPDvgnuYz9eS5AL87GfCLxHQZJV1Y8ieJU9M8yTe"],"license":null},"lib/bitcoin-spv/solidity/contracts/ValidateSPV.sol":{"keccak256":"0xce3febbf3ad3a7ff8a8effd0c7ccaf7ccfa2719578b537d49ea196f0bae8062b","urls":["bzz-raw://5f18942483bf20507ae6c0abb5421df96b1aebb7af15f541bda8470f6277312a","dweb:/ipfs/QmPzEpA8w5k6pVFadm3UCLqNdxFAjPwP9Lpi5HMQsQg52J"],"license":null},"lib/openzeppelin-contracts-upgradeable/contracts/access/Ownable2StepUpgradeable.sol":{"keccak256":"0xbca4a4f66d98028293dba695851d1b20d3e0ba2fff7453fb241f192fa3fc6b6f","urls":["bzz-raw://013b3cfd9d1e34dad409c3b9a340860e8651e61cda509de33599fb5102f62fe7","dweb:/ipfs/QmTVjDKofM9Nst8w8LAA3HHgi1eCnGYBpFb7Nbat71e2xz"],"license":"MIT"},"lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol":{"keccak256":"0xc163fcf9bb10138631a9ba5564df1fa25db9adff73bd9ee868a8ae1858fe093a","urls":["bzz-raw://9706d43a0124053d9880f6e31a59f31bc0a6a3dc1acd66ce0a16e1111658c5f6","dweb:/ipfs/QmUFmfowzkRwGtDu36cXV9SPTBHJ3n7dG9xQiK5B28jTf2"],"license":"MIT"},"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol":{"keccak256":"0x631188737069917d2f909d29ce62c4d48611d326686ba6683e26b72a23bfac0b","urls":["bzz-raw://7a61054ae84cd6c4d04c0c4450ba1d6de41e27e0a2c4f1bcdf58f796b401c609","dweb:/ipfs/QmUvtdp7X1mRVyC3CsHrtPbgoqWaXHp3S1ZR24tpAQYJWM"],"license":"MIT"},"lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol":{"keccak256":"0xdbef5f0c787055227243a7318ef74c8a5a1108ca3a07f2b3a00ef67769e1e397","urls":["bzz-raw://08e39f23d5b4692f9a40803e53a8156b72b4c1f9902a88cd65ba964db103dab9","dweb:/ipfs/QmPKn6EYDgpga7KtpkA8wV2yJCYGMtc9K4LkJfhKX2RVSV"],"license":"MIT"},"src/BitcoinLightClient.sol":{"keccak256":"0x9c8acc0e16c7a02b3328bf41cf08922b43f1eaf780199a0cf4aefac61ad2528c","urls":["bzz-raw://ac95a3440699da490d6830aec1ad4d515d7bba605be570767b39cf7fbdd182e7","dweb:/ipfs/QmUt8FcufKn5afs1n2cf2JF1wwti1pDSaNnxDzJNRcqyWf"],"license":"MIT"},"src/Bridge.sol":{"keccak256":"0xa7a2f7cacb08eeba59342258e4b417ad64b176848ab1a8a08690075f98b8bcf4","urls":["bzz-raw://07344bad000cfba385638a58f9a856148b0255c00101ee66bd10a97528c00707","dweb:/ipfs/QmWt9Y3fbhufjjr6TbAt1y6aWYLSaRRSCXY49Ng5EXNoLz"],"license":"UNLICENSED"},"src/interfaces/IBitcoinLightClient.sol":{"keccak256":"0x7b7bce470657991ad77890c0f9a3e01570279e6143038ed1b6f82f783feea33a","urls":["bzz-raw://52c1a77b309c61d34eb39b8a77fd5a5f8c154e50fd60db3007f5049d6b06b650","dweb:/ipfs/QmdHbULcAzZtD7u55bkQ8D9FEPMRvy1jgwNC3pFxHtiUfL"],"license":"MIT"}},"version":1},"id":33} \ No newline at end of file +{"abi":[{"type":"function","name":"DEPOSIT_AMOUNT","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"LIGHT_CLIENT","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract BitcoinLightClient"}],"stateMutability":"view"},{"type":"function","name":"SYSTEM_CALLER","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"acceptOwnership","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"batchWithdraw","inputs":[{"name":"bitcoin_addresses","type":"bytes32[]","internalType":"bytes32[]"}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"deposit","inputs":[{"name":"p","type":"tuple","internalType":"struct Bridge.DepositParams","components":[{"name":"version","type":"bytes4","internalType":"bytes4"},{"name":"flag","type":"bytes2","internalType":"bytes2"},{"name":"vin","type":"bytes","internalType":"bytes"},{"name":"vout","type":"bytes","internalType":"bytes"},{"name":"witness","type":"bytes","internalType":"bytes"},{"name":"locktime","type":"bytes4","internalType":"bytes4"},{"name":"intermediate_nodes","type":"bytes","internalType":"bytes"},{"name":"block_height","type":"uint256","internalType":"uint256"},{"name":"index","type":"uint256","internalType":"uint256"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"depositScript","inputs":[],"outputs":[{"name":"","type":"bytes","internalType":"bytes"}],"stateMutability":"view"},{"type":"function","name":"getWithdrawalCount","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"initialize","inputs":[{"name":"_depositScript","type":"bytes","internalType":"bytes"},{"name":"_scriptSuffix","type":"bytes","internalType":"bytes"},{"name":"_requiredSigsCount","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"initialized","inputs":[],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"operator","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"owner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"pendingOwner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"renounceOwnership","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"requiredSigsCount","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"scriptSuffix","inputs":[],"outputs":[{"name":"","type":"bytes","internalType":"bytes"}],"stateMutability":"view"},{"type":"function","name":"setDepositScript","inputs":[{"name":"_depositScript","type":"bytes","internalType":"bytes"},{"name":"_scriptSuffix","type":"bytes","internalType":"bytes"},{"name":"_requiredSigsCount","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"setOperator","inputs":[{"name":"_operator","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"spentWtxIds","inputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"transferOwnership","inputs":[{"name":"newOwner","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"withdraw","inputs":[{"name":"bitcoin_address","type":"bytes32","internalType":"bytes32"}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"withdrawalAddrs","inputs":[{"name":"","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"event","name":"Deposit","inputs":[{"name":"wtxId","type":"bytes32","indexed":false,"internalType":"bytes32"},{"name":"recipient","type":"address","indexed":false,"internalType":"address"},{"name":"timestamp","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"DepositScriptUpdate","inputs":[{"name":"depositScript","type":"bytes","indexed":false,"internalType":"bytes"},{"name":"scriptSuffix","type":"bytes","indexed":false,"internalType":"bytes"},{"name":"requiredSigsCount","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"name":"version","type":"uint64","indexed":false,"internalType":"uint64"}],"anonymous":false},{"type":"event","name":"OperatorUpdated","inputs":[{"name":"oldOperator","type":"address","indexed":false,"internalType":"address"},{"name":"newOperator","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"OwnershipTransferStarted","inputs":[{"name":"previousOwner","type":"address","indexed":true,"internalType":"address"},{"name":"newOwner","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"name":"previousOwner","type":"address","indexed":true,"internalType":"address"},{"name":"newOwner","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"Withdrawal","inputs":[{"name":"bitcoin_address","type":"bytes32","indexed":false,"internalType":"bytes32"},{"name":"index","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"timestamp","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"error","name":"InvalidInitialization","inputs":[]},{"type":"error","name":"NotInitializing","inputs":[]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"name":"owner","type":"address","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"name":"account","type":"address","internalType":"address"}]}],"bytecode":{"object":"0x6080604052348015600f57600080fd5b506124608061001f6000396000f3fe6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611eb5565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f2e565b610624565b34801561020b57600080fd5b5061015461021a366004611fa5565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fbe565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611fa5565b610853565b3480156102c457600080fd5b506101896102d3366004611eb5565b61091c565b3480156102e457600080fd5b506101896102f336600461200c565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611fa5565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612035565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db36600461200c565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff191660011790556002610556858783612110565b506003610564838583612110565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121f9565b60405180910390a15050505050565b61063581662386f26fc10000612249565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f612260565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f4612260565b9050602002013582846107079190612276565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612087565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612087565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d2858783612110565b5060036109e0838583612110565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121f9565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612087565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612289565b610b3e60408501602086016122b3565b610b4b60408601866122dd565b610b5860608801886122dd565b610b6560808a018a6122dd565b610b7560c08c0160a08d01612289565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122dd565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122dd565b8861010001356040518663ffffffff1660e01b8152600401610e99959493929190612324565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612356565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612276565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612087565b915060009050611007838284611840565b905061109d816002805461101a90612087565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612087565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612276565b6110fd856014612276565b86516111099190612378565b869190611840565b9050611124816003805461101a90612087565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119db565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f82611a11565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a99998979695949392919061238b565b604051602081830303815290604052611a82565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612276565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611aa9565b9050600019810361144d575060009695505050505050565b6114578184612276565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612276565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611af2565b905060001981036114f1575060009695505050505050565b6114fb8184612276565b9250506001016114b1565b600080611514836000611b56565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611cfa565b90506000198103611571576000935050505061158d565b61157b8184612276565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611cfa565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612276565b915060010161159b565b506116178582611cfa565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612276565b905060005b868110156117bf5761174b8883611b56565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612276565b6117ab9190612276565b6117b59083612276565b9150600101611739565b506117ca8782611b56565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612276565b61182d906001612276565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612276565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b8151815160009190811461191c57600091505061158d565b60206000805b838311611952575050848101518482015160209092019180821461194d57600094505050505061158d565b611922565b600061195f602085612378565b90505b848110156119cd5786818151811061197c5761197c612260565b602001015160f81c60f81b6001600160f81b0319168882815181106119a3576119a3612260565b01602001516001600160f81b031916146119c55760009550505050505061158d565b600101611962565b506001979650505050505050565b600080600280546119eb90612087565b9150600090506119fd84836014611840565b611a06906123f4565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611ab88585611d9c565b909250905060018201611ad1576000199250505061158d565b80611add836025612276565b611ae79190612276565b61166d906004612276565b6000611aff826009612276565b83511015611b10575060001961158d565b600080611b2785611b22866008612276565b611b56565b909250905060018201611b40576000199250505061158d565b80611b4c836009612276565b61166d9190612276565b6000806000611b658585611dde565b90508060ff16600003611b9a576000858581518110611b8657611b86612260565b016020015190935060f81c9150611cf39050565b83611ba6826001612447565b60ff16611bb39190612276565b85511015611bca5760001960009250925050611cf3565b60008160ff16600203611c0e57611c03611bef611be8876001612276565b8890611e64565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611ce9565b8160ff16600403611c5d57611c50611c2a611be8876001612276565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611ce9565b8160ff16600803611ce957611cdc611c79611be8876001612276565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611d098585611b56565b909250905060018201611d22576000199250505061158d565b600080611d30846001612276565b905060005b83811015611d9157611d4b88611b22848a612276565b909550925060018301611d67576000199550505050505061158d565b82611d73866001612276565b611d7d9190612276565b611d879083612276565b9150600101611d35565b509695505050505050565b600080611daa836025612276565b84511015611dbf575060001990506000611cf3565b600080611dd186611b22876024612276565b9097909650945050505050565b6000828281518110611df257611df2612260565b016020015160f81c60ff03611e095750600861158d565b828281518110611e1b57611e1b612260565b016020015160f81c60fe03611e325750600461158d565b828281518110611e4457611e44612260565b016020015160f81c60fd03611e5b5750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e8557600080fd5b50813567ffffffffffffffff811115611e9d57600080fd5b602083019150836020828501011115611cf357600080fd5b600080600080600060608688031215611ecd57600080fd5b853567ffffffffffffffff811115611ee457600080fd5b611ef088828901611e73565b909650945050602086013567ffffffffffffffff811115611f1057600080fd5b611f1c88828901611e73565b96999598509660400135949350505050565b60008060208385031215611f4157600080fd5b823567ffffffffffffffff811115611f5857600080fd5b8301601f81018513611f6957600080fd5b803567ffffffffffffffff811115611f8057600080fd5b8560208260051b8401011115611f9557600080fd5b6020919091019590945092505050565b600060208284031215611fb757600080fd5b5035919050565b602081526000825180602084015260005b81811015611fec5760208186018101516040868401015201611fcf565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561201e57600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561204757600080fd5b813567ffffffffffffffff81111561205e57600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061209b57607f821691505b6020821081036120bb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561210b57806000526020600020601f840160051c810160208510156120e85750805b601f840160051c820191505b8181101561210857600081556001016120f4565b50505b505050565b67ffffffffffffffff83111561212857612128612071565b61213c836121368354612087565b836120c1565b6000601f84116001811461217057600085156121585750838201355b600019600387901b1c1916600186901b178355612108565b600083815260209020601f19861690835b828110156121a15786850135825560209485019460019092019101612181565b50868210156121be5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061220d6060830187896121d0565b82810360208401526122208186886121d0565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d612233565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d612233565b60006020828403121561229b57600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122c557600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122f457600080fd5b83018035915067ffffffffffffffff82111561230f57600080fd5b602001915036819003821315611cf357600080fd5b8581528460208201526080604082015260006123446080830185876121d0565b90508260608301529695505050505050565b60006020828403121561236857600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d612233565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff19811691906014821015612440576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61223356","sourceMap":"430:9067:43:-:0;;;;;;;;;;;;;;;;;;;","linkReferences":{}},"deployedBytecode":{"object":"0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611eb5565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f2e565b610624565b34801561020b57600080fd5b5061015461021a366004611fa5565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fbe565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611fa5565b610853565b3480156102c457600080fd5b506101896102d3366004611eb5565b61091c565b3480156102e457600080fd5b506101896102f336600461200c565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611fa5565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612035565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db36600461200c565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff191660011790556002610556858783612110565b506003610564838583612110565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121f9565b60405180910390a15050505050565b61063581662386f26fc10000612249565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f612260565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f4612260565b9050602002013582846107079190612276565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612087565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612087565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d2858783612110565b5060036109e0838583612110565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121f9565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612087565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612289565b610b3e60408501602086016122b3565b610b4b60408601866122dd565b610b5860608801886122dd565b610b6560808a018a6122dd565b610b7560c08c0160a08d01612289565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122dd565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122dd565b8861010001356040518663ffffffff1660e01b8152600401610e99959493929190612324565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612356565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612276565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612087565b915060009050611007838284611840565b905061109d816002805461101a90612087565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612087565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612276565b6110fd856014612276565b86516111099190612378565b869190611840565b9050611124816003805461101a90612087565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119db565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f82611a11565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a99998979695949392919061238b565b604051602081830303815290604052611a82565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612276565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611aa9565b9050600019810361144d575060009695505050505050565b6114578184612276565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612276565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611af2565b905060001981036114f1575060009695505050505050565b6114fb8184612276565b9250506001016114b1565b600080611514836000611b56565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611cfa565b90506000198103611571576000935050505061158d565b61157b8184612276565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611cfa565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612276565b915060010161159b565b506116178582611cfa565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612276565b905060005b868110156117bf5761174b8883611b56565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612276565b6117ab9190612276565b6117b59083612276565b9150600101611739565b506117ca8782611b56565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612276565b61182d906001612276565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612276565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b8151815160009190811461191c57600091505061158d565b60206000805b838311611952575050848101518482015160209092019180821461194d57600094505050505061158d565b611922565b600061195f602085612378565b90505b848110156119cd5786818151811061197c5761197c612260565b602001015160f81c60f81b6001600160f81b0319168882815181106119a3576119a3612260565b01602001516001600160f81b031916146119c55760009550505050505061158d565b600101611962565b506001979650505050505050565b600080600280546119eb90612087565b9150600090506119fd84836014611840565b611a06906123f4565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611ab88585611d9c565b909250905060018201611ad1576000199250505061158d565b80611add836025612276565b611ae79190612276565b61166d906004612276565b6000611aff826009612276565b83511015611b10575060001961158d565b600080611b2785611b22866008612276565b611b56565b909250905060018201611b40576000199250505061158d565b80611b4c836009612276565b61166d9190612276565b6000806000611b658585611dde565b90508060ff16600003611b9a576000858581518110611b8657611b86612260565b016020015190935060f81c9150611cf39050565b83611ba6826001612447565b60ff16611bb39190612276565b85511015611bca5760001960009250925050611cf3565b60008160ff16600203611c0e57611c03611bef611be8876001612276565b8890611e64565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611ce9565b8160ff16600403611c5d57611c50611c2a611be8876001612276565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611ce9565b8160ff16600803611ce957611cdc611c79611be8876001612276565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611d098585611b56565b909250905060018201611d22576000199250505061158d565b600080611d30846001612276565b905060005b83811015611d9157611d4b88611b22848a612276565b909550925060018301611d67576000199550505050505061158d565b82611d73866001612276565b611d7d9190612276565b611d879083612276565b9150600101611d35565b509695505050505050565b600080611daa836025612276565b84511015611dbf575060001990506000611cf3565b600080611dd186611b22876024612276565b9097909650945050505050565b6000828281518110611df257611df2612260565b016020015160f81c60ff03611e095750600861158d565b828281518110611e1b57611e1b612260565b016020015160f81c60fe03611e325750600461158d565b828281518110611e4457611e44612260565b016020015160f81c60fd03611e5b5750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e8557600080fd5b50813567ffffffffffffffff811115611e9d57600080fd5b602083019150836020828501011115611cf357600080fd5b600080600080600060608688031215611ecd57600080fd5b853567ffffffffffffffff811115611ee457600080fd5b611ef088828901611e73565b909650945050602086013567ffffffffffffffff811115611f1057600080fd5b611f1c88828901611e73565b96999598509660400135949350505050565b60008060208385031215611f4157600080fd5b823567ffffffffffffffff811115611f5857600080fd5b8301601f81018513611f6957600080fd5b803567ffffffffffffffff811115611f8057600080fd5b8560208260051b8401011115611f9557600080fd5b6020919091019590945092505050565b600060208284031215611fb757600080fd5b5035919050565b602081526000825180602084015260005b81811015611fec5760208186018101516040868401015201611fcf565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561201e57600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561204757600080fd5b813567ffffffffffffffff81111561205e57600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061209b57607f821691505b6020821081036120bb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561210b57806000526020600020601f840160051c810160208510156120e85750805b601f840160051c820191505b8181101561210857600081556001016120f4565b50505b505050565b67ffffffffffffffff83111561212857612128612071565b61213c836121368354612087565b836120c1565b6000601f84116001811461217057600085156121585750838201355b600019600387901b1c1916600186901b178355612108565b600083815260209020601f19861690835b828110156121a15786850135825560209485019460019092019101612181565b50868210156121be5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061220d6060830187896121d0565b82810360208401526122208186886121d0565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d612233565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d612233565b60006020828403121561229b57600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122c557600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122f457600080fd5b83018035915067ffffffffffffffff82111561230f57600080fd5b602001915036819003821315611cf357600080fd5b8581528460208201526080604082015260006123446080830185876121d0565b90508260608301529695505050505050565b60006020828403121561236857600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d612233565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff19811691906014821015612440576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61223356","sourceMap":"430:9067:43:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1018:23;;;;;;;;;;-1:-1:-1;1018:23:43;;;;;;;;;;;179:14:48;;172:22;154:41;;142:2;127:18;1018:23:43;;;;;;;;2269:810;;;;;;;;;;-1:-1:-1;2269:810:43;;;;;:::i;:::-;;:::i;:::-;;1133:32;;;;;;;;;;;;;;;;;;;1535:25:48;;;1523:2;1508:18;1133:32:43;1389:177:48;1104:23:43;;;;;;;;;;-1:-1:-1;1104:23:43;;;;;;;-1:-1:-1;;;;;1104:23:43;;;;;;-1:-1:-1;;;;;1735:32:48;;;1717:51;;1705:2;1690:18;1104:23:43;1571:203:48;7309:440:43;;;;;;:::i;:::-;;:::i;1239:43::-;;;;;;;;;;-1:-1:-1;1239:43:43;;;;;:::i;:::-;;;;;;;;;;;;;;;;3155:101:25;;;;;;;;;;;;;:::i;7812:108:43:-;;;;;;;;;;-1:-1:-1;7891:15:43;:22;7812:108;;2774:229:24;;;;;;;;;;;;;:::i;1203:25:43:-;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;2441:144:25:-;;;;;;;;;;;;;:::i;6763:301:43:-;;;;;;:::i;:::-;;:::i;3572:505::-;;;;;;;;;;-1:-1:-1;3572:505:43;;;;;:::i;:::-;;:::i;8063:147::-;;;;;;;;;;-1:-1:-1;8063:147:43;;;;;:::i;:::-;;:::i;1171:26::-;;;;;;;;;;;;;:::i;1288:32::-;;;;;;;;;;-1:-1:-1;1288:32:43;;;;;:::i;:::-;;:::i;920:91::-;;;;;;;;;;;;968:42;920:91;;4324:2185;;;;;;;;;;-1:-1:-1;4324:2185:43;;;;;:::i;:::-;;:::i;1680:168:24:-;;;;;;;;;;;;;:::i;793:121:43:-;;;;;;;;;;;;-1:-1:-1;;;;;793:121:43;;1047:51;;;;;;;;;;;;1088:10;1047:51;;2041:247:24;;;;;;;;;;-1:-1:-1;2041:247:24;;;;;:::i;:::-;;:::i;2269:810:43:-;1693:10;968:42;1693:27;1685:71;;;;-1:-1:-1;;;1685:71:43;;4650:2:48;1685:71:43;;;4632:21:48;4689:2;4669:18;;;4662:30;4728:33;4708:18;;;4701:61;4779:18;;1685:71:43;;;;;;;;;2417:11:::1;::::0;::::1;;2416:12;2408:56;;;::::0;-1:-1:-1;;;2408:56:43;;5010:2:48;2408:56:43::1;::::0;::::1;4992:21:48::0;5049:2;5029:18;;;5022:30;5088:33;5068:18;;;5061:61;5139:18;;2408:56:43::1;4808:355:48::0;2408:56:43::1;2482:18;2504:1;2482:23:::0;2474:62:::1;;;::::0;-1:-1:-1;;;2474:62:43;;5370:2:48;2474:62:43::1;::::0;::::1;5352:21:48::0;5409:2;5389:18;;;5382:30;5448:28;5428:18;;;5421:56;5494:18;;2474:62:43::1;5168:350:48::0;2474:62:43::1;2579:1;2554:26:::0;;;2546:69:::1;;;::::0;-1:-1:-1;;;2546:69:43;;5725:2:48;2546:69:43::1;::::0;::::1;5707:21:48::0;5764:2;5744:18;;;5737:30;5803:32;5783:18;;;5776:60;5853:18;;2546:69:43::1;5523:354:48::0;2546:69:43::1;2626:11;:18:::0;;-1:-1:-1;;2626:18:43::1;2640:4;2626:18;::::0;;2654:13:::1;:30;2670:14:::0;;2654:13;:30:::1;:::i;:::-;-1:-1:-1::0;2694:12:43::1;:28;2709:13:::0;;2694:12;:28:::1;:::i;:::-;-1:-1:-1::0;2732:17:43::1;:38:::0;;;2905:8:::1;:24:::0;;-1:-1:-1;;;;;;2905:24:43::1;::::0;::::1;::::0;;2945:42:::1;::::0;;8598:51:48;;;968:42:43::1;8680:2:48::0;8665:18;;8658:60;2945:42:43::1;::::0;8571:18:48;2945:42:43::1;;;;;;;3002:70;3022:14;;3038:13;;3053:18;3002:70;;;;;;;;;;:::i;:::-;;;;;;;;2269:810:::0;;;;;:::o;7309:440::-;7418:41;7435:17;1088:10;7418:41;:::i;:::-;7405:9;:54;7397:90;;;;-1:-1:-1;;;7397:90:43;;10014:2:48;7397:90:43;;;9996:21:48;10053:2;10033:18;;;10026:30;-1:-1:-1;;;10072:18:48;;;10065:53;10135:18;;7397:90:43;9812:347:48;7397:90:43;7513:15;:22;7497:13;7545:198;7562:28;;;7545:198;;;7611:15;7632:17;;7650:1;7632:20;;;;;;;:::i;:::-;7611:42;;;;;;;-1:-1:-1;7611:42:43;;;7632:20;7611:42;;;;7632:20;;;;;;;;;7611:42;;;;;-1:-1:-1;7672:60:43;7683:17;;7701:1;7683:20;;;;;;;:::i;:::-;;;;;;;7713:1;7705:5;:9;;;;:::i;:::-;7672:60;;;10628:25:48;;;10684:2;10669:18;;10662:34;;;;7716:15:43;10712:18:48;;;10705:34;10616:2;10601:18;7672:60:43;;;;;;;7592:3;;7545:198;;;;7387:362;7309:440;;:::o;3155:101:25:-;2334:13;:11;:13::i;:::-;3219:30:::1;3246:1;3219:18;:30::i;:::-;3155:101::o:0;2774:229:24:-;966:10:27;;2869:14:24;:12;:14::i;:::-;-1:-1:-1;;;;;2869:24:24;;2865:96;;2916:34;;-1:-1:-1;;;2916:34:24;;-1:-1:-1;;;;;1735:32:48;;2916:34:24;;;1717:51:48;1690:18;;2916:34:24;1571:203:48;2865:96:24;2970:26;2989:6;2970:18;:26::i;:::-;2816:187;2774:229::o;1203:25:43:-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2441:144:25:-;2487:7;;1313:22;2533:20;2570:8;-1:-1:-1;;;;;2570:8:25;;2441:144;-1:-1:-1;;2441:144:25:o;6763:301:43:-;1088:10;6841:9;:27;6833:63;;;;-1:-1:-1;;;6833:63:43;;10014:2:48;6833:63:43;;;9996:21:48;10053:2;10033:18;;;10026:30;-1:-1:-1;;;10072:18:48;;;10065:53;10135:18;;6833:63:43;9812:347:48;6833:63:43;6922:15;:22;;6954:37;;;;;-1:-1:-1;6954:37:43;;;;;;;;;;7006:51;;;10628:25:48;;;10684:2;10669:18;;10662:34;;;7041:15:43;10712:18:48;;;10705:34;7006:51:43;;;;;;;10616:2:48;7006:51:43;;;6823:241;6763:301;:::o;3572:505::-;2334:13:25;:11;:13::i;:::-;3724:18:43::1;3746:1;3724:23:::0;3716:62:::1;;;::::0;-1:-1:-1;;;3716:62:43;;5370:2:48;3716:62:43::1;::::0;::::1;5352:21:48::0;5409:2;5389:18;;;5382:30;5448:28;5428:18;;;5421:56;5494:18;;3716:62:43::1;5168:350:48::0;3716:62:43::1;3821:1;3796:26:::0;;;3788:69:::1;;;::::0;-1:-1:-1;;;3788:69:43;;5725:2:48;3788:69:43::1;::::0;::::1;5707:21:48::0;5764:2;5744:18;;;5737:30;5803:32;5783:18;;;5776:60;5853:18;;3788:69:43::1;5523:354:48::0;3788:69:43::1;3868:13;:30;3884:14:::0;;3868:13;:30:::1;:::i;:::-;-1:-1:-1::0;3908:12:43::1;:28;3923:13:::0;;3908:12;:28:::1;:::i;:::-;-1:-1:-1::0;3946:17:43::1;:38:::0;;;4000:70:::1;::::0;::::1;::::0;::::1;::::0;4020:14;;;;4036:13;;;;3966:18;;4000:70:::1;:::i;8063:147::-:0;2334:13:25;:11;:13::i;:::-;8132:8:43::1;:20:::0;;-1:-1:-1;;;;;;8132:20:43::1;;-1:-1:-1::0;;;;;8132:20:43;;::::1;::::0;;::::1;::::0;;;::::1;::::0;;;;8167:36:::1;::::0;;8183:8;;;::::1;;8598:51:48::0;;8680:2;8665:18;;8658:60;;;;8167:36:43::1;::::0;8571:18:48;8167:36:43::1;;;;;;;8063:147:::0;:::o;1171:26::-;;;;;;;:::i;1288:32::-;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1288:32:43;:::o;4324:2185::-;1836:8;;;;;-1:-1:-1;;;;;1836:8:43;1822:10;:22;1814:61;;;;-1:-1:-1;;;1814:61:43;;10952:2:48;1814:61:43;;;10934:21:48;10991:2;10971:18;;;10964:30;11030:28;11010:18;;;11003:56;11076:18;;1814:61:43;10750:350:48;1814:61:43;4750:13:::1;4766:84;4794:9;;::::0;::::1;:1:::0;:9:::1;:::i;:::-;4805:6;::::0;;;::::1;::::0;::::1;;:::i;:::-;4813:5;;::::0;::::1;:1:::0;:5:::1;:::i;:::-;4820:6;;::::0;::::1;:1:::0;:6:::1;:::i;:::-;4828:9;;::::0;::::1;:1:::0;:9:::1;:::i;:::-;4839:10;::::0;;;::::1;::::0;::::1;;:::i;:::-;4766:27;:84::i;:::-;4869:18;::::0;;;:11:::1;:18;::::0;;;;;4750:100;;-1:-1:-1;4869:18:43::1;;4868:19;4860:51;;;::::0;-1:-1:-1;;;4860:51:43;;12410:2:48;4860:51:43::1;::::0;::::1;12392:21:48::0;12449:2;12429:18;;;12422:30;-1:-1:-1;;;12468:18:48;;;12461:49;12527:18;;4860:51:43::1;12208:343:48::0;4860:51:43::1;4921:18;::::0;;;:11:::1;:18;::::0;;;;;;:25;;-1:-1:-1;;4921:25:43::1;4942:4;4921:25;::::0;;4965:27:::1;::::0;4986:5:::1;::::0;;::::1;:1:::0;:5:::1;:::i;:::-;4965:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;;-1:-1:-1;4965:20:43::1;::::0;-1:-1:-1;;;4965:27:43:i:1;:::-;4957:69;;;::::0;-1:-1:-1;;;4957:69:43;;12758:2:48;4957:69:43::1;::::0;::::1;12740:21:48::0;12797:2;12777:18;;;12770:30;12836:31;12816:18;;;12809:59;12885:18;;4957:69:43::1;12556:353:48::0;4957:69:43::1;5044:29;5066:6;;::::0;::::1;:1:::0;:6:::1;:::i;:::-;5044:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;;-1:-1:-1;5044:21:43::1;::::0;-1:-1:-1;;;5044:29:43:i:1;:::-;5036:72;;;::::0;-1:-1:-1;;;5036:72:43;;13116:2:48;5036:72:43::1;::::0;::::1;13098:21:48::0;13155:2;13135:18;;;13128:30;13194:32;13174:18;;;13167:60;13244:18;;5036:72:43::1;12914:354:48::0;5036:72:43::1;5130:13;5147:27;5168:5;;::::0;::::1;:1:::0;:5:::1;:::i;:::-;5147:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;;-1:-1:-1;5147:20:43::1;::::0;-1:-1:-1;;;5147:27:43:i:1;:::-;5127:47;;;5192:5;5201:1;5192:10;5184:45;;;::::0;-1:-1:-1;;;5184:45:43;;13475:2:48;5184:45:43::1;::::0;::::1;13457:21:48::0;13514:2;13494:18;;;13487:30;-1:-1:-1;;;13533:18:48;;;13526:52;13595:18;;5184:45:43::1;13273:346:48::0;5184:45:43::1;5298:46;5327:9;;::::0;::::1;:1:::0;:9:::1;:::i;:::-;5298:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;;-1:-1:-1;5338:5:43;;-1:-1:-1;5298:28:43::1;::::0;-1:-1:-1;;5298:46:43:i:1;:::-;5290:92;;;::::0;-1:-1:-1;;;5290:92:43;;13826:2:48;5290:92:43::1;::::0;::::1;13808:21:48::0;13865:2;13845:18;;;13838:30;13904:34;13884:18;;;13877:62;-1:-1:-1;;;13955:18:48;;;13948:31;13996:19;;5290:92:43::1;13624:397:48::0;5290:92:43::1;-1:-1:-1::0;;;;;5401:28:43::1;5430:14;::::0;::::1;;5446:5:::0;5453:20:::1;;::::0;::::1;5430:1:::0;5453:20:::1;:::i;:::-;5475:1;:7;;;5401:82;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5393:122;;;::::0;-1:-1:-1;;;5393:122:43;;14974:2:48;5393:122:43::1;::::0;::::1;14956:21:48::0;15013:2;14993:18;;;14986:30;15052:29;15032:18;;;15025:57;15099:18;;5393:122:43::1;14772:351:48::0;5393:122:43::1;5526:21;5550:48;5585:9;;::::0;::::1;:1:::0;:9:::1;:::i;:::-;5550:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;-1:-1:-1;5550:48:43;-1:-1:-1;5550:34:43::1;::::0;-1:-1:-1;;5550:48:43:i:1;:::-;5526:72;;5611:15;5630:30;5651:8;5630:20;:30::i;:::-;5608:52;;;5689:17;;5709:1;5689:21;;;;:::i;:::-;5678:7;:32;5670:66;;;::::0;-1:-1:-1;;;5670:66:43;;15330:2:48;5670:66:43::1;::::0;::::1;15312:21:48::0;15369:2;15349:18;;;15342:30;-1:-1:-1;;;15388:18:48;;;15381:51;15449:18;;5670:66:43::1;15128:345:48::0;5670:66:43::1;5798:19;5820:64;5856:8;5866:17;;5820:35;:64::i;:::-;5798:86;;5894:12;5909:13;:20;;;;;:::i;:::-;::::0;-1:-1:-1;5939:27:43::1;::::0;-1:-1:-1;5969:21:43::1;:6:::0;5939:27;5909:20;5969:12:::1;:21::i;:::-;5939:51;;6008:43;6021:14;6037:13;6008:43;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:12;:43::i;:::-;6000:78;;;::::0;-1:-1:-1;;;6000:78:43;;15680:2:48;6000:78:43::1;::::0;::::1;15662:21:48::0;15719:2;15699:18;;;15692:30;-1:-1:-1;;;15738:18:48;;;15731:52;15800:18;;6000:78:43::1;15478:346:48::0;6000:78:43::1;6088:20;6111:52;6124:9;:4:::0;6131:2:::1;6124:9;:::i;:::-;6152;:4:::0;6159:2:::1;6152:9;:::i;:::-;6135:6;:13;:27;;;;:::i;:::-;6111:6:::0;;:52;:12:::1;:52::i;:::-;6088:75;;6205:35;6218:7;6227:12;6205:35;;;;;:::i;:::-;6197:69;;;::::0;-1:-1:-1;;;6197:69:43;;16164:2:48;6197:69:43::1;::::0;::::1;16146:21:48::0;16203:2;16183:18;;;16176:30;-1:-1:-1;;;16222:18:48;;;16215:51;16283:18;;6197:69:43::1;15962:345:48::0;6197:69:43::1;6277:17;6297:31;6321:6;6297:23;:31::i;:::-;6344:42;::::0;;16514:25:48;;;-1:-1:-1;;;;;16575:32:48;;16570:2;16555:18;;16548:60;6370:15:43::1;16624:18:48::0;;;16617:34;6344:42:43;;16575:32:48;;-1:-1:-1;6344:42:43::1;::::0;;;;;16502:2:48;6344:42:43;;::::1;6398:12;6416:9;-1:-1:-1::0;;;;;6416:14:43::1;1088:10;6416:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6397:60;;;6475:7;6467:35;;;::::0;-1:-1:-1;;;6467:35:43;;17074:2:48;6467:35:43::1;::::0;::::1;17056:21:48::0;17113:2;17093:18;;;17086:30;-1:-1:-1;;;17132:18:48;;;17125:45;17187:18;;6467:35:43::1;16872:339:48::0;6467:35:43::1;4403:2106;;;;;;;;;;4324:2185:::0;:::o;1680:168:24:-;1733:7;;1318:27;1784:25;1187:174;2041:247;2334:13:25;:11;:13::i;:::-;1318:27:24;2197:26;;-1:-1:-1;;;;;;2197:26:24::1;-1:-1:-1::0;;;;;2197:26:24;::::1;::::0;;::::1;::::0;;2263:7:::1;:5;:7::i;:::-;-1:-1:-1::0;;;;;2238:43:24::1;;;;;;;;;;;2120:168;2041:247:::0;:::o;2658:162:25:-;966:10:27;2717:7:25;:5;:7::i;:::-;-1:-1:-1;;;;;2717:23:25;;2713:101;;2763:40;;-1:-1:-1;;;2763:40:25;;966:10:27;2763:40:25;;;1717:51:48;1690:18;;2763:40:25;1571:203:48;2472:222:24;1318:27;2621:22;;-1:-1:-1;;;;;;2621:22:24;;;2653:34;2678:8;2653:24;:34::i;:::-;2544:150;2472:222;:::o;431:320:0:-;643:7;669:75;686:7;695:4;701:3;;706:4;;712:7;;721:8;669:61;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;:73;:75::i;:::-;662:82;431:320;-1:-1:-1;;;;;;;;;;431:320:0:o;27793:991:1:-;27856:4;27872:22;27904:13;27954:17;27966:4;27954:11;:17::i;:::-;27928:43;;-1:-1:-1;27928:43:1;-1:-1:-1;28050:10:1;;;:43;;;-1:-1:-1;;28064:14:1;:29;28050:43;28046:86;;;-1:-1:-1;28116:5:1;;27793:991;-1:-1:-1;;;27793:991:1:o;28046:86::-;28142:15;28160:18;28164:14;28160:1;:18;:::i;:::-;28142:36;;28194:9;28189:492;28213:5;28209:1;:9;28189:492;;;28312:4;:11;28301:7;:22;28297:73;;-1:-1:-1;28350:5:1;;27793:991;-1:-1:-1;;;;;27793:991:1:o;28297:73::-;28445:16;28464:37;28487:4;28493:7;28464:22;:37::i;:::-;28445:56;;-1:-1:-1;;28519:8:1;:23;28515:74;;-1:-1:-1;28569:5:1;;27793:991;-1:-1:-1;;;;;;27793:991:1:o;28515:74::-;28651:19;28662:8;28651:19;;:::i;:::-;;-1:-1:-1;;28220:3:1;;28189:492;;;-1:-1:-1;28766:11:1;;28755:22;;;;;-1:-1:-1;;;27793:991:1:o;29056:1004::-;29121:4;29137:22;29169:14;29221:18;29233:5;29221:11;:18::i;:::-;29194:45;;-1:-1:-1;29194:45:1;-1:-1:-1;29319:11:1;;;:44;;;-1:-1:-1;;29334:14:1;:29;29319:44;29315:87;;;-1:-1:-1;29386:5:1;;29056:1004;-1:-1:-1;;;29056:1004:1:o;29315:87::-;29412:15;29430:18;29434:14;29430:1;:18;:::i;:::-;29412:36;;29464:9;29459:497;29483:6;29479:1;:10;29459:497;;;29583:5;:12;29572:7;:23;29568:74;;-1:-1:-1;29622:5:1;;29056:1004;-1:-1:-1;;;;;29056:1004:1:o;29568:74::-;29766:16;29785:39;29809:5;29816:7;29785:23;:39::i;:::-;29766:58;;-1:-1:-1;;29842:8:1;:23;29838:74;;-1:-1:-1;29892:5:1;;29056:1004;-1:-1:-1;;;;;;29056:1004:1:o;29838:74::-;29926:19;29937:8;29926:19;;:::i;:::-;;-1:-1:-1;;29491:3:1;;29459:497;;2414:123;2475:7;2484;2510:20;2524:2;2528:1;2510:13;:20::i;:::-;2503:27;;;;2414:123;;;:::o;1060:871:0:-;1147:4;1222:6;1232:1;1222:11;1218:54;;-1:-1:-1;1256:5:0;1249:12;;1218:54;1282:15;1317:9;1312:512;1336:6;1332:1;:10;1312:512;;;1436:8;:15;1425:7;:26;1421:77;;1478:5;1471:12;;;;;;1421:77;1573:16;1592:43;1617:8;1627:7;1592:24;:43::i;:::-;1573:62;;-1:-1:-1;;1653:8:0;:32;1649:83;;1712:5;1705:12;;;;;;;1649:83;1794:19;1805:8;1794:19;;:::i;:::-;;-1:-1:-1;;1344:3:0;;1312:512;;;-1:-1:-1;1909:15:0;;1898:26;;-1:-1:-1;1060:871:0;;;;;:::o;3420:579::-;3513:12;3537;3563:15;3598:10;3593:221;3619:6;3614:2;:11;3593:221;;;3655:43;3680:8;3690:7;3655:24;:43::i;:::-;3648:50;;-1:-1:-1;;3720:4:0;:28;3712:62;;;;-1:-1:-1;;;3712:62:0;;18276:2:48;3712:62:0;;;18258:21:48;18315:2;18295:18;;;18288:30;-1:-1:-1;;;18334:18:48;;;18327:51;18395:18;;3712:62:0;18074:345:48;3712:62:0;3788:15;3799:4;3788:15;;:::i;:::-;;-1:-1:-1;3627:5:0;;3593:221;;;;3831:43;3856:8;3866:7;3831:24;:43::i;:::-;3824:50;;-1:-1:-1;;3892:4:0;:28;3884:62;;;;-1:-1:-1;;;3884:62:0;;18276:2:48;3884:62:0;;;18258:21:48;18315:2;18295:18;;;18288:30;-1:-1:-1;;;18334:18:48;;;18327:51;18395:18;;3884:62:0;18074:345:48;3884:62:0;3963:29;:8;3978:7;3987:4;3963:14;:29::i;:::-;3956:36;3420:579;-1:-1:-1;;;;;3420:579:0:o;4360:974::-;4454:12;4478:22;4510:15;4572:30;4593:8;4572:20;:30::i;:::-;4544:58;;-1:-1:-1;4544:58:0;-1:-1:-1;4620:38:0;;;4612:85;;;;-1:-1:-1;;;4612:85:0;;18626:2:48;4612:85:0;;;18608:21:48;18665:2;18645:18;;;18638:30;18704:34;18684:18;;;18677:62;-1:-1:-1;;;18755:18:48;;;18748:32;18797:19;;4612:85:0;18424:398:48;4612:85:0;4724:7;4715:6;:16;4707:45;;;;-1:-1:-1;;;4707:45:0;;19029:2:48;4707:45:0;;;19011:21:48;19068:2;19048:18;;;19041:30;-1:-1:-1;;;19087:18:48;;;19080:46;19143:18;;4707:45:0;18827:340:48;4707:45:0;4763:16;;4811:18;4815:14;4811:1;:18;:::i;:::-;4793:36;;4845:9;4840:263;4864:6;4860:1;:10;4840:263;;;4920:41;4943:8;4953:7;4920:22;:41::i;:::-;4891:70;;-1:-1:-1;4891:70:0;-1:-1:-1;4983:32:0;;;4975:63;;;;-1:-1:-1;;;4975:63:0;;19374:2:48;4975:63:0;;;19356:21:48;19413:2;19393:18;;;19386:30;-1:-1:-1;;;19432:18:48;;;19425:48;19490:18;;4975:63:0;19172:342:48;4975:63:0;5084:8;5063:18;5067:14;5063:1;:18;:::i;:::-;:29;;;;:::i;:::-;5052:40;;;;:::i;:::-;;-1:-1:-1;4872:3:0;;4840:263;;;;5142:41;5165:8;5175:7;5142:22;:41::i;:::-;5113:70;;-1:-1:-1;5113:70:0;-1:-1:-1;5201:32:0;;;5193:63;;;;-1:-1:-1;;;5193:63:0;;19374:2:48;5193:63:0;;;19356:21:48;19413:2;19393:18;;;19386:30;-1:-1:-1;;;19432:18:48;;;19425:48;19490:18;;5193:63:0;19172:342:48;5193:63:0;5273:54;5288:7;5297:25;5308:14;5297:8;:25;:::i;:::-;:29;;5325:1;5297:29;:::i;:::-;5273:8;;:54;:14;:54::i;:::-;5266:61;4360:974;-1:-1:-1;;;;;;;4360:974:0:o;10344:924:2:-;10431:16;10463:7;10474:1;10463:12;10459:55;;-1:-1:-1;10491:12:2;;;;;;;;;-1:-1:-1;10491:12:2;;;;10459:55;10523:9;10535:16;10544:7;10535:6;:16;:::i;:::-;10523:28;;10576:6;10569:4;:13;:38;;;;;10603:4;10586:6;:13;:21;;10569:38;10561:70;;;;-1:-1:-1;;;10561:70:2;;19721:2:48;10561:70:2;;;19703:21:48;19760:2;19740:18;;;19733:30;-1:-1:-1;;;19779:18:48;;;19772:49;19838:18;;10561:70:2;19519:343:48;10561:70:2;10768:4;10762:11;10755:18;;10817:7;10812:2;10807:3;10803:12;10799:26;10793:4;10786:40;10851:7;10846:3;10839:20;10978:6;10970;10966:19;10961:3;10957:29;11054:6;11049:2;11041:6;11037:15;11033:28;11098:7;11093:3;11089:17;11000:252;11129:3;11124;11121:12;11000:252;;;11233:3;11227:10;11220:4;11215:3;11211:14;11204:34;11168:2;11163:3;11159:12;11152:19;;11000:252;;;11004:116;;;10651:611;10344:924;;;;;;:::o;8474:774:43:-;8588:8;;8617;;8551:11;;8588:8;8610:15;;8606:58;;8648:5;8641:12;;;;;8606:58;8691:2;8674:14;;8751:289;8768:3;8758:6;:13;8751:289;;-1:-1:-1;;8830:14:43;;;8824:21;8879:14;;;8873:21;8933:2;8921:15;;;;8967:16;;;8963:67;;9010:5;9003:12;;;;;;;;8963:67;8751:289;;;9097:6;9106:11;9115:2;9106:6;:11;:::i;:::-;9097:20;;9092:128;9123:3;9119:1;:7;9092:128;;;9159:1;9161;9159:4;;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;;;;;9151:12:43;;:1;9153;9151:4;;;;;;;;:::i;:::-;;;;;-1:-1:-1;;;;;;9151:4:43;:12;9147:63;;9190:5;9183:12;;;;;;;;;9147:63;9128:3;;9092:128;;;-1:-1:-1;9237:4:43;;8474:774;-1:-1:-1;;;;;;;8474:774:43:o;9254:241::-;9332:7;9351:14;9368:13;:20;;;;;:::i;:::-;;-1:-1:-1;9398:13:43;;-1:-1:-1;9422:25:43;:7;9368:20;9444:2;9422:13;:25::i;:::-;9414:34;;;:::i;:::-;9473:14;;;9254:241;-1:-1:-1;;;;9254:241:43:o;3774:248:25:-;1313:22;3923:8;;-1:-1:-1;;;;;;3941:19:25;;-1:-1:-1;;;;;3941:19:25;;;;;;;;3975:40;;3923:8;;;;;3975:40;;3847:24;;3975:40;3837:185;;3774:248;:::o;9609:335:1:-;9670:11;9835:2;9829:4;9824:2;9818:9;9813:2;9809;9805:11;9802:1;9795:5;9784:54;9780:59;9893:2;9887:4;9883:2;9877:4;9874:1;9867:5;9856:40;-1:-1:-1;;9923:4:1;9917:11;;9609:335;-1:-1:-1;9609:335:1:o;14980:394::-;15069:7;15088:22;15120:21;15185:34;15207:6;15215:3;15185:21;:34::i;:::-;15151:68;;-1:-1:-1;15151:68:1;-1:-1:-1;15233:29:1;;;15229:78;;-1:-1:-1;;15278:18:1;;;;;;15229:78;15350:13;15324:23;15333:14;15324:6;:23;:::i;:::-;:39;;;;:::i;:::-;:43;;15366:1;15324:43;:::i;20911:536::-;21002:7;21042;21046:3;21042:1;:7;:::i;:::-;21025;:14;:24;21021:73;;;-1:-1:-1;;;21065:18:1;;21021:73;21103:22;;21212:31;21226:7;21235;21239:3;21235:1;:7;:::i;:::-;21212:13;:31::i;:::-;21172:71;;-1:-1:-1;21172:71:1;-1:-1:-1;21258:29:1;;;21254:78;;-1:-1:-1;;21303:18:1;;;;;;21254:78;21421:19;21396:22;21404:14;21396:5;:22;:::i;:::-;:44;;;;:::i;2999:704::-;3075:7;3084;3103:14;3120:36;3148:2;3152:3;3120:27;:36::i;:::-;3103:53;;3171:8;:13;;3183:1;3171:13;3167:70;;3208:1;3217:2;3220:3;3217:7;;;;;;;;:::i;:::-;;;;;3200:26;;-1:-1:-1;3217:7:1;;;-1:-1:-1;3200:26:1;;-1:-1:-1;3200:26:1;3167:70;3277:3;3262:12;3266:8;3262:1;:12;:::i;:::-;:18;;;;;;:::i;:::-;3250:2;:9;:30;3246:84;;;-1:-1:-1;;3317:1:1;3296:23;;;;;;;3246:84;3339:15;3368:8;:13;;3380:1;3368:13;3364:297;;3407:41;3428:18;3438:7;3442:3;3438:1;:7;:::i;:::-;3428:2;;:9;:18::i;:::-;7042:7;;;;;;7054;;;;;7041:21;;6959:110;3407:41;3397:51;;;;3364:297;;;3469:8;:13;;3481:1;3469:13;3465:196;;3508:41;3529:18;3539:7;3543:3;3539:1;:7;:::i;3529:18::-;6397:21;;;;;;6402:10;6360:6;;;;;6359:21;;;;6358:61;6485:2;6480:7;;;6468;;;6467:21;;6238:257;3508:41;3498:51;;;;3465:196;;;3570:8;:13;;3582:1;3570:13;3566:95;;3609:41;3630:18;3640:7;3644:3;3640:1;:7;:::i;3630:18::-;3623:26;;5965:22;5866:1;5793:6;;;5965:22;;;;5838:29;;;;5965:22;;;;5992:2;5964:30;;;5838:29;6056:7;5843:18;5792:29;;;;5838;;;;5791:77;;;;5918:7;;;5969:18;5917:30;6056:7;6061:2;6044:7;;;6056;;;6043:21;;5671:400;3609:41;3599:51;;;;3566:95;3670:26;;;;;-1:-1:-1;3688:7:1;-1:-1:-1;2999:704:1;;;;;;:::o;2254:783:0:-;2347:7;2366:22;2398:20;2470:37;2493:8;2503:3;2470:22;:37::i;:::-;2437:70;;-1:-1:-1;2437:70:0;-1:-1:-1;2521:38:0;;;2517:96;;-1:-1:-1;;2575:27:0;;;;;;2517:96;2623:16;;2667:18;2671:14;2667:1;:18;:::i;:::-;2649:36;;2701:9;2696:310;2720:12;2716:1;:16;2696:310;;;2782:47;2805:8;2815:13;2821:7;2815:3;:13;:::i;2782:47::-;2753:76;;-1:-1:-1;2753:76:0;-1:-1:-1;2847:32:0;;;2843:98;;-1:-1:-1;;2899:27:0;;;;;;;;;2843:98;2987:8;2966:18;2970:14;2966:1;:18;:::i;:::-;:29;;;;:::i;:::-;2955:40;;;;:::i;:::-;;-1:-1:-1;2734:3:0;;2696:310;;;-1:-1:-1;3023:7:0;2254:783;-1:-1:-1;;;;;;2254:783:0:o;13785:388:1:-;13873:7;;13921:8;13926:3;13921:2;:8;:::i;:::-;13905:6;:13;:24;13901:78;;;-1:-1:-1;;;654:66:1;-1:-1:-1;13966:1:1;13945:23;;13901:78;13989:22;;14086:31;14100:6;14108:8;:3;14114:2;14108:8;:::i;14086:31::-;14052:65;;;;-1:-1:-1;13785:388:1;-1:-1:-1;;;;;13785:388:1:o;1550:446::-;1640:5;1667:2;1670:3;1667:7;;;;;;;;:::i;:::-;;;;;;;1661:14;:22;1657:93;;-1:-1:-1;1706:1:1;1699:8;;1657:93;1769:2;1772:3;1769:7;;;;;;;;:::i;:::-;;;;;;;1781:4;1763:22;1759:93;;-1:-1:-1;1808:1:1;1801:8;;1759:93;1871:2;1874:3;1871:7;;;;;;;;:::i;:::-;;;;;;;1883:4;1865:22;1861:93;;-1:-1:-1;1910:1:1;1903:8;;1861:93;-1:-1:-1;1971:1:1;1550:446;;;;:::o;13493:136:2:-;13566:6;13598:23;13606:6;13614;12550:28;12566:2;12550:28;12544:35;;12417:178;206:347:48;257:8;267:6;321:3;314:4;306:6;302:17;298:27;288:55;;339:1;336;329:12;288:55;-1:-1:-1;362:20:48;;405:18;394:30;;391:50;;;437:1;434;427:12;391:50;474:4;466:6;462:17;450:29;;526:3;519:4;510:6;502;498:19;494:30;491:39;488:59;;;543:1;540;533:12;558:826;657:6;665;673;681;689;742:2;730:9;721:7;717:23;713:32;710:52;;;758:1;755;748:12;710:52;798:9;785:23;831:18;823:6;820:30;817:50;;;863:1;860;853:12;817:50;902:58;952:7;943:6;932:9;928:22;902:58;:::i;:::-;979:8;;-1:-1:-1;876:84:48;-1:-1:-1;;1067:2:48;1052:18;;1039:32;1096:18;1083:32;;1080:52;;;1128:1;1125;1118:12;1080:52;1167:60;1219:7;1208:8;1197:9;1193:24;1167:60;:::i;:::-;558:826;;;;-1:-1:-1;1246:8:48;1350:2;1335:18;1322:32;;558:826;-1:-1:-1;;;;558:826:48:o;1779:610::-;1865:6;1873;1926:2;1914:9;1905:7;1901:23;1897:32;1894:52;;;1942:1;1939;1932:12;1894:52;1982:9;1969:23;2015:18;2007:6;2004:30;2001:50;;;2047:1;2044;2037:12;2001:50;2070:22;;2123:4;2115:13;;2111:27;-1:-1:-1;2101:55:48;;2152:1;2149;2142:12;2101:55;2192:2;2179:16;2218:18;2210:6;2207:30;2204:50;;;2250:1;2247;2240:12;2204:50;2303:7;2298:2;2288:6;2285:1;2281:14;2277:2;2273:23;2269:32;2266:45;2263:65;;;2324:1;2321;2314:12;2263:65;2355:2;2347:11;;;;;2377:6;;-1:-1:-1;1779:610:48;-1:-1:-1;;;1779:610:48:o;2394:180::-;2453:6;2506:2;2494:9;2485:7;2481:23;2477:32;2474:52;;;2522:1;2519;2512:12;2474:52;-1:-1:-1;2545:23:48;;2394:180;-1:-1:-1;2394:180:48:o;2579:525::-;2726:2;2715:9;2708:21;2689:4;2758:6;2752:13;2801:6;2796:2;2785:9;2781:18;2774:34;2826:1;2836:140;2850:6;2847:1;2844:13;2836:140;;;2961:2;2945:14;;;2941:23;;2935:30;2930:2;2911:17;;;2907:26;2900:66;2865:10;2836:140;;;2840:3;3025:1;3020:2;3011:6;3000:9;2996:22;2992:31;2985:42;3095:2;3088;3084:7;3079:2;3071:6;3067:15;3063:29;3052:9;3048:45;3044:54;3036:62;;;2579:525;;;;:::o;3109:286::-;3168:6;3221:2;3209:9;3200:7;3196:23;3192:32;3189:52;;;3237:1;3234;3227:12;3189:52;3263:23;;-1:-1:-1;;;;;3315:31:48;;3305:42;;3295:70;;3361:1;3358;3351:12;3813:394;3906:6;3959:2;3947:9;3938:7;3934:23;3930:32;3927:52;;;3975:1;3972;3965:12;3927:52;4015:9;4002:23;4048:18;4040:6;4037:30;4034:50;;;4080:1;4077;4070:12;4034:50;4103:22;;4159:3;4141:16;;;4137:26;4134:46;;;4176:1;4173;4166:12;5882:127;5943:10;5938:3;5934:20;5931:1;5924:31;5974:4;5971:1;5964:15;5998:4;5995:1;5988:15;6014:380;6093:1;6089:12;;;;6136;;;6157:61;;6211:4;6203:6;6199:17;6189:27;;6157:61;6264:2;6256:6;6253:14;6233:18;6230:38;6227:161;;6310:10;6305:3;6301:20;6298:1;6291:31;6345:4;6342:1;6335:15;6373:4;6370:1;6363:15;6227:161;;6014:380;;;:::o;6524:517::-;6625:2;6620:3;6617:11;6614:421;;;6661:5;6658:1;6651:16;6705:4;6702:1;6692:18;6775:2;6763:10;6759:19;6756:1;6752:27;6746:4;6742:38;6811:4;6799:10;6796:20;6793:47;;;-1:-1:-1;6834:4:48;6793:47;6889:2;6884:3;6880:12;6877:1;6873:20;6867:4;6863:31;6853:41;;6944:81;6962:2;6955:5;6952:13;6944:81;;;7021:1;7007:16;;6988:1;6977:13;6944:81;;;6948:3;;6614:421;6524:517;;;:::o;7217:1202::-;7339:18;7334:3;7331:27;7328:53;;;7361:18;;:::i;:::-;7390:93;7479:3;7439:38;7471:4;7465:11;7439:38;:::i;:::-;7433:4;7390:93;:::i;:::-;7509:1;7534:2;7529:3;7526:11;7551:1;7546:615;;;;8205:1;8222:3;8219:93;;;-1:-1:-1;8278:19:48;;;8265:33;8219:93;-1:-1:-1;;7174:1:48;7170:11;;;7166:24;7162:29;7152:40;7198:1;7194:11;;;7149:57;8325:78;;7519:894;;7546:615;6471:1;6464:14;;;6508:4;6495:18;;-1:-1:-1;;7582:17:48;;;7682:9;7704:229;7718:7;7715:1;7712:14;7704:229;;;7807:19;;;7794:33;7779:49;;7914:4;7899:20;;;;7867:1;7855:14;;;;7734:12;7704:229;;;7708:3;7961;7952:7;7949:16;7946:159;;;8085:1;8081:6;8075:3;8069;8066:1;8062:11;8058:21;8054:34;8050:39;8037:9;8032:3;8028:19;8015:33;8011:79;8003:6;7996:95;7946:159;;;8148:1;8142:3;8139:1;8135:11;8131:19;8125:4;8118:33;7519:894;;7217:1202;;;:::o;8729:266::-;8817:6;8812:3;8805:19;8869:6;8862:5;8855:4;8850:3;8846:14;8833:43;-1:-1:-1;8921:1:48;8896:16;;;8914:4;8892:27;;;8885:38;;;;8977:2;8956:15;;;-1:-1:-1;;8952:29:48;8943:39;;;8939:50;;8729:266::o;9000:502::-;9241:2;9230:9;9223:21;9204:4;9267:61;9324:2;9313:9;9309:18;9301:6;9293;9267:61;:::i;:::-;9376:9;9368:6;9364:22;9359:2;9348:9;9344:18;9337:50;9404:49;9446:6;9438;9430;9404:49;:::i;:::-;9396:57;;;9489:6;9484:2;9473:9;9469:18;9462:34;9000:502;;;;;;;;:::o;9507:127::-;9568:10;9563:3;9559:20;9556:1;9549:31;9599:4;9596:1;9589:15;9623:4;9620:1;9613:15;9639:168;9712:9;;;9743;;9760:15;;;9754:22;;9740:37;9730:71;;9781:18;;:::i;10164:127::-;10225:10;10220:3;10216:20;10213:1;10206:31;10256:4;10253:1;10246:15;10280:4;10277:1;10270:15;10296:125;10361:9;;;10382:10;;;10379:36;;;10395:18;;:::i;11105:286::-;11163:6;11216:2;11204:9;11195:7;11191:23;11187:32;11184:52;;;11232:1;11229;11222:12;11184:52;11258:23;;-1:-1:-1;;;;;;11310:32:48;;11300:43;;11290:71;;11357:1;11354;11347:12;11396:281;11454:6;11507:2;11495:9;11486:7;11482:23;11478:32;11475:52;;;11523:1;11520;11513:12;11475:52;11549:23;;-1:-1:-1;;;;;;11601:27:48;;11591:38;;11581:66;;11643:1;11640;11633:12;11682:521;11759:4;11765:6;11825:11;11812:25;11919:2;11915:7;11904:8;11888:14;11884:29;11880:43;11860:18;11856:68;11846:96;;11938:1;11935;11928:12;11846:96;11965:33;;12017:20;;;-1:-1:-1;12060:18:48;12049:30;;12046:50;;;12092:1;12089;12082:12;12046:50;12125:4;12113:17;;-1:-1:-1;12156:14:48;12152:27;;;12142:38;;12139:58;;;12193:1;12190;12183:12;14026:459;14267:6;14256:9;14249:25;14310:6;14305:2;14294:9;14290:18;14283:34;14353:3;14348:2;14337:9;14333:18;14326:31;14230:4;14374:62;14431:3;14420:9;14416:19;14408:6;14400;14374:62;:::i;:::-;14366:70;;14472:6;14467:2;14456:9;14452:18;14445:34;14026:459;;;;;;;;:::o;14490:277::-;14557:6;14610:2;14598:9;14589:7;14585:23;14581:32;14578:52;;;14626:1;14623;14616:12;14578:52;14658:9;14652:16;14711:5;14704:13;14697:21;14690:5;14687:32;14677:60;;14733:1;14730;14723:12;15829:128;15896:9;;;15917:11;;;15914:37;;;15931:18;;:::i;17216:853::-;-1:-1:-1;;;;;;17575:33:48;;17563:46;;-1:-1:-1;;;;;;17638:28:48;;17634:1;17625:11;;17618:49;17710:6;17702;17698:1;17689:11;;17676:41;17545:3;17745:6;17740:3;17736:16;17779:1;17775:2;17771:10;17801:1;17797:2;17790:13;17837:6;17829;17825:2;17812:32;-1:-1:-1;17906:1:48;17867:15;;;17884:1;17863:23;17895:13;;;17942:6;17934;17863:23;17917:32;-1:-1:-1;;;;;;18003:33:48;;;;17968:15;;;;17992:45;;;-1:-1:-1;18061:1:48;18053:10;;17216:853;-1:-1:-1;;;;;;;;17216:853:48:o;19867:412::-;19985:12;;20033:4;20022:16;;20016:23;-1:-1:-1;;20057:40:48;;;19985:12;20120:2;20109:14;;20106:167;;;20235:26;20231:31;20200:26;20196:31;20186:6;20182:2;20178:15;20175:1;20171:23;20167:61;20163:2;20159:70;20155:108;20146:117;;20106:167;;;19867:412;;;:::o;20284:148::-;20372:4;20351:12;;;20365;;;20347:31;;20390:13;;20387:39;;;20406:18;;:::i","linkReferences":{}},"methodIdentifiers":{"DEPOSIT_AMOUNT()":"ec6925a7","LIGHT_CLIENT()":"e613ae00","SYSTEM_CALLER()":"d761753e","acceptOwnership()":"79ba5097","batchWithdraw(bytes32[])":"59c19cee","deposit((bytes4,bytes2,bytes,bytes,bytes,bytes4,bytes,uint256,uint256))":"dd95c7c6","depositScript()":"b93780f6","getWithdrawalCount()":"781952a8","initialize(bytes,bytes,uint256)":"41260137","initialized()":"158ef93e","operator()":"570ca735","owner()":"8da5cb5b","pendingOwner()":"e30c3978","renounceOwnership()":"715018a6","requiredSigsCount()":"43e31687","scriptSuffix()":"87f8bf56","setDepositScript(bytes,bytes,uint256)":"9f963f59","setOperator(address)":"b3ab15fb","spentWtxIds(bytes32)":"5e0e5b3e","transferOwnership(address)":"f2fde38b","withdraw(bytes32)":"8e19899e","withdrawalAddrs(uint256)":"d1c44456"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.26+commit.8a97fa7a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"wtxId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"depositScript\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"scriptSuffix\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requiredSigsCount\",\"type\":\"uint256\"}],\"name\":\"DepositScriptUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldOperator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOperator\",\"type\":\"address\"}],\"name\":\"OperatorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"bitcoin_address\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEPOSIT_AMOUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LIGHT_CLIENT\",\"outputs\":[{\"internalType\":\"contract BitcoinLightClient\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SYSTEM_CALLER\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"bitcoin_addresses\",\"type\":\"bytes32[]\"}],\"name\":\"batchWithdraw\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes2\",\"name\":\"flag\",\"type\":\"bytes2\"},{\"internalType\":\"bytes\",\"name\":\"vin\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"vout\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"witness\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"intermediate_nodes\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"block_height\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"internalType\":\"struct Bridge.DepositParams\",\"name\":\"p\",\"type\":\"tuple\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositScript\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWithdrawalCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_depositScript\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_scriptSuffix\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_requiredSigsCount\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"operator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"requiredSigsCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"scriptSuffix\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_depositScript\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_scriptSuffix\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_requiredSigsCount\",\"type\":\"uint256\"}],\"name\":\"setDepositScript\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_operator\",\"type\":\"address\"}],\"name\":\"setOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"spentWtxIds\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"bitcoin_address\",\"type\":\"bytes32\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"withdrawalAddrs\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Citrea\",\"errors\":{\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"batchWithdraw(bytes32[])\":{\"details\":\"Takes in multiple Bitcoin addresses as recipient addresses should be unique\",\"params\":{\"bitcoin_addresses\":\"The Bitcoin addresses of the receivers\"}},\"deposit((bytes4,bytes2,bytes,bytes,bytes,bytes4,bytes,uint256,uint256))\":{\"params\":{\"p\":\"The deposit parameters that contains the info of the deposit transaction on Bitcoin\"}},\"getWithdrawalCount()\":{\"returns\":{\"_0\":\"The count of withdrawals happened so far\"}},\"initialize(bytes,bytes,uint256)\":{\"params\":{\"_depositScript\":\"The deposit script expected in the witness field for all L1 deposits\",\"_requiredSigsCount\":\"The number of signatures that is contained in the deposit script\",\"_scriptSuffix\":\"The suffix of the deposit script that follows the receiver address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"setDepositScript(bytes,bytes,uint256)\":{\"details\":\"Deposit script contains a fixed script that checks signatures of verifiers and pushes EVM address of the receiver\",\"params\":{\"_depositScript\":\"The new deposit script\",\"_requiredSigsCount\":\"The number of signatures that are needed for deposit transaction\",\"_scriptSuffix\":\"The part of the deposit script that succeeds the receiver address\"}},\"setOperator(address)\":{\"params\":{\"_operator\":\"Address of the privileged operator\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"},\"withdraw(bytes32)\":{\"params\":{\"bitcoin_address\":\"The Bitcoin address of the receiver\"}}},\"title\":\"Bridge contract for the Citrea end of Citrea <> Bitcoin bridge\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"batchWithdraw(bytes32[])\":{\"notice\":\"Batch version of `withdraw` that can accept multiple cBTC\"},\"deposit((bytes4,bytes2,bytes,bytes,bytes,bytes4,bytes,uint256,uint256))\":{\"notice\":\"Checks if the deposit amount is sent to the bridge multisig on Bitcoin, and if so, sends the deposit amount to the receiver\"},\"initialize(bytes,bytes,uint256)\":{\"notice\":\"Initializes the bridge contract and sets the deposit script\"},\"setDepositScript(bytes,bytes,uint256)\":{\"notice\":\"Sets the expected deposit script of the deposit transaction on Bitcoin, contained in the witness\"},\"setOperator(address)\":{\"notice\":\"Sets the operator address that can process user deposits\"},\"withdraw(bytes32)\":{\"notice\":\"Accepts 1 cBTC from the sender and inserts this withdrawal request of 1 BTC on Bitcoin into the withdrawals array so that later on can be processed by the operator \"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/Bridge.sol\":\"Bridge\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"appendCBOR\":false,\"bytecodeHash\":\"none\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\",\":@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/\",\":bitcoin-spv/=lib/bitcoin-spv/\",\":ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin/=lib/openzeppelin-contracts/contracts/\"]},\"sources\":{\"lib/WitnessUtils.sol\":{\"keccak256\":\"0x0b0d59b4e73d6f5b4bbf1032f72bb15c2f1548c2ee319b80ae9e4c22576a70af\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://8499a5fc520941cb1b970637850cabfbc2d5a51abed824886063420c686b57de\",\"dweb:/ipfs/QmaLYLJ36PyFAaP3MgvFWW3knDsSUtVfCfs7Lp7oYFPZ1w\"]},\"lib/bitcoin-spv/solidity/contracts/BTCUtils.sol\":{\"keccak256\":\"0x439eaa97e9239705f3d31e8d39dccbad32311f1f119e295d53c65e0ae3c5a5fc\",\"urls\":[\"bzz-raw://976a361a89c21afc44b5e0a552271d9288b12cf34a9925c25f3c6975ece4e667\",\"dweb:/ipfs/QmNTb4eJyxV5iZj8RJGFBGSKXWsuvoMYqLLBgk16dhWePH\"]},\"lib/bitcoin-spv/solidity/contracts/BytesLib.sol\":{\"keccak256\":\"0x43e0f3b3b23c861bd031588bf410dfdd02e2af17941a89aa38d70e534e0380d1\",\"urls\":[\"bzz-raw://76011d699a8b229dbfdc698b3ece658daad9d96778e86d679aa576bc966209d6\",\"dweb:/ipfs/QmRZEWAeRQtsTUvfzEd1jb2wAqpTNR5KAme92gBRn4SYiT\"]},\"lib/bitcoin-spv/solidity/contracts/SafeMath.sol\":{\"keccak256\":\"0x35930d982394c7ffde439b82e5e696c5b21a6f09699d44861dfe409ef64084a3\",\"urls\":[\"bzz-raw://090e9d78755d4916fa2f5f5d8f9fd2fc59bfc5a25a5e91636a92c4c07aee9c6b\",\"dweb:/ipfs/QmXfz4TPDvgnuYz9eS5AL87GfCLxHQZJV1Y8ieJU9M8yTe\"]},\"lib/bitcoin-spv/solidity/contracts/ValidateSPV.sol\":{\"keccak256\":\"0xce3febbf3ad3a7ff8a8effd0c7ccaf7ccfa2719578b537d49ea196f0bae8062b\",\"urls\":[\"bzz-raw://5f18942483bf20507ae6c0abb5421df96b1aebb7af15f541bda8470f6277312a\",\"dweb:/ipfs/QmPzEpA8w5k6pVFadm3UCLqNdxFAjPwP9Lpi5HMQsQg52J\"]},\"lib/openzeppelin-contracts-upgradeable/contracts/access/Ownable2StepUpgradeable.sol\":{\"keccak256\":\"0xbca4a4f66d98028293dba695851d1b20d3e0ba2fff7453fb241f192fa3fc6b6f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://013b3cfd9d1e34dad409c3b9a340860e8651e61cda509de33599fb5102f62fe7\",\"dweb:/ipfs/QmTVjDKofM9Nst8w8LAA3HHgi1eCnGYBpFb7Nbat71e2xz\"]},\"lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\":{\"keccak256\":\"0xc163fcf9bb10138631a9ba5564df1fa25db9adff73bd9ee868a8ae1858fe093a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9706d43a0124053d9880f6e31a59f31bc0a6a3dc1acd66ce0a16e1111658c5f6\",\"dweb:/ipfs/QmUFmfowzkRwGtDu36cXV9SPTBHJ3n7dG9xQiK5B28jTf2\"]},\"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol\":{\"keccak256\":\"0x631188737069917d2f909d29ce62c4d48611d326686ba6683e26b72a23bfac0b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7a61054ae84cd6c4d04c0c4450ba1d6de41e27e0a2c4f1bcdf58f796b401c609\",\"dweb:/ipfs/QmUvtdp7X1mRVyC3CsHrtPbgoqWaXHp3S1ZR24tpAQYJWM\"]},\"lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol\":{\"keccak256\":\"0xdbef5f0c787055227243a7318ef74c8a5a1108ca3a07f2b3a00ef67769e1e397\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://08e39f23d5b4692f9a40803e53a8156b72b4c1f9902a88cd65ba964db103dab9\",\"dweb:/ipfs/QmPKn6EYDgpga7KtpkA8wV2yJCYGMtc9K4LkJfhKX2RVSV\"]},\"src/BitcoinLightClient.sol\":{\"keccak256\":\"0x9c8acc0e16c7a02b3328bf41cf08922b43f1eaf780199a0cf4aefac61ad2528c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ac95a3440699da490d6830aec1ad4d515d7bba605be570767b39cf7fbdd182e7\",\"dweb:/ipfs/QmUt8FcufKn5afs1n2cf2JF1wwti1pDSaNnxDzJNRcqyWf\"]},\"src/Bridge.sol\":{\"keccak256\":\"0xe7d77b56775f141e42494ddcb6d242d3199bdabb09078e076ba0053f953c43a9\",\"license\":\"UNLICENSED\",\"urls\":[\"bzz-raw://62ed60e2acb1a2d3862c3b252b62f277eef1634f11b0e8b50cff6449c8ed8bcc\",\"dweb:/ipfs/Qmeu6q5ddpxj9qUx75vXe7R5p8QEr9oEo8kCtduNk5fng3\"]},\"src/interfaces/IBitcoinLightClient.sol\":{\"keccak256\":\"0x7b7bce470657991ad77890c0f9a3e01570279e6143038ed1b6f82f783feea33a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://52c1a77b309c61d34eb39b8a77fd5a5f8c154e50fd60db3007f5049d6b06b650\",\"dweb:/ipfs/QmdHbULcAzZtD7u55bkQ8D9FEPMRvy1jgwNC3pFxHtiUfL\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.26+commit.8a97fa7a"},"language":"Solidity","output":{"abi":[{"inputs":[],"type":"error","name":"InvalidInitialization"},{"inputs":[],"type":"error","name":"NotInitializing"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"type":"error","name":"OwnableInvalidOwner"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"type":"error","name":"OwnableUnauthorizedAccount"},{"inputs":[{"internalType":"bytes32","name":"wtxId","type":"bytes32","indexed":false},{"internalType":"address","name":"recipient","type":"address","indexed":false},{"internalType":"uint256","name":"timestamp","type":"uint256","indexed":false}],"type":"event","name":"Deposit","anonymous":false},{"inputs":[{"internalType":"bytes","name":"depositScript","type":"bytes","indexed":false},{"internalType":"bytes","name":"scriptSuffix","type":"bytes","indexed":false},{"internalType":"uint256","name":"requiredSigsCount","type":"uint256","indexed":false}],"type":"event","name":"DepositScriptUpdate","anonymous":false},{"inputs":[{"internalType":"uint64","name":"version","type":"uint64","indexed":false}],"type":"event","name":"Initialized","anonymous":false},{"inputs":[{"internalType":"address","name":"oldOperator","type":"address","indexed":false},{"internalType":"address","name":"newOperator","type":"address","indexed":false}],"type":"event","name":"OperatorUpdated","anonymous":false},{"inputs":[{"internalType":"address","name":"previousOwner","type":"address","indexed":true},{"internalType":"address","name":"newOwner","type":"address","indexed":true}],"type":"event","name":"OwnershipTransferStarted","anonymous":false},{"inputs":[{"internalType":"address","name":"previousOwner","type":"address","indexed":true},{"internalType":"address","name":"newOwner","type":"address","indexed":true}],"type":"event","name":"OwnershipTransferred","anonymous":false},{"inputs":[{"internalType":"bytes32","name":"bitcoin_address","type":"bytes32","indexed":false},{"internalType":"uint256","name":"index","type":"uint256","indexed":false},{"internalType":"uint256","name":"timestamp","type":"uint256","indexed":false}],"type":"event","name":"Withdrawal","anonymous":false},{"inputs":[],"stateMutability":"view","type":"function","name":"DEPOSIT_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"LIGHT_CLIENT","outputs":[{"internalType":"contract BitcoinLightClient","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"SYSTEM_CALLER","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"nonpayable","type":"function","name":"acceptOwnership"},{"inputs":[{"internalType":"bytes32[]","name":"bitcoin_addresses","type":"bytes32[]"}],"stateMutability":"payable","type":"function","name":"batchWithdraw"},{"inputs":[{"internalType":"struct Bridge.DepositParams","name":"p","type":"tuple","components":[{"internalType":"bytes4","name":"version","type":"bytes4"},{"internalType":"bytes2","name":"flag","type":"bytes2"},{"internalType":"bytes","name":"vin","type":"bytes"},{"internalType":"bytes","name":"vout","type":"bytes"},{"internalType":"bytes","name":"witness","type":"bytes"},{"internalType":"bytes4","name":"locktime","type":"bytes4"},{"internalType":"bytes","name":"intermediate_nodes","type":"bytes"},{"internalType":"uint256","name":"block_height","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}]}],"stateMutability":"nonpayable","type":"function","name":"deposit"},{"inputs":[],"stateMutability":"view","type":"function","name":"depositScript","outputs":[{"internalType":"bytes","name":"","type":"bytes"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"getWithdrawalCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[{"internalType":"bytes","name":"_depositScript","type":"bytes"},{"internalType":"bytes","name":"_scriptSuffix","type":"bytes"},{"internalType":"uint256","name":"_requiredSigsCount","type":"uint256"}],"stateMutability":"nonpayable","type":"function","name":"initialize"},{"inputs":[],"stateMutability":"view","type":"function","name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"nonpayable","type":"function","name":"renounceOwnership"},{"inputs":[],"stateMutability":"view","type":"function","name":"requiredSigsCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"scriptSuffix","outputs":[{"internalType":"bytes","name":"","type":"bytes"}]},{"inputs":[{"internalType":"bytes","name":"_depositScript","type":"bytes"},{"internalType":"bytes","name":"_scriptSuffix","type":"bytes"},{"internalType":"uint256","name":"_requiredSigsCount","type":"uint256"}],"stateMutability":"nonpayable","type":"function","name":"setDepositScript"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"setOperator"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function","name":"spentWtxIds","outputs":[{"internalType":"bool","name":"","type":"bool"}]},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"transferOwnership"},{"inputs":[{"internalType":"bytes32","name":"bitcoin_address","type":"bytes32"}],"stateMutability":"payable","type":"function","name":"withdraw"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function","name":"withdrawalAddrs","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]}],"devdoc":{"kind":"dev","methods":{"acceptOwnership()":{"details":"The new owner accepts the ownership transfer."},"batchWithdraw(bytes32[])":{"details":"Takes in multiple Bitcoin addresses as recipient addresses should be unique","params":{"bitcoin_addresses":"The Bitcoin addresses of the receivers"}},"deposit((bytes4,bytes2,bytes,bytes,bytes,bytes4,bytes,uint256,uint256))":{"params":{"p":"The deposit parameters that contains the info of the deposit transaction on Bitcoin"}},"getWithdrawalCount()":{"returns":{"_0":"The count of withdrawals happened so far"}},"initialize(bytes,bytes,uint256)":{"params":{"_depositScript":"The deposit script expected in the witness field for all L1 deposits","_requiredSigsCount":"The number of signatures that is contained in the deposit script","_scriptSuffix":"The suffix of the deposit script that follows the receiver address"}},"owner()":{"details":"Returns the address of the current owner."},"pendingOwner()":{"details":"Returns the address of the pending owner."},"renounceOwnership()":{"details":"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner."},"setDepositScript(bytes,bytes,uint256)":{"details":"Deposit script contains a fixed script that checks signatures of verifiers and pushes EVM address of the receiver","params":{"_depositScript":"The new deposit script","_requiredSigsCount":"The number of signatures that are needed for deposit transaction","_scriptSuffix":"The part of the deposit script that succeeds the receiver address"}},"setOperator(address)":{"params":{"_operator":"Address of the privileged operator"}},"transferOwnership(address)":{"details":"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner."},"withdraw(bytes32)":{"params":{"bitcoin_address":"The Bitcoin address of the receiver"}}},"version":1},"userdoc":{"kind":"user","methods":{"batchWithdraw(bytes32[])":{"notice":"Batch version of `withdraw` that can accept multiple cBTC"},"deposit((bytes4,bytes2,bytes,bytes,bytes,bytes4,bytes,uint256,uint256))":{"notice":"Checks if the deposit amount is sent to the bridge multisig on Bitcoin, and if so, sends the deposit amount to the receiver"},"initialize(bytes,bytes,uint256)":{"notice":"Initializes the bridge contract and sets the deposit script"},"setDepositScript(bytes,bytes,uint256)":{"notice":"Sets the expected deposit script of the deposit transaction on Bitcoin, contained in the witness"},"setOperator(address)":{"notice":"Sets the operator address that can process user deposits"},"withdraw(bytes32)":{"notice":"Accepts 1 cBTC from the sender and inserts this withdrawal request of 1 BTC on Bitcoin into the withdrawals array so that later on can be processed by the operator "}},"version":1}},"settings":{"remappings":["@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/","@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/","bitcoin-spv/=lib/bitcoin-spv/","ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/","forge-std/=lib/forge-std/src/","openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/","openzeppelin-contracts/=lib/openzeppelin-contracts/","openzeppelin/=lib/openzeppelin-contracts/contracts/"],"optimizer":{"enabled":true,"runs":200},"metadata":{"bytecodeHash":"none","appendCBOR":false},"compilationTarget":{"src/Bridge.sol":"Bridge"},"evmVersion":"paris","libraries":{}},"sources":{"lib/WitnessUtils.sol":{"keccak256":"0x0b0d59b4e73d6f5b4bbf1032f72bb15c2f1548c2ee319b80ae9e4c22576a70af","urls":["bzz-raw://8499a5fc520941cb1b970637850cabfbc2d5a51abed824886063420c686b57de","dweb:/ipfs/QmaLYLJ36PyFAaP3MgvFWW3knDsSUtVfCfs7Lp7oYFPZ1w"],"license":"LGPL-3.0-or-later"},"lib/bitcoin-spv/solidity/contracts/BTCUtils.sol":{"keccak256":"0x439eaa97e9239705f3d31e8d39dccbad32311f1f119e295d53c65e0ae3c5a5fc","urls":["bzz-raw://976a361a89c21afc44b5e0a552271d9288b12cf34a9925c25f3c6975ece4e667","dweb:/ipfs/QmNTb4eJyxV5iZj8RJGFBGSKXWsuvoMYqLLBgk16dhWePH"],"license":null},"lib/bitcoin-spv/solidity/contracts/BytesLib.sol":{"keccak256":"0x43e0f3b3b23c861bd031588bf410dfdd02e2af17941a89aa38d70e534e0380d1","urls":["bzz-raw://76011d699a8b229dbfdc698b3ece658daad9d96778e86d679aa576bc966209d6","dweb:/ipfs/QmRZEWAeRQtsTUvfzEd1jb2wAqpTNR5KAme92gBRn4SYiT"],"license":null},"lib/bitcoin-spv/solidity/contracts/SafeMath.sol":{"keccak256":"0x35930d982394c7ffde439b82e5e696c5b21a6f09699d44861dfe409ef64084a3","urls":["bzz-raw://090e9d78755d4916fa2f5f5d8f9fd2fc59bfc5a25a5e91636a92c4c07aee9c6b","dweb:/ipfs/QmXfz4TPDvgnuYz9eS5AL87GfCLxHQZJV1Y8ieJU9M8yTe"],"license":null},"lib/bitcoin-spv/solidity/contracts/ValidateSPV.sol":{"keccak256":"0xce3febbf3ad3a7ff8a8effd0c7ccaf7ccfa2719578b537d49ea196f0bae8062b","urls":["bzz-raw://5f18942483bf20507ae6c0abb5421df96b1aebb7af15f541bda8470f6277312a","dweb:/ipfs/QmPzEpA8w5k6pVFadm3UCLqNdxFAjPwP9Lpi5HMQsQg52J"],"license":null},"lib/openzeppelin-contracts-upgradeable/contracts/access/Ownable2StepUpgradeable.sol":{"keccak256":"0xbca4a4f66d98028293dba695851d1b20d3e0ba2fff7453fb241f192fa3fc6b6f","urls":["bzz-raw://013b3cfd9d1e34dad409c3b9a340860e8651e61cda509de33599fb5102f62fe7","dweb:/ipfs/QmTVjDKofM9Nst8w8LAA3HHgi1eCnGYBpFb7Nbat71e2xz"],"license":"MIT"},"lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol":{"keccak256":"0xc163fcf9bb10138631a9ba5564df1fa25db9adff73bd9ee868a8ae1858fe093a","urls":["bzz-raw://9706d43a0124053d9880f6e31a59f31bc0a6a3dc1acd66ce0a16e1111658c5f6","dweb:/ipfs/QmUFmfowzkRwGtDu36cXV9SPTBHJ3n7dG9xQiK5B28jTf2"],"license":"MIT"},"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol":{"keccak256":"0x631188737069917d2f909d29ce62c4d48611d326686ba6683e26b72a23bfac0b","urls":["bzz-raw://7a61054ae84cd6c4d04c0c4450ba1d6de41e27e0a2c4f1bcdf58f796b401c609","dweb:/ipfs/QmUvtdp7X1mRVyC3CsHrtPbgoqWaXHp3S1ZR24tpAQYJWM"],"license":"MIT"},"lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol":{"keccak256":"0xdbef5f0c787055227243a7318ef74c8a5a1108ca3a07f2b3a00ef67769e1e397","urls":["bzz-raw://08e39f23d5b4692f9a40803e53a8156b72b4c1f9902a88cd65ba964db103dab9","dweb:/ipfs/QmPKn6EYDgpga7KtpkA8wV2yJCYGMtc9K4LkJfhKX2RVSV"],"license":"MIT"},"src/BitcoinLightClient.sol":{"keccak256":"0x9c8acc0e16c7a02b3328bf41cf08922b43f1eaf780199a0cf4aefac61ad2528c","urls":["bzz-raw://ac95a3440699da490d6830aec1ad4d515d7bba605be570767b39cf7fbdd182e7","dweb:/ipfs/QmUt8FcufKn5afs1n2cf2JF1wwti1pDSaNnxDzJNRcqyWf"],"license":"MIT"},"src/Bridge.sol":{"keccak256":"0xe7d77b56775f141e42494ddcb6d242d3199bdabb09078e076ba0053f953c43a9","urls":["bzz-raw://62ed60e2acb1a2d3862c3b252b62f277eef1634f11b0e8b50cff6449c8ed8bcc","dweb:/ipfs/Qmeu6q5ddpxj9qUx75vXe7R5p8QEr9oEo8kCtduNk5fng3"],"license":"UNLICENSED"},"src/interfaces/IBitcoinLightClient.sol":{"keccak256":"0x7b7bce470657991ad77890c0f9a3e01570279e6143038ed1b6f82f783feea33a","urls":["bzz-raw://52c1a77b309c61d34eb39b8a77fd5a5f8c154e50fd60db3007f5049d6b06b650","dweb:/ipfs/QmdHbULcAzZtD7u55bkQ8D9FEPMRvy1jgwNC3pFxHtiUfL"],"license":"MIT"}},"version":1},"id":43} \ No newline at end of file diff --git a/crates/evm/src/evm/system_contracts/src/Bridge.sol b/crates/evm/src/evm/system_contracts/src/Bridge.sol index 6d6ecda32..8519db577 100644 --- a/crates/evm/src/evm/system_contracts/src/Bridge.sol +++ b/crates/evm/src/evm/system_contracts/src/Bridge.sol @@ -166,22 +166,38 @@ contract Bridge is Ownable2StepUpgradeable { emit OperatorUpdated(operator, _operator); } - /// @notice Checks if two byte sequences are equal - /// @dev This is not efficient, and a better approach would be doing a hash based comparison but as this is ran in a zkEVM, hashing is inefficient + /// @notice Checks if two byte sequences are equal in chunks of 32 bytes + /// @dev This approach compares chunks of 32 bytes using bytes32 equality checks for optimization /// @param a First byte sequence /// @param b Second byte sequence function isBytesEqual(bytes memory a, bytes memory b) internal pure returns (bool result) { - require(a.length == b.length, "Lengths do not match"); + uint256 len = a.length; + if (len != b.length) { + return false; + } + + uint256 offset = 32; + bytes32 chunkA; + bytes32 chunkB; + while (offset <= len) { + assembly { + chunkA := mload(add(a, offset)) + chunkB := mload(add(b, offset)) + offset := add(offset, 32) + } + if (chunkA != chunkB) { + return false; + } + } - // Cannot use keccak as its costly in ZK environment - uint length = a.length; - for (uint i = 0; i < length; i++) { + // Check remaining bytes (if any) + for (uint i = offset - 32; i < len; i++) { if (a[i] != b[i]) { - result = false; - return result; + return false; } } - result = true; + + return true; } function extractRecipientAddress(bytes memory _script) internal view returns (address) { diff --git a/crates/evm/src/evm/system_contracts/test/Bridge.t.sol b/crates/evm/src/evm/system_contracts/test/Bridge.t.sol index f0c192022..e11bd21f1 100644 --- a/crates/evm/src/evm/system_contracts/test/Bridge.t.sol +++ b/crates/evm/src/evm/system_contracts/test/Bridge.t.sol @@ -226,7 +226,7 @@ contract BridgeTest is Test { doDeposit(); } - function testBytesEqual() public { + function testBytesEqual() public view { bytes memory a = hex"1234"; bytes memory b = hex"1234"; bytes memory c = hex"1235"; @@ -239,11 +239,32 @@ contract BridgeTest is Test { assert(!bridge.isBytesEqual_(d, e)); assert(bridge.isBytesEqual_(d, f)); - vm.expectRevert(); - bridge.isBytesEqual_(a, d); + assertFalse(bridge.isBytesEqual_(a, d)); + assertFalse(bridge.isBytesEqual_(a, hex"")); + } - vm.expectRevert(); - bridge.isBytesEqual_(a, hex""); + function testBytesEqualEdge() public view { + bytes memory a31 = hex"689059e65a478c636524643c3141f00fe3c27b802580fc12a3da9bc373596b"; + bytes memory b31 = hex"689059e65a478c636524643c3141f00fe3c27b802580fc12a3da9bc373596b"; + bytes memory c31 = hex"689059e65a478c636524643c3141f00fe3c27b802580fc12a3da9bc373596a"; + assert(bridge.isBytesEqual_(a31, b31)); + assert(!bridge.isBytesEqual_(a31, c31)); + + bytes memory a32 = hex"689059e65a478c636524643c3141f00fe3c27b802580fc12a3da9bc373596b5c"; + bytes memory b32 = hex"689059e65a478c636524643c3141f00fe3c27b802580fc12a3da9bc373596b5c"; + bytes memory c32 = hex"689059e65a478c636524643c3141f00fe3c27b802580fc12a3da9bc373596b5a"; + assert(bridge.isBytesEqual_(a32, b32)); + assert(!bridge.isBytesEqual_(a32, c32)); + + bytes memory a33 = hex"689059e65a478c636524643c3141f00fe3c27b802580fc12a3da9bc373596b5c1f"; + bytes memory b33 = hex"689059e65a478c636524643c3141f00fe3c27b802580fc12a3da9bc373596b5c1f"; + bytes memory c33 = hex"689059e65a478c636524643c3141f00fe3c27b802580fc12a3da9bc373596b5c1a"; + assert(bridge.isBytesEqual_(a33, b33)); + assert(!bridge.isBytesEqual_(a33, c33)); + + assert(!bridge.isBytesEqual_(a31, a32)); + assert(!bridge.isBytesEqual_(a31, a33)); + assert(!bridge.isBytesEqual_(a32, a33)); } function testBytesEqualFuzz(bytes memory a, bytes memory b) public view { diff --git a/resources/genesis/bitcoin-regtest/evm.json b/resources/genesis/bitcoin-regtest/evm.json index 812a8e169..a07c04b08 100644 --- a/resources/genesis/bitcoin-regtest/evm.json +++ b/resources/genesis/bitcoin-regtest/evm.json @@ -76,7 +76,7 @@ { "address": "0x3200000000000000000000000000000000000002", "balance": "0x0", - "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611ea0565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f19565b610624565b34801561020b57600080fd5b5061015461021a366004611f90565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fa9565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611f90565b610853565b3480156102c457600080fd5b506101896102d3366004611ea0565b61091c565b3480156102e457600080fd5b506101896102f3366004611ff7565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611f90565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612020565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db366004611ff7565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff1916600117905560026105568587836120fb565b5060036105648385836120fb565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121e4565b60405180910390a15050505050565b61063581662386f26fc10000612234565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f61224b565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f461224b565b9050602002013582846107079190612261565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612072565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612072565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d28587836120fb565b5060036109e08385836120fb565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121e4565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612072565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612274565b610b3e604085016020860161229e565b610b4b60408601866122c8565b610b5860608801886122c8565b610b6560808a018a6122c8565b610b7560c08c0160a08d01612274565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122c8565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122c8565b8861010001356040518663ffffffff1660e01b8152600401610e9995949392919061230f565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612341565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612261565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612072565b915060009050611007838284611840565b905061109d816002805461101a90612072565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612072565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612261565b6110fd856014612261565b86516111099190612363565b869190611840565b9050611124816003805461101a90612072565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119c6565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f826119fc565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a999989796959493929190612376565b604051602081830303815290604052611a6d565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612261565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611a94565b9050600019810361144d575060009695505050505050565b6114578184612261565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612261565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611add565b905060001981036114f1575060009695505050505050565b6114fb8184612261565b9250506001016114b1565b600080611514836000611b41565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611ce5565b90506000198103611571576000935050505061158d565b61157b8184612261565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611ce5565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612261565b915060010161159b565b506116178582611ce5565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612261565b905060005b868110156117bf5761174b8883611b41565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612261565b6117ab9190612261565b6117b59083612261565b9150600101611739565b506117ca8782611b41565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612261565b61182d906001612261565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612261565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b6000815183511461194e5760405162461bcd60e51b8152602060048201526014602482015273098cadccee8d0e640c8de40dcdee840dac2e8c6d60631b604482015260640161043f565b825160005b818110156119bb5783818151811061196d5761196d61224b565b602001015160f81c60f81b6001600160f81b0319168582815181106119945761199461224b565b01602001516001600160f81b031916146119b35760009250505061158d565b600101611953565b506001949350505050565b600080600280546119d690612072565b9150600090506119e884836014611840565b6119f1906123df565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611aa38585611d87565b909250905060018201611abc576000199250505061158d565b80611ac8836025612261565b611ad29190612261565b61166d906004612261565b6000611aea826009612261565b83511015611afb575060001961158d565b600080611b1285611b0d866008612261565b611b41565b909250905060018201611b2b576000199250505061158d565b80611b37836009612261565b61166d9190612261565b6000806000611b508585611dc9565b90508060ff16600003611b85576000858581518110611b7157611b7161224b565b016020015190935060f81c9150611cde9050565b83611b91826001612432565b60ff16611b9e9190612261565b85511015611bb55760001960009250925050611cde565b60008160ff16600203611bf957611bee611bda611bd3876001612261565b8890611e4f565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611cd4565b8160ff16600403611c4857611c3b611c15611bd3876001612261565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611cd4565b8160ff16600803611cd457611cc7611c64611bd3876001612261565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611cf48585611b41565b909250905060018201611d0d576000199250505061158d565b600080611d1b846001612261565b905060005b83811015611d7c57611d3688611b0d848a612261565b909550925060018301611d52576000199550505050505061158d565b82611d5e866001612261565b611d689190612261565b611d729083612261565b9150600101611d20565b509695505050505050565b600080611d95836025612261565b84511015611daa575060001990506000611cde565b600080611dbc86611b0d876024612261565b9097909650945050505050565b6000828281518110611ddd57611ddd61224b565b016020015160f81c60ff03611df45750600861158d565b828281518110611e0657611e0661224b565b016020015160f81c60fe03611e1d5750600461158d565b828281518110611e2f57611e2f61224b565b016020015160f81c60fd03611e465750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e7057600080fd5b50813567ffffffffffffffff811115611e8857600080fd5b602083019150836020828501011115611cde57600080fd5b600080600080600060608688031215611eb857600080fd5b853567ffffffffffffffff811115611ecf57600080fd5b611edb88828901611e5e565b909650945050602086013567ffffffffffffffff811115611efb57600080fd5b611f0788828901611e5e565b96999598509660400135949350505050565b60008060208385031215611f2c57600080fd5b823567ffffffffffffffff811115611f4357600080fd5b8301601f81018513611f5457600080fd5b803567ffffffffffffffff811115611f6b57600080fd5b8560208260051b8401011115611f8057600080fd5b6020919091019590945092505050565b600060208284031215611fa257600080fd5b5035919050565b602081526000825180602084015260005b81811015611fd75760208186018101516040868401015201611fba565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561200957600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561203257600080fd5b813567ffffffffffffffff81111561204957600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061208657607f821691505b6020821081036120a657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156120f657806000526020600020601f840160051c810160208510156120d35750805b601f840160051c820191505b818110156120f357600081556001016120df565b50505b505050565b67ffffffffffffffff8311156121135761211361205c565b612127836121218354612072565b836120ac565b6000601f84116001811461215b57600085156121435750838201355b600019600387901b1c1916600186901b1783556120f3565b600083815260209020601f19861690835b8281101561218c578685013582556020948501946001909201910161216c565b50868210156121a95760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006121f86060830187896121bb565b828103602084015261220b8186886121bb565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d61221e565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d61221e565b60006020828403121561228657600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122b057600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122df57600080fd5b83018035915067ffffffffffffffff8211156122fa57600080fd5b602001915036819003821315611cde57600080fd5b85815284602082015260806040820152600061232f6080830185876121bb565b90508260608301529695505050505050565b60006020828403121561235357600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d61221e565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff1981169190601482101561242b576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61221e56" + "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611eb5565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f2e565b610624565b34801561020b57600080fd5b5061015461021a366004611fa5565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fbe565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611fa5565b610853565b3480156102c457600080fd5b506101896102d3366004611eb5565b61091c565b3480156102e457600080fd5b506101896102f336600461200c565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611fa5565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612035565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db36600461200c565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff191660011790556002610556858783612110565b506003610564838583612110565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121f9565b60405180910390a15050505050565b61063581662386f26fc10000612249565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f612260565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f4612260565b9050602002013582846107079190612276565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612087565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612087565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d2858783612110565b5060036109e0838583612110565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121f9565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612087565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612289565b610b3e60408501602086016122b3565b610b4b60408601866122dd565b610b5860608801886122dd565b610b6560808a018a6122dd565b610b7560c08c0160a08d01612289565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122dd565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122dd565b8861010001356040518663ffffffff1660e01b8152600401610e99959493929190612324565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612356565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612276565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612087565b915060009050611007838284611840565b905061109d816002805461101a90612087565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612087565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612276565b6110fd856014612276565b86516111099190612378565b869190611840565b9050611124816003805461101a90612087565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119db565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f82611a11565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a99998979695949392919061238b565b604051602081830303815290604052611a82565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612276565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611aa9565b9050600019810361144d575060009695505050505050565b6114578184612276565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612276565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611af2565b905060001981036114f1575060009695505050505050565b6114fb8184612276565b9250506001016114b1565b600080611514836000611b56565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611cfa565b90506000198103611571576000935050505061158d565b61157b8184612276565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611cfa565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612276565b915060010161159b565b506116178582611cfa565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612276565b905060005b868110156117bf5761174b8883611b56565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612276565b6117ab9190612276565b6117b59083612276565b9150600101611739565b506117ca8782611b56565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612276565b61182d906001612276565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612276565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b8151815160009190811461191c57600091505061158d565b60206000805b838311611952575050848101518482015160209092019180821461194d57600094505050505061158d565b611922565b600061195f602085612378565b90505b848110156119cd5786818151811061197c5761197c612260565b602001015160f81c60f81b6001600160f81b0319168882815181106119a3576119a3612260565b01602001516001600160f81b031916146119c55760009550505050505061158d565b600101611962565b506001979650505050505050565b600080600280546119eb90612087565b9150600090506119fd84836014611840565b611a06906123f4565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611ab88585611d9c565b909250905060018201611ad1576000199250505061158d565b80611add836025612276565b611ae79190612276565b61166d906004612276565b6000611aff826009612276565b83511015611b10575060001961158d565b600080611b2785611b22866008612276565b611b56565b909250905060018201611b40576000199250505061158d565b80611b4c836009612276565b61166d9190612276565b6000806000611b658585611dde565b90508060ff16600003611b9a576000858581518110611b8657611b86612260565b016020015190935060f81c9150611cf39050565b83611ba6826001612447565b60ff16611bb39190612276565b85511015611bca5760001960009250925050611cf3565b60008160ff16600203611c0e57611c03611bef611be8876001612276565b8890611e64565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611ce9565b8160ff16600403611c5d57611c50611c2a611be8876001612276565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611ce9565b8160ff16600803611ce957611cdc611c79611be8876001612276565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611d098585611b56565b909250905060018201611d22576000199250505061158d565b600080611d30846001612276565b905060005b83811015611d9157611d4b88611b22848a612276565b909550925060018301611d67576000199550505050505061158d565b82611d73866001612276565b611d7d9190612276565b611d879083612276565b9150600101611d35565b509695505050505050565b600080611daa836025612276565b84511015611dbf575060001990506000611cf3565b600080611dd186611b22876024612276565b9097909650945050505050565b6000828281518110611df257611df2612260565b016020015160f81c60ff03611e095750600861158d565b828281518110611e1b57611e1b612260565b016020015160f81c60fe03611e325750600461158d565b828281518110611e4457611e44612260565b016020015160f81c60fd03611e5b5750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e8557600080fd5b50813567ffffffffffffffff811115611e9d57600080fd5b602083019150836020828501011115611cf357600080fd5b600080600080600060608688031215611ecd57600080fd5b853567ffffffffffffffff811115611ee457600080fd5b611ef088828901611e73565b909650945050602086013567ffffffffffffffff811115611f1057600080fd5b611f1c88828901611e73565b96999598509660400135949350505050565b60008060208385031215611f4157600080fd5b823567ffffffffffffffff811115611f5857600080fd5b8301601f81018513611f6957600080fd5b803567ffffffffffffffff811115611f8057600080fd5b8560208260051b8401011115611f9557600080fd5b6020919091019590945092505050565b600060208284031215611fb757600080fd5b5035919050565b602081526000825180602084015260005b81811015611fec5760208186018101516040868401015201611fcf565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561201e57600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561204757600080fd5b813567ffffffffffffffff81111561205e57600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061209b57607f821691505b6020821081036120bb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561210b57806000526020600020601f840160051c810160208510156120e85750805b601f840160051c820191505b8181101561210857600081556001016120f4565b50505b505050565b67ffffffffffffffff83111561212857612128612071565b61213c836121368354612087565b836120c1565b6000601f84116001811461217057600085156121585750838201355b600019600387901b1c1916600186901b178355612108565b600083815260209020601f19861690835b828110156121a15786850135825560209485019460019092019101612181565b50868210156121be5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061220d6060830187896121d0565b82810360208401526122208186886121d0565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d612233565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d612233565b60006020828403121561229b57600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122c557600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122f457600080fd5b83018035915067ffffffffffffffff82111561230f57600080fd5b602001915036819003821315611cf357600080fd5b8581528460208201526080604082015260006123446080830185876121d0565b90508260608301529695505050505050565b60006020828403121561236857600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d612233565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff19811691906014821015612440576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61223356" }, { "address": "0x3200000000000000000000000000000000000003", diff --git a/resources/genesis/mock-dockerized/evm.json b/resources/genesis/mock-dockerized/evm.json index 812a8e169..a07c04b08 100644 --- a/resources/genesis/mock-dockerized/evm.json +++ b/resources/genesis/mock-dockerized/evm.json @@ -76,7 +76,7 @@ { "address": "0x3200000000000000000000000000000000000002", "balance": "0x0", - "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611ea0565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f19565b610624565b34801561020b57600080fd5b5061015461021a366004611f90565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fa9565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611f90565b610853565b3480156102c457600080fd5b506101896102d3366004611ea0565b61091c565b3480156102e457600080fd5b506101896102f3366004611ff7565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611f90565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612020565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db366004611ff7565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff1916600117905560026105568587836120fb565b5060036105648385836120fb565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121e4565b60405180910390a15050505050565b61063581662386f26fc10000612234565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f61224b565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f461224b565b9050602002013582846107079190612261565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612072565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612072565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d28587836120fb565b5060036109e08385836120fb565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121e4565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612072565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612274565b610b3e604085016020860161229e565b610b4b60408601866122c8565b610b5860608801886122c8565b610b6560808a018a6122c8565b610b7560c08c0160a08d01612274565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122c8565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122c8565b8861010001356040518663ffffffff1660e01b8152600401610e9995949392919061230f565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612341565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612261565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612072565b915060009050611007838284611840565b905061109d816002805461101a90612072565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612072565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612261565b6110fd856014612261565b86516111099190612363565b869190611840565b9050611124816003805461101a90612072565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119c6565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f826119fc565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a999989796959493929190612376565b604051602081830303815290604052611a6d565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612261565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611a94565b9050600019810361144d575060009695505050505050565b6114578184612261565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612261565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611add565b905060001981036114f1575060009695505050505050565b6114fb8184612261565b9250506001016114b1565b600080611514836000611b41565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611ce5565b90506000198103611571576000935050505061158d565b61157b8184612261565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611ce5565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612261565b915060010161159b565b506116178582611ce5565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612261565b905060005b868110156117bf5761174b8883611b41565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612261565b6117ab9190612261565b6117b59083612261565b9150600101611739565b506117ca8782611b41565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612261565b61182d906001612261565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612261565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b6000815183511461194e5760405162461bcd60e51b8152602060048201526014602482015273098cadccee8d0e640c8de40dcdee840dac2e8c6d60631b604482015260640161043f565b825160005b818110156119bb5783818151811061196d5761196d61224b565b602001015160f81c60f81b6001600160f81b0319168582815181106119945761199461224b565b01602001516001600160f81b031916146119b35760009250505061158d565b600101611953565b506001949350505050565b600080600280546119d690612072565b9150600090506119e884836014611840565b6119f1906123df565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611aa38585611d87565b909250905060018201611abc576000199250505061158d565b80611ac8836025612261565b611ad29190612261565b61166d906004612261565b6000611aea826009612261565b83511015611afb575060001961158d565b600080611b1285611b0d866008612261565b611b41565b909250905060018201611b2b576000199250505061158d565b80611b37836009612261565b61166d9190612261565b6000806000611b508585611dc9565b90508060ff16600003611b85576000858581518110611b7157611b7161224b565b016020015190935060f81c9150611cde9050565b83611b91826001612432565b60ff16611b9e9190612261565b85511015611bb55760001960009250925050611cde565b60008160ff16600203611bf957611bee611bda611bd3876001612261565b8890611e4f565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611cd4565b8160ff16600403611c4857611c3b611c15611bd3876001612261565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611cd4565b8160ff16600803611cd457611cc7611c64611bd3876001612261565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611cf48585611b41565b909250905060018201611d0d576000199250505061158d565b600080611d1b846001612261565b905060005b83811015611d7c57611d3688611b0d848a612261565b909550925060018301611d52576000199550505050505061158d565b82611d5e866001612261565b611d689190612261565b611d729083612261565b9150600101611d20565b509695505050505050565b600080611d95836025612261565b84511015611daa575060001990506000611cde565b600080611dbc86611b0d876024612261565b9097909650945050505050565b6000828281518110611ddd57611ddd61224b565b016020015160f81c60ff03611df45750600861158d565b828281518110611e0657611e0661224b565b016020015160f81c60fe03611e1d5750600461158d565b828281518110611e2f57611e2f61224b565b016020015160f81c60fd03611e465750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e7057600080fd5b50813567ffffffffffffffff811115611e8857600080fd5b602083019150836020828501011115611cde57600080fd5b600080600080600060608688031215611eb857600080fd5b853567ffffffffffffffff811115611ecf57600080fd5b611edb88828901611e5e565b909650945050602086013567ffffffffffffffff811115611efb57600080fd5b611f0788828901611e5e565b96999598509660400135949350505050565b60008060208385031215611f2c57600080fd5b823567ffffffffffffffff811115611f4357600080fd5b8301601f81018513611f5457600080fd5b803567ffffffffffffffff811115611f6b57600080fd5b8560208260051b8401011115611f8057600080fd5b6020919091019590945092505050565b600060208284031215611fa257600080fd5b5035919050565b602081526000825180602084015260005b81811015611fd75760208186018101516040868401015201611fba565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561200957600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561203257600080fd5b813567ffffffffffffffff81111561204957600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061208657607f821691505b6020821081036120a657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156120f657806000526020600020601f840160051c810160208510156120d35750805b601f840160051c820191505b818110156120f357600081556001016120df565b50505b505050565b67ffffffffffffffff8311156121135761211361205c565b612127836121218354612072565b836120ac565b6000601f84116001811461215b57600085156121435750838201355b600019600387901b1c1916600186901b1783556120f3565b600083815260209020601f19861690835b8281101561218c578685013582556020948501946001909201910161216c565b50868210156121a95760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006121f86060830187896121bb565b828103602084015261220b8186886121bb565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d61221e565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d61221e565b60006020828403121561228657600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122b057600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122df57600080fd5b83018035915067ffffffffffffffff8211156122fa57600080fd5b602001915036819003821315611cde57600080fd5b85815284602082015260806040820152600061232f6080830185876121bb565b90508260608301529695505050505050565b60006020828403121561235357600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d61221e565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff1981169190601482101561242b576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61221e56" + "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611eb5565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f2e565b610624565b34801561020b57600080fd5b5061015461021a366004611fa5565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fbe565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611fa5565b610853565b3480156102c457600080fd5b506101896102d3366004611eb5565b61091c565b3480156102e457600080fd5b506101896102f336600461200c565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611fa5565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612035565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db36600461200c565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff191660011790556002610556858783612110565b506003610564838583612110565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121f9565b60405180910390a15050505050565b61063581662386f26fc10000612249565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f612260565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f4612260565b9050602002013582846107079190612276565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612087565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612087565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d2858783612110565b5060036109e0838583612110565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121f9565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612087565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612289565b610b3e60408501602086016122b3565b610b4b60408601866122dd565b610b5860608801886122dd565b610b6560808a018a6122dd565b610b7560c08c0160a08d01612289565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122dd565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122dd565b8861010001356040518663ffffffff1660e01b8152600401610e99959493929190612324565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612356565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612276565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612087565b915060009050611007838284611840565b905061109d816002805461101a90612087565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612087565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612276565b6110fd856014612276565b86516111099190612378565b869190611840565b9050611124816003805461101a90612087565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119db565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f82611a11565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a99998979695949392919061238b565b604051602081830303815290604052611a82565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612276565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611aa9565b9050600019810361144d575060009695505050505050565b6114578184612276565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612276565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611af2565b905060001981036114f1575060009695505050505050565b6114fb8184612276565b9250506001016114b1565b600080611514836000611b56565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611cfa565b90506000198103611571576000935050505061158d565b61157b8184612276565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611cfa565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612276565b915060010161159b565b506116178582611cfa565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612276565b905060005b868110156117bf5761174b8883611b56565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612276565b6117ab9190612276565b6117b59083612276565b9150600101611739565b506117ca8782611b56565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612276565b61182d906001612276565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612276565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b8151815160009190811461191c57600091505061158d565b60206000805b838311611952575050848101518482015160209092019180821461194d57600094505050505061158d565b611922565b600061195f602085612378565b90505b848110156119cd5786818151811061197c5761197c612260565b602001015160f81c60f81b6001600160f81b0319168882815181106119a3576119a3612260565b01602001516001600160f81b031916146119c55760009550505050505061158d565b600101611962565b506001979650505050505050565b600080600280546119eb90612087565b9150600090506119fd84836014611840565b611a06906123f4565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611ab88585611d9c565b909250905060018201611ad1576000199250505061158d565b80611add836025612276565b611ae79190612276565b61166d906004612276565b6000611aff826009612276565b83511015611b10575060001961158d565b600080611b2785611b22866008612276565b611b56565b909250905060018201611b40576000199250505061158d565b80611b4c836009612276565b61166d9190612276565b6000806000611b658585611dde565b90508060ff16600003611b9a576000858581518110611b8657611b86612260565b016020015190935060f81c9150611cf39050565b83611ba6826001612447565b60ff16611bb39190612276565b85511015611bca5760001960009250925050611cf3565b60008160ff16600203611c0e57611c03611bef611be8876001612276565b8890611e64565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611ce9565b8160ff16600403611c5d57611c50611c2a611be8876001612276565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611ce9565b8160ff16600803611ce957611cdc611c79611be8876001612276565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611d098585611b56565b909250905060018201611d22576000199250505061158d565b600080611d30846001612276565b905060005b83811015611d9157611d4b88611b22848a612276565b909550925060018301611d67576000199550505050505061158d565b82611d73866001612276565b611d7d9190612276565b611d879083612276565b9150600101611d35565b509695505050505050565b600080611daa836025612276565b84511015611dbf575060001990506000611cf3565b600080611dd186611b22876024612276565b9097909650945050505050565b6000828281518110611df257611df2612260565b016020015160f81c60ff03611e095750600861158d565b828281518110611e1b57611e1b612260565b016020015160f81c60fe03611e325750600461158d565b828281518110611e4457611e44612260565b016020015160f81c60fd03611e5b5750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e8557600080fd5b50813567ffffffffffffffff811115611e9d57600080fd5b602083019150836020828501011115611cf357600080fd5b600080600080600060608688031215611ecd57600080fd5b853567ffffffffffffffff811115611ee457600080fd5b611ef088828901611e73565b909650945050602086013567ffffffffffffffff811115611f1057600080fd5b611f1c88828901611e73565b96999598509660400135949350505050565b60008060208385031215611f4157600080fd5b823567ffffffffffffffff811115611f5857600080fd5b8301601f81018513611f6957600080fd5b803567ffffffffffffffff811115611f8057600080fd5b8560208260051b8401011115611f9557600080fd5b6020919091019590945092505050565b600060208284031215611fb757600080fd5b5035919050565b602081526000825180602084015260005b81811015611fec5760208186018101516040868401015201611fcf565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561201e57600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561204757600080fd5b813567ffffffffffffffff81111561205e57600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061209b57607f821691505b6020821081036120bb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561210b57806000526020600020601f840160051c810160208510156120e85750805b601f840160051c820191505b8181101561210857600081556001016120f4565b50505b505050565b67ffffffffffffffff83111561212857612128612071565b61213c836121368354612087565b836120c1565b6000601f84116001811461217057600085156121585750838201355b600019600387901b1c1916600186901b178355612108565b600083815260209020601f19861690835b828110156121a15786850135825560209485019460019092019101612181565b50868210156121be5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061220d6060830187896121d0565b82810360208401526122208186886121d0565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d612233565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d612233565b60006020828403121561229b57600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122c557600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122f457600080fd5b83018035915067ffffffffffffffff82111561230f57600080fd5b602001915036819003821315611cf357600080fd5b8581528460208201526080604082015260006123446080830185876121d0565b90508260608301529695505050505050565b60006020828403121561236857600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d612233565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff19811691906014821015612440576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61223356" }, { "address": "0x3200000000000000000000000000000000000003", diff --git a/resources/genesis/mock/evm.json b/resources/genesis/mock/evm.json index 812a8e169..a07c04b08 100644 --- a/resources/genesis/mock/evm.json +++ b/resources/genesis/mock/evm.json @@ -76,7 +76,7 @@ { "address": "0x3200000000000000000000000000000000000002", "balance": "0x0", - "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611ea0565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f19565b610624565b34801561020b57600080fd5b5061015461021a366004611f90565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fa9565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611f90565b610853565b3480156102c457600080fd5b506101896102d3366004611ea0565b61091c565b3480156102e457600080fd5b506101896102f3366004611ff7565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611f90565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612020565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db366004611ff7565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff1916600117905560026105568587836120fb565b5060036105648385836120fb565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121e4565b60405180910390a15050505050565b61063581662386f26fc10000612234565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f61224b565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f461224b565b9050602002013582846107079190612261565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612072565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612072565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d28587836120fb565b5060036109e08385836120fb565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121e4565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612072565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612274565b610b3e604085016020860161229e565b610b4b60408601866122c8565b610b5860608801886122c8565b610b6560808a018a6122c8565b610b7560c08c0160a08d01612274565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122c8565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122c8565b8861010001356040518663ffffffff1660e01b8152600401610e9995949392919061230f565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612341565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612261565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612072565b915060009050611007838284611840565b905061109d816002805461101a90612072565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612072565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612261565b6110fd856014612261565b86516111099190612363565b869190611840565b9050611124816003805461101a90612072565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119c6565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f826119fc565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a999989796959493929190612376565b604051602081830303815290604052611a6d565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612261565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611a94565b9050600019810361144d575060009695505050505050565b6114578184612261565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612261565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611add565b905060001981036114f1575060009695505050505050565b6114fb8184612261565b9250506001016114b1565b600080611514836000611b41565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611ce5565b90506000198103611571576000935050505061158d565b61157b8184612261565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611ce5565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612261565b915060010161159b565b506116178582611ce5565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612261565b905060005b868110156117bf5761174b8883611b41565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612261565b6117ab9190612261565b6117b59083612261565b9150600101611739565b506117ca8782611b41565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612261565b61182d906001612261565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612261565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b6000815183511461194e5760405162461bcd60e51b8152602060048201526014602482015273098cadccee8d0e640c8de40dcdee840dac2e8c6d60631b604482015260640161043f565b825160005b818110156119bb5783818151811061196d5761196d61224b565b602001015160f81c60f81b6001600160f81b0319168582815181106119945761199461224b565b01602001516001600160f81b031916146119b35760009250505061158d565b600101611953565b506001949350505050565b600080600280546119d690612072565b9150600090506119e884836014611840565b6119f1906123df565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611aa38585611d87565b909250905060018201611abc576000199250505061158d565b80611ac8836025612261565b611ad29190612261565b61166d906004612261565b6000611aea826009612261565b83511015611afb575060001961158d565b600080611b1285611b0d866008612261565b611b41565b909250905060018201611b2b576000199250505061158d565b80611b37836009612261565b61166d9190612261565b6000806000611b508585611dc9565b90508060ff16600003611b85576000858581518110611b7157611b7161224b565b016020015190935060f81c9150611cde9050565b83611b91826001612432565b60ff16611b9e9190612261565b85511015611bb55760001960009250925050611cde565b60008160ff16600203611bf957611bee611bda611bd3876001612261565b8890611e4f565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611cd4565b8160ff16600403611c4857611c3b611c15611bd3876001612261565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611cd4565b8160ff16600803611cd457611cc7611c64611bd3876001612261565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611cf48585611b41565b909250905060018201611d0d576000199250505061158d565b600080611d1b846001612261565b905060005b83811015611d7c57611d3688611b0d848a612261565b909550925060018301611d52576000199550505050505061158d565b82611d5e866001612261565b611d689190612261565b611d729083612261565b9150600101611d20565b509695505050505050565b600080611d95836025612261565b84511015611daa575060001990506000611cde565b600080611dbc86611b0d876024612261565b9097909650945050505050565b6000828281518110611ddd57611ddd61224b565b016020015160f81c60ff03611df45750600861158d565b828281518110611e0657611e0661224b565b016020015160f81c60fe03611e1d5750600461158d565b828281518110611e2f57611e2f61224b565b016020015160f81c60fd03611e465750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e7057600080fd5b50813567ffffffffffffffff811115611e8857600080fd5b602083019150836020828501011115611cde57600080fd5b600080600080600060608688031215611eb857600080fd5b853567ffffffffffffffff811115611ecf57600080fd5b611edb88828901611e5e565b909650945050602086013567ffffffffffffffff811115611efb57600080fd5b611f0788828901611e5e565b96999598509660400135949350505050565b60008060208385031215611f2c57600080fd5b823567ffffffffffffffff811115611f4357600080fd5b8301601f81018513611f5457600080fd5b803567ffffffffffffffff811115611f6b57600080fd5b8560208260051b8401011115611f8057600080fd5b6020919091019590945092505050565b600060208284031215611fa257600080fd5b5035919050565b602081526000825180602084015260005b81811015611fd75760208186018101516040868401015201611fba565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561200957600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561203257600080fd5b813567ffffffffffffffff81111561204957600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061208657607f821691505b6020821081036120a657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156120f657806000526020600020601f840160051c810160208510156120d35750805b601f840160051c820191505b818110156120f357600081556001016120df565b50505b505050565b67ffffffffffffffff8311156121135761211361205c565b612127836121218354612072565b836120ac565b6000601f84116001811461215b57600085156121435750838201355b600019600387901b1c1916600186901b1783556120f3565b600083815260209020601f19861690835b8281101561218c578685013582556020948501946001909201910161216c565b50868210156121a95760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006121f86060830187896121bb565b828103602084015261220b8186886121bb565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d61221e565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d61221e565b60006020828403121561228657600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122b057600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122df57600080fd5b83018035915067ffffffffffffffff8211156122fa57600080fd5b602001915036819003821315611cde57600080fd5b85815284602082015260806040820152600061232f6080830185876121bb565b90508260608301529695505050505050565b60006020828403121561235357600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d61221e565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff1981169190601482101561242b576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61221e56" + "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611eb5565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f2e565b610624565b34801561020b57600080fd5b5061015461021a366004611fa5565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fbe565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611fa5565b610853565b3480156102c457600080fd5b506101896102d3366004611eb5565b61091c565b3480156102e457600080fd5b506101896102f336600461200c565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611fa5565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612035565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db36600461200c565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff191660011790556002610556858783612110565b506003610564838583612110565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121f9565b60405180910390a15050505050565b61063581662386f26fc10000612249565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f612260565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f4612260565b9050602002013582846107079190612276565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612087565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612087565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d2858783612110565b5060036109e0838583612110565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121f9565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612087565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612289565b610b3e60408501602086016122b3565b610b4b60408601866122dd565b610b5860608801886122dd565b610b6560808a018a6122dd565b610b7560c08c0160a08d01612289565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122dd565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122dd565b8861010001356040518663ffffffff1660e01b8152600401610e99959493929190612324565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612356565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612276565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612087565b915060009050611007838284611840565b905061109d816002805461101a90612087565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612087565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612276565b6110fd856014612276565b86516111099190612378565b869190611840565b9050611124816003805461101a90612087565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119db565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f82611a11565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a99998979695949392919061238b565b604051602081830303815290604052611a82565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612276565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611aa9565b9050600019810361144d575060009695505050505050565b6114578184612276565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612276565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611af2565b905060001981036114f1575060009695505050505050565b6114fb8184612276565b9250506001016114b1565b600080611514836000611b56565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611cfa565b90506000198103611571576000935050505061158d565b61157b8184612276565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611cfa565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612276565b915060010161159b565b506116178582611cfa565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612276565b905060005b868110156117bf5761174b8883611b56565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612276565b6117ab9190612276565b6117b59083612276565b9150600101611739565b506117ca8782611b56565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612276565b61182d906001612276565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612276565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b8151815160009190811461191c57600091505061158d565b60206000805b838311611952575050848101518482015160209092019180821461194d57600094505050505061158d565b611922565b600061195f602085612378565b90505b848110156119cd5786818151811061197c5761197c612260565b602001015160f81c60f81b6001600160f81b0319168882815181106119a3576119a3612260565b01602001516001600160f81b031916146119c55760009550505050505061158d565b600101611962565b506001979650505050505050565b600080600280546119eb90612087565b9150600090506119fd84836014611840565b611a06906123f4565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611ab88585611d9c565b909250905060018201611ad1576000199250505061158d565b80611add836025612276565b611ae79190612276565b61166d906004612276565b6000611aff826009612276565b83511015611b10575060001961158d565b600080611b2785611b22866008612276565b611b56565b909250905060018201611b40576000199250505061158d565b80611b4c836009612276565b61166d9190612276565b6000806000611b658585611dde565b90508060ff16600003611b9a576000858581518110611b8657611b86612260565b016020015190935060f81c9150611cf39050565b83611ba6826001612447565b60ff16611bb39190612276565b85511015611bca5760001960009250925050611cf3565b60008160ff16600203611c0e57611c03611bef611be8876001612276565b8890611e64565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611ce9565b8160ff16600403611c5d57611c50611c2a611be8876001612276565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611ce9565b8160ff16600803611ce957611cdc611c79611be8876001612276565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611d098585611b56565b909250905060018201611d22576000199250505061158d565b600080611d30846001612276565b905060005b83811015611d9157611d4b88611b22848a612276565b909550925060018301611d67576000199550505050505061158d565b82611d73866001612276565b611d7d9190612276565b611d879083612276565b9150600101611d35565b509695505050505050565b600080611daa836025612276565b84511015611dbf575060001990506000611cf3565b600080611dd186611b22876024612276565b9097909650945050505050565b6000828281518110611df257611df2612260565b016020015160f81c60ff03611e095750600861158d565b828281518110611e1b57611e1b612260565b016020015160f81c60fe03611e325750600461158d565b828281518110611e4457611e44612260565b016020015160f81c60fd03611e5b5750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e8557600080fd5b50813567ffffffffffffffff811115611e9d57600080fd5b602083019150836020828501011115611cf357600080fd5b600080600080600060608688031215611ecd57600080fd5b853567ffffffffffffffff811115611ee457600080fd5b611ef088828901611e73565b909650945050602086013567ffffffffffffffff811115611f1057600080fd5b611f1c88828901611e73565b96999598509660400135949350505050565b60008060208385031215611f4157600080fd5b823567ffffffffffffffff811115611f5857600080fd5b8301601f81018513611f6957600080fd5b803567ffffffffffffffff811115611f8057600080fd5b8560208260051b8401011115611f9557600080fd5b6020919091019590945092505050565b600060208284031215611fb757600080fd5b5035919050565b602081526000825180602084015260005b81811015611fec5760208186018101516040868401015201611fcf565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561201e57600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561204757600080fd5b813567ffffffffffffffff81111561205e57600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061209b57607f821691505b6020821081036120bb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561210b57806000526020600020601f840160051c810160208510156120e85750805b601f840160051c820191505b8181101561210857600081556001016120f4565b50505b505050565b67ffffffffffffffff83111561212857612128612071565b61213c836121368354612087565b836120c1565b6000601f84116001811461217057600085156121585750838201355b600019600387901b1c1916600186901b178355612108565b600083815260209020601f19861690835b828110156121a15786850135825560209485019460019092019101612181565b50868210156121be5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061220d6060830187896121d0565b82810360208401526122208186886121d0565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d612233565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d612233565b60006020828403121561229b57600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122c557600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122f457600080fd5b83018035915067ffffffffffffffff82111561230f57600080fd5b602001915036819003821315611cf357600080fd5b8581528460208201526080604082015260006123446080830185876121d0565b90508260608301529695505050505050565b60006020828403121561236857600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d612233565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff19811691906014821015612440576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61223356" }, { "address": "0x3200000000000000000000000000000000000003", diff --git a/resources/test-data/demo-tests/bitcoin-regtest/evm.json b/resources/test-data/demo-tests/bitcoin-regtest/evm.json index 812a8e169..a07c04b08 100644 --- a/resources/test-data/demo-tests/bitcoin-regtest/evm.json +++ b/resources/test-data/demo-tests/bitcoin-regtest/evm.json @@ -76,7 +76,7 @@ { "address": "0x3200000000000000000000000000000000000002", "balance": "0x0", - "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611ea0565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f19565b610624565b34801561020b57600080fd5b5061015461021a366004611f90565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fa9565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611f90565b610853565b3480156102c457600080fd5b506101896102d3366004611ea0565b61091c565b3480156102e457600080fd5b506101896102f3366004611ff7565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611f90565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612020565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db366004611ff7565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff1916600117905560026105568587836120fb565b5060036105648385836120fb565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121e4565b60405180910390a15050505050565b61063581662386f26fc10000612234565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f61224b565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f461224b565b9050602002013582846107079190612261565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612072565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612072565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d28587836120fb565b5060036109e08385836120fb565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121e4565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612072565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612274565b610b3e604085016020860161229e565b610b4b60408601866122c8565b610b5860608801886122c8565b610b6560808a018a6122c8565b610b7560c08c0160a08d01612274565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122c8565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122c8565b8861010001356040518663ffffffff1660e01b8152600401610e9995949392919061230f565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612341565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612261565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612072565b915060009050611007838284611840565b905061109d816002805461101a90612072565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612072565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612261565b6110fd856014612261565b86516111099190612363565b869190611840565b9050611124816003805461101a90612072565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119c6565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f826119fc565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a999989796959493929190612376565b604051602081830303815290604052611a6d565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612261565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611a94565b9050600019810361144d575060009695505050505050565b6114578184612261565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612261565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611add565b905060001981036114f1575060009695505050505050565b6114fb8184612261565b9250506001016114b1565b600080611514836000611b41565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611ce5565b90506000198103611571576000935050505061158d565b61157b8184612261565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611ce5565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612261565b915060010161159b565b506116178582611ce5565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612261565b905060005b868110156117bf5761174b8883611b41565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612261565b6117ab9190612261565b6117b59083612261565b9150600101611739565b506117ca8782611b41565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612261565b61182d906001612261565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612261565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b6000815183511461194e5760405162461bcd60e51b8152602060048201526014602482015273098cadccee8d0e640c8de40dcdee840dac2e8c6d60631b604482015260640161043f565b825160005b818110156119bb5783818151811061196d5761196d61224b565b602001015160f81c60f81b6001600160f81b0319168582815181106119945761199461224b565b01602001516001600160f81b031916146119b35760009250505061158d565b600101611953565b506001949350505050565b600080600280546119d690612072565b9150600090506119e884836014611840565b6119f1906123df565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611aa38585611d87565b909250905060018201611abc576000199250505061158d565b80611ac8836025612261565b611ad29190612261565b61166d906004612261565b6000611aea826009612261565b83511015611afb575060001961158d565b600080611b1285611b0d866008612261565b611b41565b909250905060018201611b2b576000199250505061158d565b80611b37836009612261565b61166d9190612261565b6000806000611b508585611dc9565b90508060ff16600003611b85576000858581518110611b7157611b7161224b565b016020015190935060f81c9150611cde9050565b83611b91826001612432565b60ff16611b9e9190612261565b85511015611bb55760001960009250925050611cde565b60008160ff16600203611bf957611bee611bda611bd3876001612261565b8890611e4f565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611cd4565b8160ff16600403611c4857611c3b611c15611bd3876001612261565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611cd4565b8160ff16600803611cd457611cc7611c64611bd3876001612261565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611cf48585611b41565b909250905060018201611d0d576000199250505061158d565b600080611d1b846001612261565b905060005b83811015611d7c57611d3688611b0d848a612261565b909550925060018301611d52576000199550505050505061158d565b82611d5e866001612261565b611d689190612261565b611d729083612261565b9150600101611d20565b509695505050505050565b600080611d95836025612261565b84511015611daa575060001990506000611cde565b600080611dbc86611b0d876024612261565b9097909650945050505050565b6000828281518110611ddd57611ddd61224b565b016020015160f81c60ff03611df45750600861158d565b828281518110611e0657611e0661224b565b016020015160f81c60fe03611e1d5750600461158d565b828281518110611e2f57611e2f61224b565b016020015160f81c60fd03611e465750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e7057600080fd5b50813567ffffffffffffffff811115611e8857600080fd5b602083019150836020828501011115611cde57600080fd5b600080600080600060608688031215611eb857600080fd5b853567ffffffffffffffff811115611ecf57600080fd5b611edb88828901611e5e565b909650945050602086013567ffffffffffffffff811115611efb57600080fd5b611f0788828901611e5e565b96999598509660400135949350505050565b60008060208385031215611f2c57600080fd5b823567ffffffffffffffff811115611f4357600080fd5b8301601f81018513611f5457600080fd5b803567ffffffffffffffff811115611f6b57600080fd5b8560208260051b8401011115611f8057600080fd5b6020919091019590945092505050565b600060208284031215611fa257600080fd5b5035919050565b602081526000825180602084015260005b81811015611fd75760208186018101516040868401015201611fba565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561200957600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561203257600080fd5b813567ffffffffffffffff81111561204957600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061208657607f821691505b6020821081036120a657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156120f657806000526020600020601f840160051c810160208510156120d35750805b601f840160051c820191505b818110156120f357600081556001016120df565b50505b505050565b67ffffffffffffffff8311156121135761211361205c565b612127836121218354612072565b836120ac565b6000601f84116001811461215b57600085156121435750838201355b600019600387901b1c1916600186901b1783556120f3565b600083815260209020601f19861690835b8281101561218c578685013582556020948501946001909201910161216c565b50868210156121a95760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006121f86060830187896121bb565b828103602084015261220b8186886121bb565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d61221e565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d61221e565b60006020828403121561228657600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122b057600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122df57600080fd5b83018035915067ffffffffffffffff8211156122fa57600080fd5b602001915036819003821315611cde57600080fd5b85815284602082015260806040820152600061232f6080830185876121bb565b90508260608301529695505050505050565b60006020828403121561235357600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d61221e565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff1981169190601482101561242b576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61221e56" + "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611eb5565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f2e565b610624565b34801561020b57600080fd5b5061015461021a366004611fa5565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fbe565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611fa5565b610853565b3480156102c457600080fd5b506101896102d3366004611eb5565b61091c565b3480156102e457600080fd5b506101896102f336600461200c565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611fa5565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612035565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db36600461200c565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff191660011790556002610556858783612110565b506003610564838583612110565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121f9565b60405180910390a15050505050565b61063581662386f26fc10000612249565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f612260565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f4612260565b9050602002013582846107079190612276565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612087565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612087565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d2858783612110565b5060036109e0838583612110565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121f9565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612087565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612289565b610b3e60408501602086016122b3565b610b4b60408601866122dd565b610b5860608801886122dd565b610b6560808a018a6122dd565b610b7560c08c0160a08d01612289565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122dd565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122dd565b8861010001356040518663ffffffff1660e01b8152600401610e99959493929190612324565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612356565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612276565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612087565b915060009050611007838284611840565b905061109d816002805461101a90612087565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612087565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612276565b6110fd856014612276565b86516111099190612378565b869190611840565b9050611124816003805461101a90612087565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119db565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f82611a11565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a99998979695949392919061238b565b604051602081830303815290604052611a82565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612276565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611aa9565b9050600019810361144d575060009695505050505050565b6114578184612276565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612276565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611af2565b905060001981036114f1575060009695505050505050565b6114fb8184612276565b9250506001016114b1565b600080611514836000611b56565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611cfa565b90506000198103611571576000935050505061158d565b61157b8184612276565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611cfa565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612276565b915060010161159b565b506116178582611cfa565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612276565b905060005b868110156117bf5761174b8883611b56565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612276565b6117ab9190612276565b6117b59083612276565b9150600101611739565b506117ca8782611b56565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612276565b61182d906001612276565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612276565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b8151815160009190811461191c57600091505061158d565b60206000805b838311611952575050848101518482015160209092019180821461194d57600094505050505061158d565b611922565b600061195f602085612378565b90505b848110156119cd5786818151811061197c5761197c612260565b602001015160f81c60f81b6001600160f81b0319168882815181106119a3576119a3612260565b01602001516001600160f81b031916146119c55760009550505050505061158d565b600101611962565b506001979650505050505050565b600080600280546119eb90612087565b9150600090506119fd84836014611840565b611a06906123f4565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611ab88585611d9c565b909250905060018201611ad1576000199250505061158d565b80611add836025612276565b611ae79190612276565b61166d906004612276565b6000611aff826009612276565b83511015611b10575060001961158d565b600080611b2785611b22866008612276565b611b56565b909250905060018201611b40576000199250505061158d565b80611b4c836009612276565b61166d9190612276565b6000806000611b658585611dde565b90508060ff16600003611b9a576000858581518110611b8657611b86612260565b016020015190935060f81c9150611cf39050565b83611ba6826001612447565b60ff16611bb39190612276565b85511015611bca5760001960009250925050611cf3565b60008160ff16600203611c0e57611c03611bef611be8876001612276565b8890611e64565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611ce9565b8160ff16600403611c5d57611c50611c2a611be8876001612276565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611ce9565b8160ff16600803611ce957611cdc611c79611be8876001612276565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611d098585611b56565b909250905060018201611d22576000199250505061158d565b600080611d30846001612276565b905060005b83811015611d9157611d4b88611b22848a612276565b909550925060018301611d67576000199550505050505061158d565b82611d73866001612276565b611d7d9190612276565b611d879083612276565b9150600101611d35565b509695505050505050565b600080611daa836025612276565b84511015611dbf575060001990506000611cf3565b600080611dd186611b22876024612276565b9097909650945050505050565b6000828281518110611df257611df2612260565b016020015160f81c60ff03611e095750600861158d565b828281518110611e1b57611e1b612260565b016020015160f81c60fe03611e325750600461158d565b828281518110611e4457611e44612260565b016020015160f81c60fd03611e5b5750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e8557600080fd5b50813567ffffffffffffffff811115611e9d57600080fd5b602083019150836020828501011115611cf357600080fd5b600080600080600060608688031215611ecd57600080fd5b853567ffffffffffffffff811115611ee457600080fd5b611ef088828901611e73565b909650945050602086013567ffffffffffffffff811115611f1057600080fd5b611f1c88828901611e73565b96999598509660400135949350505050565b60008060208385031215611f4157600080fd5b823567ffffffffffffffff811115611f5857600080fd5b8301601f81018513611f6957600080fd5b803567ffffffffffffffff811115611f8057600080fd5b8560208260051b8401011115611f9557600080fd5b6020919091019590945092505050565b600060208284031215611fb757600080fd5b5035919050565b602081526000825180602084015260005b81811015611fec5760208186018101516040868401015201611fcf565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561201e57600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561204757600080fd5b813567ffffffffffffffff81111561205e57600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061209b57607f821691505b6020821081036120bb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561210b57806000526020600020601f840160051c810160208510156120e85750805b601f840160051c820191505b8181101561210857600081556001016120f4565b50505b505050565b67ffffffffffffffff83111561212857612128612071565b61213c836121368354612087565b836120c1565b6000601f84116001811461217057600085156121585750838201355b600019600387901b1c1916600186901b178355612108565b600083815260209020601f19861690835b828110156121a15786850135825560209485019460019092019101612181565b50868210156121be5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061220d6060830187896121d0565b82810360208401526122208186886121d0565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d612233565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d612233565b60006020828403121561229b57600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122c557600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122f457600080fd5b83018035915067ffffffffffffffff82111561230f57600080fd5b602001915036819003821315611cf357600080fd5b8581528460208201526080604082015260006123446080830185876121d0565b90508260608301529695505050505050565b60006020828403121561236857600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d612233565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff19811691906014821015612440576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61223356" }, { "address": "0x3200000000000000000000000000000000000003", diff --git a/resources/test-data/demo-tests/mock/evm.json b/resources/test-data/demo-tests/mock/evm.json index 812a8e169..a07c04b08 100644 --- a/resources/test-data/demo-tests/mock/evm.json +++ b/resources/test-data/demo-tests/mock/evm.json @@ -76,7 +76,7 @@ { "address": "0x3200000000000000000000000000000000000002", "balance": "0x0", - "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611ea0565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f19565b610624565b34801561020b57600080fd5b5061015461021a366004611f90565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fa9565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611f90565b610853565b3480156102c457600080fd5b506101896102d3366004611ea0565b61091c565b3480156102e457600080fd5b506101896102f3366004611ff7565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611f90565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612020565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db366004611ff7565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff1916600117905560026105568587836120fb565b5060036105648385836120fb565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121e4565b60405180910390a15050505050565b61063581662386f26fc10000612234565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f61224b565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f461224b565b9050602002013582846107079190612261565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612072565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612072565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d28587836120fb565b5060036109e08385836120fb565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121e4565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612072565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612274565b610b3e604085016020860161229e565b610b4b60408601866122c8565b610b5860608801886122c8565b610b6560808a018a6122c8565b610b7560c08c0160a08d01612274565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122c8565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122c8565b8861010001356040518663ffffffff1660e01b8152600401610e9995949392919061230f565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612341565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612261565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612072565b915060009050611007838284611840565b905061109d816002805461101a90612072565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612072565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612261565b6110fd856014612261565b86516111099190612363565b869190611840565b9050611124816003805461101a90612072565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119c6565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f826119fc565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a999989796959493929190612376565b604051602081830303815290604052611a6d565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612261565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611a94565b9050600019810361144d575060009695505050505050565b6114578184612261565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612261565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611add565b905060001981036114f1575060009695505050505050565b6114fb8184612261565b9250506001016114b1565b600080611514836000611b41565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611ce5565b90506000198103611571576000935050505061158d565b61157b8184612261565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611ce5565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612261565b915060010161159b565b506116178582611ce5565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612261565b905060005b868110156117bf5761174b8883611b41565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612261565b6117ab9190612261565b6117b59083612261565b9150600101611739565b506117ca8782611b41565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612261565b61182d906001612261565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612261565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b6000815183511461194e5760405162461bcd60e51b8152602060048201526014602482015273098cadccee8d0e640c8de40dcdee840dac2e8c6d60631b604482015260640161043f565b825160005b818110156119bb5783818151811061196d5761196d61224b565b602001015160f81c60f81b6001600160f81b0319168582815181106119945761199461224b565b01602001516001600160f81b031916146119b35760009250505061158d565b600101611953565b506001949350505050565b600080600280546119d690612072565b9150600090506119e884836014611840565b6119f1906123df565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611aa38585611d87565b909250905060018201611abc576000199250505061158d565b80611ac8836025612261565b611ad29190612261565b61166d906004612261565b6000611aea826009612261565b83511015611afb575060001961158d565b600080611b1285611b0d866008612261565b611b41565b909250905060018201611b2b576000199250505061158d565b80611b37836009612261565b61166d9190612261565b6000806000611b508585611dc9565b90508060ff16600003611b85576000858581518110611b7157611b7161224b565b016020015190935060f81c9150611cde9050565b83611b91826001612432565b60ff16611b9e9190612261565b85511015611bb55760001960009250925050611cde565b60008160ff16600203611bf957611bee611bda611bd3876001612261565b8890611e4f565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611cd4565b8160ff16600403611c4857611c3b611c15611bd3876001612261565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611cd4565b8160ff16600803611cd457611cc7611c64611bd3876001612261565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611cf48585611b41565b909250905060018201611d0d576000199250505061158d565b600080611d1b846001612261565b905060005b83811015611d7c57611d3688611b0d848a612261565b909550925060018301611d52576000199550505050505061158d565b82611d5e866001612261565b611d689190612261565b611d729083612261565b9150600101611d20565b509695505050505050565b600080611d95836025612261565b84511015611daa575060001990506000611cde565b600080611dbc86611b0d876024612261565b9097909650945050505050565b6000828281518110611ddd57611ddd61224b565b016020015160f81c60ff03611df45750600861158d565b828281518110611e0657611e0661224b565b016020015160f81c60fe03611e1d5750600461158d565b828281518110611e2f57611e2f61224b565b016020015160f81c60fd03611e465750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e7057600080fd5b50813567ffffffffffffffff811115611e8857600080fd5b602083019150836020828501011115611cde57600080fd5b600080600080600060608688031215611eb857600080fd5b853567ffffffffffffffff811115611ecf57600080fd5b611edb88828901611e5e565b909650945050602086013567ffffffffffffffff811115611efb57600080fd5b611f0788828901611e5e565b96999598509660400135949350505050565b60008060208385031215611f2c57600080fd5b823567ffffffffffffffff811115611f4357600080fd5b8301601f81018513611f5457600080fd5b803567ffffffffffffffff811115611f6b57600080fd5b8560208260051b8401011115611f8057600080fd5b6020919091019590945092505050565b600060208284031215611fa257600080fd5b5035919050565b602081526000825180602084015260005b81811015611fd75760208186018101516040868401015201611fba565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561200957600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561203257600080fd5b813567ffffffffffffffff81111561204957600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061208657607f821691505b6020821081036120a657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156120f657806000526020600020601f840160051c810160208510156120d35750805b601f840160051c820191505b818110156120f357600081556001016120df565b50505b505050565b67ffffffffffffffff8311156121135761211361205c565b612127836121218354612072565b836120ac565b6000601f84116001811461215b57600085156121435750838201355b600019600387901b1c1916600186901b1783556120f3565b600083815260209020601f19861690835b8281101561218c578685013582556020948501946001909201910161216c565b50868210156121a95760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006121f86060830187896121bb565b828103602084015261220b8186886121bb565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d61221e565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d61221e565b60006020828403121561228657600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122b057600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122df57600080fd5b83018035915067ffffffffffffffff8211156122fa57600080fd5b602001915036819003821315611cde57600080fd5b85815284602082015260806040820152600061232f6080830185876121bb565b90508260608301529695505050505050565b60006020828403121561235357600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d61221e565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff1981169190601482101561242b576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61221e56" + "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611eb5565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f2e565b610624565b34801561020b57600080fd5b5061015461021a366004611fa5565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fbe565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611fa5565b610853565b3480156102c457600080fd5b506101896102d3366004611eb5565b61091c565b3480156102e457600080fd5b506101896102f336600461200c565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611fa5565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612035565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db36600461200c565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff191660011790556002610556858783612110565b506003610564838583612110565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121f9565b60405180910390a15050505050565b61063581662386f26fc10000612249565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f612260565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f4612260565b9050602002013582846107079190612276565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612087565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612087565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d2858783612110565b5060036109e0838583612110565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121f9565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612087565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612289565b610b3e60408501602086016122b3565b610b4b60408601866122dd565b610b5860608801886122dd565b610b6560808a018a6122dd565b610b7560c08c0160a08d01612289565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122dd565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122dd565b8861010001356040518663ffffffff1660e01b8152600401610e99959493929190612324565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612356565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612276565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612087565b915060009050611007838284611840565b905061109d816002805461101a90612087565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612087565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612276565b6110fd856014612276565b86516111099190612378565b869190611840565b9050611124816003805461101a90612087565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119db565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f82611a11565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a99998979695949392919061238b565b604051602081830303815290604052611a82565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612276565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611aa9565b9050600019810361144d575060009695505050505050565b6114578184612276565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612276565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611af2565b905060001981036114f1575060009695505050505050565b6114fb8184612276565b9250506001016114b1565b600080611514836000611b56565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611cfa565b90506000198103611571576000935050505061158d565b61157b8184612276565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611cfa565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612276565b915060010161159b565b506116178582611cfa565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612276565b905060005b868110156117bf5761174b8883611b56565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612276565b6117ab9190612276565b6117b59083612276565b9150600101611739565b506117ca8782611b56565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612276565b61182d906001612276565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612276565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b8151815160009190811461191c57600091505061158d565b60206000805b838311611952575050848101518482015160209092019180821461194d57600094505050505061158d565b611922565b600061195f602085612378565b90505b848110156119cd5786818151811061197c5761197c612260565b602001015160f81c60f81b6001600160f81b0319168882815181106119a3576119a3612260565b01602001516001600160f81b031916146119c55760009550505050505061158d565b600101611962565b506001979650505050505050565b600080600280546119eb90612087565b9150600090506119fd84836014611840565b611a06906123f4565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611ab88585611d9c565b909250905060018201611ad1576000199250505061158d565b80611add836025612276565b611ae79190612276565b61166d906004612276565b6000611aff826009612276565b83511015611b10575060001961158d565b600080611b2785611b22866008612276565b611b56565b909250905060018201611b40576000199250505061158d565b80611b4c836009612276565b61166d9190612276565b6000806000611b658585611dde565b90508060ff16600003611b9a576000858581518110611b8657611b86612260565b016020015190935060f81c9150611cf39050565b83611ba6826001612447565b60ff16611bb39190612276565b85511015611bca5760001960009250925050611cf3565b60008160ff16600203611c0e57611c03611bef611be8876001612276565b8890611e64565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611ce9565b8160ff16600403611c5d57611c50611c2a611be8876001612276565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611ce9565b8160ff16600803611ce957611cdc611c79611be8876001612276565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611d098585611b56565b909250905060018201611d22576000199250505061158d565b600080611d30846001612276565b905060005b83811015611d9157611d4b88611b22848a612276565b909550925060018301611d67576000199550505050505061158d565b82611d73866001612276565b611d7d9190612276565b611d879083612276565b9150600101611d35565b509695505050505050565b600080611daa836025612276565b84511015611dbf575060001990506000611cf3565b600080611dd186611b22876024612276565b9097909650945050505050565b6000828281518110611df257611df2612260565b016020015160f81c60ff03611e095750600861158d565b828281518110611e1b57611e1b612260565b016020015160f81c60fe03611e325750600461158d565b828281518110611e4457611e44612260565b016020015160f81c60fd03611e5b5750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e8557600080fd5b50813567ffffffffffffffff811115611e9d57600080fd5b602083019150836020828501011115611cf357600080fd5b600080600080600060608688031215611ecd57600080fd5b853567ffffffffffffffff811115611ee457600080fd5b611ef088828901611e73565b909650945050602086013567ffffffffffffffff811115611f1057600080fd5b611f1c88828901611e73565b96999598509660400135949350505050565b60008060208385031215611f4157600080fd5b823567ffffffffffffffff811115611f5857600080fd5b8301601f81018513611f6957600080fd5b803567ffffffffffffffff811115611f8057600080fd5b8560208260051b8401011115611f9557600080fd5b6020919091019590945092505050565b600060208284031215611fb757600080fd5b5035919050565b602081526000825180602084015260005b81811015611fec5760208186018101516040868401015201611fcf565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561201e57600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561204757600080fd5b813567ffffffffffffffff81111561205e57600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061209b57607f821691505b6020821081036120bb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561210b57806000526020600020601f840160051c810160208510156120e85750805b601f840160051c820191505b8181101561210857600081556001016120f4565b50505b505050565b67ffffffffffffffff83111561212857612128612071565b61213c836121368354612087565b836120c1565b6000601f84116001811461217057600085156121585750838201355b600019600387901b1c1916600186901b178355612108565b600083815260209020601f19861690835b828110156121a15786850135825560209485019460019092019101612181565b50868210156121be5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061220d6060830187896121d0565b82810360208401526122208186886121d0565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d612233565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d612233565b60006020828403121561229b57600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122c557600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122f457600080fd5b83018035915067ffffffffffffffff82111561230f57600080fd5b602001915036819003821315611cf357600080fd5b8581528460208201526080604082015260006123446080830185876121d0565b90508260608301529695505050505050565b60006020828403121561236857600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d612233565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff19811691906014821015612440576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61223356" }, { "address": "0x3200000000000000000000000000000000000003", diff --git a/resources/test-data/integration-tests-low-block-gas-limit/evm.json b/resources/test-data/integration-tests-low-block-gas-limit/evm.json index c0f54d810..8a002b7f5 100644 --- a/resources/test-data/integration-tests-low-block-gas-limit/evm.json +++ b/resources/test-data/integration-tests-low-block-gas-limit/evm.json @@ -76,7 +76,7 @@ { "address": "0x3200000000000000000000000000000000000002", "balance": "0x0", - "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611ea0565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f19565b610624565b34801561020b57600080fd5b5061015461021a366004611f90565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fa9565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611f90565b610853565b3480156102c457600080fd5b506101896102d3366004611ea0565b61091c565b3480156102e457600080fd5b506101896102f3366004611ff7565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611f90565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612020565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db366004611ff7565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff1916600117905560026105568587836120fb565b5060036105648385836120fb565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121e4565b60405180910390a15050505050565b61063581662386f26fc10000612234565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f61224b565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f461224b565b9050602002013582846107079190612261565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612072565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612072565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d28587836120fb565b5060036109e08385836120fb565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121e4565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612072565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612274565b610b3e604085016020860161229e565b610b4b60408601866122c8565b610b5860608801886122c8565b610b6560808a018a6122c8565b610b7560c08c0160a08d01612274565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122c8565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122c8565b8861010001356040518663ffffffff1660e01b8152600401610e9995949392919061230f565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612341565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612261565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612072565b915060009050611007838284611840565b905061109d816002805461101a90612072565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612072565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612261565b6110fd856014612261565b86516111099190612363565b869190611840565b9050611124816003805461101a90612072565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119c6565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f826119fc565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a999989796959493929190612376565b604051602081830303815290604052611a6d565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612261565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611a94565b9050600019810361144d575060009695505050505050565b6114578184612261565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612261565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611add565b905060001981036114f1575060009695505050505050565b6114fb8184612261565b9250506001016114b1565b600080611514836000611b41565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611ce5565b90506000198103611571576000935050505061158d565b61157b8184612261565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611ce5565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612261565b915060010161159b565b506116178582611ce5565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612261565b905060005b868110156117bf5761174b8883611b41565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612261565b6117ab9190612261565b6117b59083612261565b9150600101611739565b506117ca8782611b41565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612261565b61182d906001612261565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612261565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b6000815183511461194e5760405162461bcd60e51b8152602060048201526014602482015273098cadccee8d0e640c8de40dcdee840dac2e8c6d60631b604482015260640161043f565b825160005b818110156119bb5783818151811061196d5761196d61224b565b602001015160f81c60f81b6001600160f81b0319168582815181106119945761199461224b565b01602001516001600160f81b031916146119b35760009250505061158d565b600101611953565b506001949350505050565b600080600280546119d690612072565b9150600090506119e884836014611840565b6119f1906123df565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611aa38585611d87565b909250905060018201611abc576000199250505061158d565b80611ac8836025612261565b611ad29190612261565b61166d906004612261565b6000611aea826009612261565b83511015611afb575060001961158d565b600080611b1285611b0d866008612261565b611b41565b909250905060018201611b2b576000199250505061158d565b80611b37836009612261565b61166d9190612261565b6000806000611b508585611dc9565b90508060ff16600003611b85576000858581518110611b7157611b7161224b565b016020015190935060f81c9150611cde9050565b83611b91826001612432565b60ff16611b9e9190612261565b85511015611bb55760001960009250925050611cde565b60008160ff16600203611bf957611bee611bda611bd3876001612261565b8890611e4f565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611cd4565b8160ff16600403611c4857611c3b611c15611bd3876001612261565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611cd4565b8160ff16600803611cd457611cc7611c64611bd3876001612261565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611cf48585611b41565b909250905060018201611d0d576000199250505061158d565b600080611d1b846001612261565b905060005b83811015611d7c57611d3688611b0d848a612261565b909550925060018301611d52576000199550505050505061158d565b82611d5e866001612261565b611d689190612261565b611d729083612261565b9150600101611d20565b509695505050505050565b600080611d95836025612261565b84511015611daa575060001990506000611cde565b600080611dbc86611b0d876024612261565b9097909650945050505050565b6000828281518110611ddd57611ddd61224b565b016020015160f81c60ff03611df45750600861158d565b828281518110611e0657611e0661224b565b016020015160f81c60fe03611e1d5750600461158d565b828281518110611e2f57611e2f61224b565b016020015160f81c60fd03611e465750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e7057600080fd5b50813567ffffffffffffffff811115611e8857600080fd5b602083019150836020828501011115611cde57600080fd5b600080600080600060608688031215611eb857600080fd5b853567ffffffffffffffff811115611ecf57600080fd5b611edb88828901611e5e565b909650945050602086013567ffffffffffffffff811115611efb57600080fd5b611f0788828901611e5e565b96999598509660400135949350505050565b60008060208385031215611f2c57600080fd5b823567ffffffffffffffff811115611f4357600080fd5b8301601f81018513611f5457600080fd5b803567ffffffffffffffff811115611f6b57600080fd5b8560208260051b8401011115611f8057600080fd5b6020919091019590945092505050565b600060208284031215611fa257600080fd5b5035919050565b602081526000825180602084015260005b81811015611fd75760208186018101516040868401015201611fba565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561200957600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561203257600080fd5b813567ffffffffffffffff81111561204957600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061208657607f821691505b6020821081036120a657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156120f657806000526020600020601f840160051c810160208510156120d35750805b601f840160051c820191505b818110156120f357600081556001016120df565b50505b505050565b67ffffffffffffffff8311156121135761211361205c565b612127836121218354612072565b836120ac565b6000601f84116001811461215b57600085156121435750838201355b600019600387901b1c1916600186901b1783556120f3565b600083815260209020601f19861690835b8281101561218c578685013582556020948501946001909201910161216c565b50868210156121a95760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006121f86060830187896121bb565b828103602084015261220b8186886121bb565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d61221e565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d61221e565b60006020828403121561228657600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122b057600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122df57600080fd5b83018035915067ffffffffffffffff8211156122fa57600080fd5b602001915036819003821315611cde57600080fd5b85815284602082015260806040820152600061232f6080830185876121bb565b90508260608301529695505050505050565b60006020828403121561235357600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d61221e565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff1981169190601482101561242b576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61221e56" + "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611eb5565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f2e565b610624565b34801561020b57600080fd5b5061015461021a366004611fa5565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fbe565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611fa5565b610853565b3480156102c457600080fd5b506101896102d3366004611eb5565b61091c565b3480156102e457600080fd5b506101896102f336600461200c565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611fa5565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612035565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db36600461200c565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff191660011790556002610556858783612110565b506003610564838583612110565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121f9565b60405180910390a15050505050565b61063581662386f26fc10000612249565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f612260565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f4612260565b9050602002013582846107079190612276565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612087565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612087565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d2858783612110565b5060036109e0838583612110565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121f9565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612087565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612289565b610b3e60408501602086016122b3565b610b4b60408601866122dd565b610b5860608801886122dd565b610b6560808a018a6122dd565b610b7560c08c0160a08d01612289565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122dd565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122dd565b8861010001356040518663ffffffff1660e01b8152600401610e99959493929190612324565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612356565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612276565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612087565b915060009050611007838284611840565b905061109d816002805461101a90612087565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612087565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612276565b6110fd856014612276565b86516111099190612378565b869190611840565b9050611124816003805461101a90612087565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119db565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f82611a11565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a99998979695949392919061238b565b604051602081830303815290604052611a82565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612276565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611aa9565b9050600019810361144d575060009695505050505050565b6114578184612276565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612276565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611af2565b905060001981036114f1575060009695505050505050565b6114fb8184612276565b9250506001016114b1565b600080611514836000611b56565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611cfa565b90506000198103611571576000935050505061158d565b61157b8184612276565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611cfa565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612276565b915060010161159b565b506116178582611cfa565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612276565b905060005b868110156117bf5761174b8883611b56565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612276565b6117ab9190612276565b6117b59083612276565b9150600101611739565b506117ca8782611b56565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612276565b61182d906001612276565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612276565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b8151815160009190811461191c57600091505061158d565b60206000805b838311611952575050848101518482015160209092019180821461194d57600094505050505061158d565b611922565b600061195f602085612378565b90505b848110156119cd5786818151811061197c5761197c612260565b602001015160f81c60f81b6001600160f81b0319168882815181106119a3576119a3612260565b01602001516001600160f81b031916146119c55760009550505050505061158d565b600101611962565b506001979650505050505050565b600080600280546119eb90612087565b9150600090506119fd84836014611840565b611a06906123f4565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611ab88585611d9c565b909250905060018201611ad1576000199250505061158d565b80611add836025612276565b611ae79190612276565b61166d906004612276565b6000611aff826009612276565b83511015611b10575060001961158d565b600080611b2785611b22866008612276565b611b56565b909250905060018201611b40576000199250505061158d565b80611b4c836009612276565b61166d9190612276565b6000806000611b658585611dde565b90508060ff16600003611b9a576000858581518110611b8657611b86612260565b016020015190935060f81c9150611cf39050565b83611ba6826001612447565b60ff16611bb39190612276565b85511015611bca5760001960009250925050611cf3565b60008160ff16600203611c0e57611c03611bef611be8876001612276565b8890611e64565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611ce9565b8160ff16600403611c5d57611c50611c2a611be8876001612276565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611ce9565b8160ff16600803611ce957611cdc611c79611be8876001612276565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611d098585611b56565b909250905060018201611d22576000199250505061158d565b600080611d30846001612276565b905060005b83811015611d9157611d4b88611b22848a612276565b909550925060018301611d67576000199550505050505061158d565b82611d73866001612276565b611d7d9190612276565b611d879083612276565b9150600101611d35565b509695505050505050565b600080611daa836025612276565b84511015611dbf575060001990506000611cf3565b600080611dd186611b22876024612276565b9097909650945050505050565b6000828281518110611df257611df2612260565b016020015160f81c60ff03611e095750600861158d565b828281518110611e1b57611e1b612260565b016020015160f81c60fe03611e325750600461158d565b828281518110611e4457611e44612260565b016020015160f81c60fd03611e5b5750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e8557600080fd5b50813567ffffffffffffffff811115611e9d57600080fd5b602083019150836020828501011115611cf357600080fd5b600080600080600060608688031215611ecd57600080fd5b853567ffffffffffffffff811115611ee457600080fd5b611ef088828901611e73565b909650945050602086013567ffffffffffffffff811115611f1057600080fd5b611f1c88828901611e73565b96999598509660400135949350505050565b60008060208385031215611f4157600080fd5b823567ffffffffffffffff811115611f5857600080fd5b8301601f81018513611f6957600080fd5b803567ffffffffffffffff811115611f8057600080fd5b8560208260051b8401011115611f9557600080fd5b6020919091019590945092505050565b600060208284031215611fb757600080fd5b5035919050565b602081526000825180602084015260005b81811015611fec5760208186018101516040868401015201611fcf565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561201e57600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561204757600080fd5b813567ffffffffffffffff81111561205e57600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061209b57607f821691505b6020821081036120bb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561210b57806000526020600020601f840160051c810160208510156120e85750805b601f840160051c820191505b8181101561210857600081556001016120f4565b50505b505050565b67ffffffffffffffff83111561212857612128612071565b61213c836121368354612087565b836120c1565b6000601f84116001811461217057600085156121585750838201355b600019600387901b1c1916600186901b178355612108565b600083815260209020601f19861690835b828110156121a15786850135825560209485019460019092019101612181565b50868210156121be5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061220d6060830187896121d0565b82810360208401526122208186886121d0565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d612233565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d612233565b60006020828403121561229b57600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122c557600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122f457600080fd5b83018035915067ffffffffffffffff82111561230f57600080fd5b602001915036819003821315611cf357600080fd5b8581528460208201526080604082015260006123446080830185876121d0565b90508260608301529695505050505050565b60006020828403121561236857600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d612233565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff19811691906014821015612440576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61223356" }, { "address": "0x3200000000000000000000000000000000000003", diff --git a/resources/test-data/integration-tests-low-max-l2-blocks-per-l1/evm.json b/resources/test-data/integration-tests-low-max-l2-blocks-per-l1/evm.json index 812a8e169..a07c04b08 100644 --- a/resources/test-data/integration-tests-low-max-l2-blocks-per-l1/evm.json +++ b/resources/test-data/integration-tests-low-max-l2-blocks-per-l1/evm.json @@ -76,7 +76,7 @@ { "address": "0x3200000000000000000000000000000000000002", "balance": "0x0", - "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611ea0565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f19565b610624565b34801561020b57600080fd5b5061015461021a366004611f90565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fa9565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611f90565b610853565b3480156102c457600080fd5b506101896102d3366004611ea0565b61091c565b3480156102e457600080fd5b506101896102f3366004611ff7565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611f90565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612020565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db366004611ff7565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff1916600117905560026105568587836120fb565b5060036105648385836120fb565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121e4565b60405180910390a15050505050565b61063581662386f26fc10000612234565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f61224b565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f461224b565b9050602002013582846107079190612261565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612072565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612072565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d28587836120fb565b5060036109e08385836120fb565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121e4565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612072565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612274565b610b3e604085016020860161229e565b610b4b60408601866122c8565b610b5860608801886122c8565b610b6560808a018a6122c8565b610b7560c08c0160a08d01612274565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122c8565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122c8565b8861010001356040518663ffffffff1660e01b8152600401610e9995949392919061230f565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612341565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612261565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612072565b915060009050611007838284611840565b905061109d816002805461101a90612072565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612072565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612261565b6110fd856014612261565b86516111099190612363565b869190611840565b9050611124816003805461101a90612072565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119c6565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f826119fc565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a999989796959493929190612376565b604051602081830303815290604052611a6d565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612261565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611a94565b9050600019810361144d575060009695505050505050565b6114578184612261565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612261565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611add565b905060001981036114f1575060009695505050505050565b6114fb8184612261565b9250506001016114b1565b600080611514836000611b41565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611ce5565b90506000198103611571576000935050505061158d565b61157b8184612261565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611ce5565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612261565b915060010161159b565b506116178582611ce5565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612261565b905060005b868110156117bf5761174b8883611b41565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612261565b6117ab9190612261565b6117b59083612261565b9150600101611739565b506117ca8782611b41565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612261565b61182d906001612261565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612261565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b6000815183511461194e5760405162461bcd60e51b8152602060048201526014602482015273098cadccee8d0e640c8de40dcdee840dac2e8c6d60631b604482015260640161043f565b825160005b818110156119bb5783818151811061196d5761196d61224b565b602001015160f81c60f81b6001600160f81b0319168582815181106119945761199461224b565b01602001516001600160f81b031916146119b35760009250505061158d565b600101611953565b506001949350505050565b600080600280546119d690612072565b9150600090506119e884836014611840565b6119f1906123df565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611aa38585611d87565b909250905060018201611abc576000199250505061158d565b80611ac8836025612261565b611ad29190612261565b61166d906004612261565b6000611aea826009612261565b83511015611afb575060001961158d565b600080611b1285611b0d866008612261565b611b41565b909250905060018201611b2b576000199250505061158d565b80611b37836009612261565b61166d9190612261565b6000806000611b508585611dc9565b90508060ff16600003611b85576000858581518110611b7157611b7161224b565b016020015190935060f81c9150611cde9050565b83611b91826001612432565b60ff16611b9e9190612261565b85511015611bb55760001960009250925050611cde565b60008160ff16600203611bf957611bee611bda611bd3876001612261565b8890611e4f565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611cd4565b8160ff16600403611c4857611c3b611c15611bd3876001612261565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611cd4565b8160ff16600803611cd457611cc7611c64611bd3876001612261565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611cf48585611b41565b909250905060018201611d0d576000199250505061158d565b600080611d1b846001612261565b905060005b83811015611d7c57611d3688611b0d848a612261565b909550925060018301611d52576000199550505050505061158d565b82611d5e866001612261565b611d689190612261565b611d729083612261565b9150600101611d20565b509695505050505050565b600080611d95836025612261565b84511015611daa575060001990506000611cde565b600080611dbc86611b0d876024612261565b9097909650945050505050565b6000828281518110611ddd57611ddd61224b565b016020015160f81c60ff03611df45750600861158d565b828281518110611e0657611e0661224b565b016020015160f81c60fe03611e1d5750600461158d565b828281518110611e2f57611e2f61224b565b016020015160f81c60fd03611e465750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e7057600080fd5b50813567ffffffffffffffff811115611e8857600080fd5b602083019150836020828501011115611cde57600080fd5b600080600080600060608688031215611eb857600080fd5b853567ffffffffffffffff811115611ecf57600080fd5b611edb88828901611e5e565b909650945050602086013567ffffffffffffffff811115611efb57600080fd5b611f0788828901611e5e565b96999598509660400135949350505050565b60008060208385031215611f2c57600080fd5b823567ffffffffffffffff811115611f4357600080fd5b8301601f81018513611f5457600080fd5b803567ffffffffffffffff811115611f6b57600080fd5b8560208260051b8401011115611f8057600080fd5b6020919091019590945092505050565b600060208284031215611fa257600080fd5b5035919050565b602081526000825180602084015260005b81811015611fd75760208186018101516040868401015201611fba565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561200957600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561203257600080fd5b813567ffffffffffffffff81111561204957600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061208657607f821691505b6020821081036120a657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156120f657806000526020600020601f840160051c810160208510156120d35750805b601f840160051c820191505b818110156120f357600081556001016120df565b50505b505050565b67ffffffffffffffff8311156121135761211361205c565b612127836121218354612072565b836120ac565b6000601f84116001811461215b57600085156121435750838201355b600019600387901b1c1916600186901b1783556120f3565b600083815260209020601f19861690835b8281101561218c578685013582556020948501946001909201910161216c565b50868210156121a95760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006121f86060830187896121bb565b828103602084015261220b8186886121bb565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d61221e565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d61221e565b60006020828403121561228657600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122b057600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122df57600080fd5b83018035915067ffffffffffffffff8211156122fa57600080fd5b602001915036819003821315611cde57600080fd5b85815284602082015260806040820152600061232f6080830185876121bb565b90508260608301529695505050505050565b60006020828403121561235357600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d61221e565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff1981169190601482101561242b576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61221e56" + "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611eb5565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f2e565b610624565b34801561020b57600080fd5b5061015461021a366004611fa5565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fbe565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611fa5565b610853565b3480156102c457600080fd5b506101896102d3366004611eb5565b61091c565b3480156102e457600080fd5b506101896102f336600461200c565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611fa5565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612035565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db36600461200c565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff191660011790556002610556858783612110565b506003610564838583612110565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121f9565b60405180910390a15050505050565b61063581662386f26fc10000612249565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f612260565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f4612260565b9050602002013582846107079190612276565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612087565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612087565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d2858783612110565b5060036109e0838583612110565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121f9565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612087565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612289565b610b3e60408501602086016122b3565b610b4b60408601866122dd565b610b5860608801886122dd565b610b6560808a018a6122dd565b610b7560c08c0160a08d01612289565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122dd565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122dd565b8861010001356040518663ffffffff1660e01b8152600401610e99959493929190612324565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612356565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612276565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612087565b915060009050611007838284611840565b905061109d816002805461101a90612087565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612087565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612276565b6110fd856014612276565b86516111099190612378565b869190611840565b9050611124816003805461101a90612087565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119db565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f82611a11565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a99998979695949392919061238b565b604051602081830303815290604052611a82565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612276565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611aa9565b9050600019810361144d575060009695505050505050565b6114578184612276565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612276565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611af2565b905060001981036114f1575060009695505050505050565b6114fb8184612276565b9250506001016114b1565b600080611514836000611b56565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611cfa565b90506000198103611571576000935050505061158d565b61157b8184612276565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611cfa565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612276565b915060010161159b565b506116178582611cfa565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612276565b905060005b868110156117bf5761174b8883611b56565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612276565b6117ab9190612276565b6117b59083612276565b9150600101611739565b506117ca8782611b56565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612276565b61182d906001612276565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612276565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b8151815160009190811461191c57600091505061158d565b60206000805b838311611952575050848101518482015160209092019180821461194d57600094505050505061158d565b611922565b600061195f602085612378565b90505b848110156119cd5786818151811061197c5761197c612260565b602001015160f81c60f81b6001600160f81b0319168882815181106119a3576119a3612260565b01602001516001600160f81b031916146119c55760009550505050505061158d565b600101611962565b506001979650505050505050565b600080600280546119eb90612087565b9150600090506119fd84836014611840565b611a06906123f4565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611ab88585611d9c565b909250905060018201611ad1576000199250505061158d565b80611add836025612276565b611ae79190612276565b61166d906004612276565b6000611aff826009612276565b83511015611b10575060001961158d565b600080611b2785611b22866008612276565b611b56565b909250905060018201611b40576000199250505061158d565b80611b4c836009612276565b61166d9190612276565b6000806000611b658585611dde565b90508060ff16600003611b9a576000858581518110611b8657611b86612260565b016020015190935060f81c9150611cf39050565b83611ba6826001612447565b60ff16611bb39190612276565b85511015611bca5760001960009250925050611cf3565b60008160ff16600203611c0e57611c03611bef611be8876001612276565b8890611e64565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611ce9565b8160ff16600403611c5d57611c50611c2a611be8876001612276565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611ce9565b8160ff16600803611ce957611cdc611c79611be8876001612276565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611d098585611b56565b909250905060018201611d22576000199250505061158d565b600080611d30846001612276565b905060005b83811015611d9157611d4b88611b22848a612276565b909550925060018301611d67576000199550505050505061158d565b82611d73866001612276565b611d7d9190612276565b611d879083612276565b9150600101611d35565b509695505050505050565b600080611daa836025612276565b84511015611dbf575060001990506000611cf3565b600080611dd186611b22876024612276565b9097909650945050505050565b6000828281518110611df257611df2612260565b016020015160f81c60ff03611e095750600861158d565b828281518110611e1b57611e1b612260565b016020015160f81c60fe03611e325750600461158d565b828281518110611e4457611e44612260565b016020015160f81c60fd03611e5b5750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e8557600080fd5b50813567ffffffffffffffff811115611e9d57600080fd5b602083019150836020828501011115611cf357600080fd5b600080600080600060608688031215611ecd57600080fd5b853567ffffffffffffffff811115611ee457600080fd5b611ef088828901611e73565b909650945050602086013567ffffffffffffffff811115611f1057600080fd5b611f1c88828901611e73565b96999598509660400135949350505050565b60008060208385031215611f4157600080fd5b823567ffffffffffffffff811115611f5857600080fd5b8301601f81018513611f6957600080fd5b803567ffffffffffffffff811115611f8057600080fd5b8560208260051b8401011115611f9557600080fd5b6020919091019590945092505050565b600060208284031215611fb757600080fd5b5035919050565b602081526000825180602084015260005b81811015611fec5760208186018101516040868401015201611fcf565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561201e57600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561204757600080fd5b813567ffffffffffffffff81111561205e57600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061209b57607f821691505b6020821081036120bb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561210b57806000526020600020601f840160051c810160208510156120e85750805b601f840160051c820191505b8181101561210857600081556001016120f4565b50505b505050565b67ffffffffffffffff83111561212857612128612071565b61213c836121368354612087565b836120c1565b6000601f84116001811461217057600085156121585750838201355b600019600387901b1c1916600186901b178355612108565b600083815260209020601f19861690835b828110156121a15786850135825560209485019460019092019101612181565b50868210156121be5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061220d6060830187896121d0565b82810360208401526122208186886121d0565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d612233565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d612233565b60006020828403121561229b57600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122c557600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122f457600080fd5b83018035915067ffffffffffffffff82111561230f57600080fd5b602001915036819003821315611cf357600080fd5b8581528460208201526080604082015260006123446080830185876121d0565b90508260608301529695505050505050565b60006020828403121561236857600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d612233565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff19811691906014821015612440576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61223356" }, { "address": "0x3200000000000000000000000000000000000003", diff --git a/resources/test-data/integration-tests/evm.json b/resources/test-data/integration-tests/evm.json index 812a8e169..a07c04b08 100644 --- a/resources/test-data/integration-tests/evm.json +++ b/resources/test-data/integration-tests/evm.json @@ -76,7 +76,7 @@ { "address": "0x3200000000000000000000000000000000000002", "balance": "0x0", - "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611ea0565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f19565b610624565b34801561020b57600080fd5b5061015461021a366004611f90565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fa9565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611f90565b610853565b3480156102c457600080fd5b506101896102d3366004611ea0565b61091c565b3480156102e457600080fd5b506101896102f3366004611ff7565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611f90565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612020565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db366004611ff7565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff1916600117905560026105568587836120fb565b5060036105648385836120fb565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121e4565b60405180910390a15050505050565b61063581662386f26fc10000612234565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f61224b565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f461224b565b9050602002013582846107079190612261565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612072565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612072565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d28587836120fb565b5060036109e08385836120fb565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121e4565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612072565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612274565b610b3e604085016020860161229e565b610b4b60408601866122c8565b610b5860608801886122c8565b610b6560808a018a6122c8565b610b7560c08c0160a08d01612274565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122c8565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122c8565b8861010001356040518663ffffffff1660e01b8152600401610e9995949392919061230f565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612341565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122c8565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612261565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612072565b915060009050611007838284611840565b905061109d816002805461101a90612072565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612072565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612261565b6110fd856014612261565b86516111099190612363565b869190611840565b9050611124816003805461101a90612072565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119c6565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f826119fc565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a999989796959493929190612376565b604051602081830303815290604052611a6d565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612261565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611a94565b9050600019810361144d575060009695505050505050565b6114578184612261565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612261565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611add565b905060001981036114f1575060009695505050505050565b6114fb8184612261565b9250506001016114b1565b600080611514836000611b41565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611ce5565b90506000198103611571576000935050505061158d565b61157b8184612261565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611ce5565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612261565b915060010161159b565b506116178582611ce5565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612261565b905060005b868110156117bf5761174b8883611b41565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612261565b6117ab9190612261565b6117b59083612261565b9150600101611739565b506117ca8782611b41565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612261565b61182d906001612261565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612261565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b6000815183511461194e5760405162461bcd60e51b8152602060048201526014602482015273098cadccee8d0e640c8de40dcdee840dac2e8c6d60631b604482015260640161043f565b825160005b818110156119bb5783818151811061196d5761196d61224b565b602001015160f81c60f81b6001600160f81b0319168582815181106119945761199461224b565b01602001516001600160f81b031916146119b35760009250505061158d565b600101611953565b506001949350505050565b600080600280546119d690612072565b9150600090506119e884836014611840565b6119f1906123df565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611aa38585611d87565b909250905060018201611abc576000199250505061158d565b80611ac8836025612261565b611ad29190612261565b61166d906004612261565b6000611aea826009612261565b83511015611afb575060001961158d565b600080611b1285611b0d866008612261565b611b41565b909250905060018201611b2b576000199250505061158d565b80611b37836009612261565b61166d9190612261565b6000806000611b508585611dc9565b90508060ff16600003611b85576000858581518110611b7157611b7161224b565b016020015190935060f81c9150611cde9050565b83611b91826001612432565b60ff16611b9e9190612261565b85511015611bb55760001960009250925050611cde565b60008160ff16600203611bf957611bee611bda611bd3876001612261565b8890611e4f565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611cd4565b8160ff16600403611c4857611c3b611c15611bd3876001612261565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611cd4565b8160ff16600803611cd457611cc7611c64611bd3876001612261565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611cf48585611b41565b909250905060018201611d0d576000199250505061158d565b600080611d1b846001612261565b905060005b83811015611d7c57611d3688611b0d848a612261565b909550925060018301611d52576000199550505050505061158d565b82611d5e866001612261565b611d689190612261565b611d729083612261565b9150600101611d20565b509695505050505050565b600080611d95836025612261565b84511015611daa575060001990506000611cde565b600080611dbc86611b0d876024612261565b9097909650945050505050565b6000828281518110611ddd57611ddd61224b565b016020015160f81c60ff03611df45750600861158d565b828281518110611e0657611e0661224b565b016020015160f81c60fe03611e1d5750600461158d565b828281518110611e2f57611e2f61224b565b016020015160f81c60fd03611e465750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e7057600080fd5b50813567ffffffffffffffff811115611e8857600080fd5b602083019150836020828501011115611cde57600080fd5b600080600080600060608688031215611eb857600080fd5b853567ffffffffffffffff811115611ecf57600080fd5b611edb88828901611e5e565b909650945050602086013567ffffffffffffffff811115611efb57600080fd5b611f0788828901611e5e565b96999598509660400135949350505050565b60008060208385031215611f2c57600080fd5b823567ffffffffffffffff811115611f4357600080fd5b8301601f81018513611f5457600080fd5b803567ffffffffffffffff811115611f6b57600080fd5b8560208260051b8401011115611f8057600080fd5b6020919091019590945092505050565b600060208284031215611fa257600080fd5b5035919050565b602081526000825180602084015260005b81811015611fd75760208186018101516040868401015201611fba565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561200957600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561203257600080fd5b813567ffffffffffffffff81111561204957600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061208657607f821691505b6020821081036120a657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156120f657806000526020600020601f840160051c810160208510156120d35750805b601f840160051c820191505b818110156120f357600081556001016120df565b50505b505050565b67ffffffffffffffff8311156121135761211361205c565b612127836121218354612072565b836120ac565b6000601f84116001811461215b57600085156121435750838201355b600019600387901b1c1916600186901b1783556120f3565b600083815260209020601f19861690835b8281101561218c578685013582556020948501946001909201910161216c565b50868210156121a95760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006121f86060830187896121bb565b828103602084015261220b8186886121bb565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d61221e565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d61221e565b60006020828403121561228657600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122b057600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122df57600080fd5b83018035915067ffffffffffffffff8211156122fa57600080fd5b602001915036819003821315611cde57600080fd5b85815284602082015260806040820152600061232f6080830185876121bb565b90508260608301529695505050505050565b60006020828403121561235357600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d61221e565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff1981169190601482101561242b576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61221e56" + "code": "0x6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611eb5565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f2e565b610624565b34801561020b57600080fd5b5061015461021a366004611fa5565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fbe565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611fa5565b610853565b3480156102c457600080fd5b506101896102d3366004611eb5565b61091c565b3480156102e457600080fd5b506101896102f336600461200c565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611fa5565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612035565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db36600461200c565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff191660011790556002610556858783612110565b506003610564838583612110565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121f9565b60405180910390a15050505050565b61063581662386f26fc10000612249565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f612260565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f4612260565b9050602002013582846107079190612276565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612087565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612087565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d2858783612110565b5060036109e0838583612110565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121f9565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612087565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612289565b610b3e60408501602086016122b3565b610b4b60408601866122dd565b610b5860608801886122dd565b610b6560808a018a6122dd565b610b7560c08c0160a08d01612289565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122dd565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122dd565b8861010001356040518663ffffffff1660e01b8152600401610e99959493929190612324565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612356565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612276565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612087565b915060009050611007838284611840565b905061109d816002805461101a90612087565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612087565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612276565b6110fd856014612276565b86516111099190612378565b869190611840565b9050611124816003805461101a90612087565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119db565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f82611a11565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a99998979695949392919061238b565b604051602081830303815290604052611a82565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612276565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611aa9565b9050600019810361144d575060009695505050505050565b6114578184612276565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612276565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611af2565b905060001981036114f1575060009695505050505050565b6114fb8184612276565b9250506001016114b1565b600080611514836000611b56565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611cfa565b90506000198103611571576000935050505061158d565b61157b8184612276565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611cfa565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612276565b915060010161159b565b506116178582611cfa565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612276565b905060005b868110156117bf5761174b8883611b56565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612276565b6117ab9190612276565b6117b59083612276565b9150600101611739565b506117ca8782611b56565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612276565b61182d906001612276565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612276565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b8151815160009190811461191c57600091505061158d565b60206000805b838311611952575050848101518482015160209092019180821461194d57600094505050505061158d565b611922565b600061195f602085612378565b90505b848110156119cd5786818151811061197c5761197c612260565b602001015160f81c60f81b6001600160f81b0319168882815181106119a3576119a3612260565b01602001516001600160f81b031916146119c55760009550505050505061158d565b600101611962565b506001979650505050505050565b600080600280546119eb90612087565b9150600090506119fd84836014611840565b611a06906123f4565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611ab88585611d9c565b909250905060018201611ad1576000199250505061158d565b80611add836025612276565b611ae79190612276565b61166d906004612276565b6000611aff826009612276565b83511015611b10575060001961158d565b600080611b2785611b22866008612276565b611b56565b909250905060018201611b40576000199250505061158d565b80611b4c836009612276565b61166d9190612276565b6000806000611b658585611dde565b90508060ff16600003611b9a576000858581518110611b8657611b86612260565b016020015190935060f81c9150611cf39050565b83611ba6826001612447565b60ff16611bb39190612276565b85511015611bca5760001960009250925050611cf3565b60008160ff16600203611c0e57611c03611bef611be8876001612276565b8890611e64565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611ce9565b8160ff16600403611c5d57611c50611c2a611be8876001612276565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611ce9565b8160ff16600803611ce957611cdc611c79611be8876001612276565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611d098585611b56565b909250905060018201611d22576000199250505061158d565b600080611d30846001612276565b905060005b83811015611d9157611d4b88611b22848a612276565b909550925060018301611d67576000199550505050505061158d565b82611d73866001612276565b611d7d9190612276565b611d879083612276565b9150600101611d35565b509695505050505050565b600080611daa836025612276565b84511015611dbf575060001990506000611cf3565b600080611dd186611b22876024612276565b9097909650945050505050565b6000828281518110611df257611df2612260565b016020015160f81c60ff03611e095750600861158d565b828281518110611e1b57611e1b612260565b016020015160f81c60fe03611e325750600461158d565b828281518110611e4457611e44612260565b016020015160f81c60fd03611e5b5750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e8557600080fd5b50813567ffffffffffffffff811115611e9d57600080fd5b602083019150836020828501011115611cf357600080fd5b600080600080600060608688031215611ecd57600080fd5b853567ffffffffffffffff811115611ee457600080fd5b611ef088828901611e73565b909650945050602086013567ffffffffffffffff811115611f1057600080fd5b611f1c88828901611e73565b96999598509660400135949350505050565b60008060208385031215611f4157600080fd5b823567ffffffffffffffff811115611f5857600080fd5b8301601f81018513611f6957600080fd5b803567ffffffffffffffff811115611f8057600080fd5b8560208260051b8401011115611f9557600080fd5b6020919091019590945092505050565b600060208284031215611fb757600080fd5b5035919050565b602081526000825180602084015260005b81811015611fec5760208186018101516040868401015201611fcf565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561201e57600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561204757600080fd5b813567ffffffffffffffff81111561205e57600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061209b57607f821691505b6020821081036120bb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561210b57806000526020600020601f840160051c810160208510156120e85750805b601f840160051c820191505b8181101561210857600081556001016120f4565b50505b505050565b67ffffffffffffffff83111561212857612128612071565b61213c836121368354612087565b836120c1565b6000601f84116001811461217057600085156121585750838201355b600019600387901b1c1916600186901b178355612108565b600083815260209020601f19861690835b828110156121a15786850135825560209485019460019092019101612181565b50868210156121be5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061220d6060830187896121d0565b82810360208401526122208186886121d0565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d612233565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d612233565b60006020828403121561229b57600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122c557600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122f457600080fd5b83018035915067ffffffffffffffff82111561230f57600080fd5b602001915036819003821315611cf357600080fd5b8581528460208201526080604082015260006123446080830185876121d0565b90508260608301529695505050505050565b60006020828403121561236857600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d612233565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff19811691906014821015612440576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61223356" }, { "address": "0x3200000000000000000000000000000000000003", From 9df32ccd8f5a4287519882d48b83ae8a75a19ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Yaz=C4=B1c=C4=B1?= <75089142+yaziciahmet@users.noreply.github.com> Date: Wed, 31 Jul 2024 23:43:22 +0200 Subject: [PATCH 03/23] Sequencer scan L1 and resubmit mined commitments (#928) * Rescan l1 * Remove unused * Start da block from 1 * Rename * Better logs * Convert da logs to debug --- crates/bitcoin-da/src/service.rs | 6 +- crates/sequencer/src/sequencer.rs | 67 +++++++++++++++++-- .../full-node/db/sov-db/src/ledger_db/mod.rs | 15 +++++ .../db/sov-db/src/ledger_db/traits.rs | 3 + 4 files changed, 84 insertions(+), 7 deletions(-) diff --git a/crates/bitcoin-da/src/service.rs b/crates/bitcoin-da/src/service.rs index d148a6a50..0a0dd0d12 100644 --- a/crates/bitcoin-da/src/service.rs +++ b/crates/bitcoin-da/src/service.rs @@ -18,7 +18,7 @@ use sov_rollup_interface::da::DaSpec; use sov_rollup_interface::services::da::{BlobWithNotifier, DaService}; use tokio::sync::mpsc::{unbounded_channel, UnboundedSender}; use tokio::sync::oneshot::channel as oneshot_channel; -use tracing::{error, info, instrument, trace}; +use tracing::{debug, error, info, instrument, trace}; use crate::helpers::builders::{ create_inscription_transactions, sign_blob_with_private_key, write_reveal_tx, TxWithId, @@ -366,7 +366,7 @@ impl DaService for BitcoinService { // If no such block exists, block until one does. #[instrument(level = "trace", skip(self), err)] async fn get_block_at(&self, height: u64) -> Result { - info!("Getting block at height {}", height); + debug!("Getting block at height {}", height); let block_hash; loop { @@ -437,7 +437,7 @@ impl DaService for BitcoinService { &self, block: &Self::FilteredBlock, ) -> Vec<::BlobTransaction> { - info!( + debug!( "Extracting relevant txs from block {:?}", block.header.block_hash() ); diff --git a/crates/sequencer/src/sequencer.rs b/crates/sequencer/src/sequencer.rs index 6e6d37ce3..338ac80b7 100644 --- a/crates/sequencer/src/sequencer.rs +++ b/crates/sequencer/src/sequencer.rs @@ -622,13 +622,36 @@ where #[instrument(level = "trace", skip(self), err, ret)] pub async fn resubmit_pending_commitments(&mut self) -> anyhow::Result<()> { + info!("Resubmitting pending commitments"); + let pending_db_commitments = self.ledger_db.get_pending_commitments_l2_range()?; debug!("Pending db commitments: {:?}", pending_db_commitments); - let pending_da_commitments = self.get_pending_da_commitments().await; - debug!("Pending da commitments: {:?}", pending_da_commitments); + + let pending_mempool_commitments = self.get_pending_mempool_commitments().await; + debug!( + "Commitments that are already in DA mempool: {:?}", + pending_mempool_commitments + ); + + let last_commitment_l1_height = self + .ledger_db + .get_l1_height_of_last_commitment()? + .unwrap_or(SlotNumber(1)); + let mined_commitments = self + .get_mined_commitments_from(last_commitment_l1_height) + .await?; + debug!( + "Commitments that are already mined by DA: {:?}", + mined_commitments + ); + + let mut pending_commitments_to_remove = vec![]; + pending_commitments_to_remove.extend(pending_mempool_commitments); + pending_commitments_to_remove.extend(mined_commitments); + // TODO: also take mined DA blocks into account for (l2_start, l2_end) in pending_db_commitments { - if pending_da_commitments.iter().any(|commitment| { + if pending_commitments_to_remove.iter().any(|commitment| { commitment.l2_start_block_number == l2_start.0 && commitment.l2_end_block_number == l2_end.0 }) { @@ -763,7 +786,7 @@ where Ok(()) } - async fn get_pending_da_commitments(&self) -> Vec { + async fn get_pending_mempool_commitments(&self) -> Vec { self.da_service .get_relevant_blobs_of_pending_transactions() .await @@ -781,6 +804,42 @@ where .collect() } + async fn get_mined_commitments_from( + &self, + da_height: SlotNumber, + ) -> anyhow::Result> { + let head_da_height = self + .da_service + .get_head_block_header() + .await + .map_err(|e| anyhow!(e))? + .height(); + let mut mined_commitments = vec![]; + for height in da_height.0..=head_da_height { + let block = self + .da_service + .get_block_at(height) + .await + .map_err(|e| anyhow!(e))?; + let blobs = self.da_service.extract_relevant_blobs(&block); + let iter = blobs.into_iter().filter_map(|mut blob| { + match DaData::try_from_slice(blob.full_data()) { + Ok(da_data) => match da_data { + DaData::SequencerCommitment(commitment) => Some(commitment), + _ => None, + }, + Err(err) => { + warn!("Pending transaction blob failed to be parsed: {}", err); + None + } + } + }); + mined_commitments.extend(iter); + } + + Ok(mined_commitments) + } + #[instrument(level = "trace", skip(self), err, ret)] pub async fn run(&mut self) -> Result<(), anyhow::Error> { // Resubmit if there were pending commitments on restart diff --git a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs index 4fd35b811..46cf52bf5 100644 --- a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs +++ b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs @@ -704,6 +704,21 @@ impl SequencerLedgerOps for LedgerDB { fn get_last_sequencer_commitment_l2_height(&self) -> anyhow::Result> { self.db.get::(&()) } + + /// Get the most recent commitment's l1 height + #[instrument(level = "trace", skip(self), err, ret)] + fn get_l1_height_of_last_commitment(&self) -> anyhow::Result> { + let l2_height = self.get_last_sequencer_commitment_l2_height()?; + match l2_height { + Some(l2_height) => { + let soft_confirmation = self + .get_soft_batch_by_number(&l2_height)? + .expect("Expected soft confirmation to exist"); + Ok(Some(SlotNumber(soft_confirmation.da_slot_height))) + } + None => Ok(None), + } + } } impl NodeLedgerOps for LedgerDB { diff --git a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs index 33e800328..db35a137f 100644 --- a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs +++ b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs @@ -213,4 +213,7 @@ pub trait SequencerLedgerOps: SharedLedgerOps { /// Get the most recent committed batch /// Returns L2 height. fn get_last_sequencer_commitment_l2_height(&self) -> anyhow::Result>; + + /// Get the most recent commitment's l1 height + fn get_l1_height_of_last_commitment(&self) -> anyhow::Result>; } From f81463178c4971239a3b344f23470f05dbf5bff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Yaz=C4=B1c=C4=B1?= <75089142+yaziciahmet@users.noreply.github.com> Date: Thu, 1 Aug 2024 21:47:15 +0200 Subject: [PATCH 04/23] Read & set from rpc config (#940) --- crates/fullnode/src/runner.rs | 9 ++++++++- crates/prover/src/runner.rs | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/crates/fullnode/src/runner.rs b/crates/fullnode/src/runner.rs index e54e1d4e7..779b6e76c 100644 --- a/crates/fullnode/src/runner.rs +++ b/crates/fullnode/src/runner.rs @@ -10,6 +10,7 @@ use borsh::de::BorshDeserialize; use citrea_primitives::types::SoftConfirmationHash; use citrea_primitives::{get_da_block_at_height, L1BlockCache, SyncError}; use jsonrpsee::core::client::Error as JsonrpseeError; +use jsonrpsee::server::{BatchRequestConfig, ServerBuilder}; use jsonrpsee::RpcModule; use rs_merkle::algorithms::Sha256; use rs_merkle::MerkleTree; @@ -172,11 +173,17 @@ where let max_connections = self.rpc_config.max_connections; let max_subscriptions_per_connection = self.rpc_config.max_subscriptions_per_connection; + let max_request_body_size = self.rpc_config.max_request_body_size; + let max_response_body_size = self.rpc_config.max_response_body_size; + let batch_requests_limit = self.rpc_config.batch_requests_limit; let _handle = tokio::spawn(async move { - let server = jsonrpsee::server::ServerBuilder::default() + let server = ServerBuilder::default() .max_connections(max_connections) .max_subscriptions_per_connection(max_subscriptions_per_connection) + .max_request_body_size(max_request_body_size) + .max_response_body_size(max_response_body_size) + .set_batch_request_config(BatchRequestConfig::Limit(batch_requests_limit)) .build([listen_address].as_ref()) .await; diff --git a/crates/prover/src/runner.rs b/crates/prover/src/runner.rs index 56f505452..b7c164d6d 100644 --- a/crates/prover/src/runner.rs +++ b/crates/prover/src/runner.rs @@ -12,6 +12,7 @@ use borsh::de::BorshDeserialize; use citrea_primitives::types::SoftConfirmationHash; use citrea_primitives::{get_da_block_at_height, L1BlockCache}; use jsonrpsee::core::client::Error as JsonrpseeError; +use jsonrpsee::server::{BatchRequestConfig, ServerBuilder}; use jsonrpsee::RpcModule; use rand::Rng; use sequencer_client::{GetSoftBatchResponse, SequencerClient}; @@ -177,11 +178,17 @@ where let max_connections = self.rpc_config.max_connections; let max_subscriptions_per_connection = self.rpc_config.max_subscriptions_per_connection; + let max_request_body_size = self.rpc_config.max_request_body_size; + let max_response_body_size = self.rpc_config.max_response_body_size; + let batch_requests_limit = self.rpc_config.batch_requests_limit; let _handle = tokio::spawn(async move { - let server = jsonrpsee::server::ServerBuilder::default() + let server = ServerBuilder::default() .max_connections(max_connections) .max_subscriptions_per_connection(max_subscriptions_per_connection) + .max_request_body_size(max_request_body_size) + .max_response_body_size(max_response_body_size) + .set_batch_request_config(BatchRequestConfig::Limit(batch_requests_limit)) .build([listen_address].as_ref()) .await; From 865a319fb6073c94f26c6587b17fa0c256d8966a Mon Sep 17 00:00:00 2001 From: jfldde <168934971+jfldde@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:55:30 +0200 Subject: [PATCH 05/23] Add workflow dispatch to checks workflow (#936) --- .github/workflows/checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 5da5df0ff..e465201f2 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -39,6 +39,7 @@ name: Checks # so you're not wasting money unless several cores are sitting idle for long. on: + workflow_dispatch: merge_group: types: ["checks_requested"] push: From 3039c38dceb1cc4afe54679ad1664ab40faeca10 Mon Sep 17 00:00:00 2001 From: erdkocak <93616117+erdkocak@users.noreply.github.com> Date: Fri, 2 Aug 2024 18:56:45 +0300 Subject: [PATCH 06/23] changed the sys_tx_test file (#937) --- crates/evm/src/tests/sys_tx_tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/evm/src/tests/sys_tx_tests.rs b/crates/evm/src/tests/sys_tx_tests.rs index 5a501df68..5ce4dffec 100644 --- a/crates/evm/src/tests/sys_tx_tests.rs +++ b/crates/evm/src/tests/sys_tx_tests.rs @@ -793,7 +793,7 @@ fn config_push_contracts(config: &mut EvmConfig) { config.data.push(AccountData::new( address!("3200000000000000000000000000000000000002"), U256::ZERO, - Bytes::from_static(&hex!("6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611e9c565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f15565b610624565b34801561020b57600080fd5b5061015461021a366004611f8c565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fa5565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611f8c565b610853565b3480156102c457600080fd5b506101896102d3366004611e9c565b61091c565b3480156102e457600080fd5b506101896102f3366004611ff3565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611f8c565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b5061018961037036600461201c565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db366004611ff3565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff1916600117905560026105568587836120f7565b5060036105648385836120f7565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121e0565b60405180910390a15050505050565b61063581662386f26fc10000612230565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f612247565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f4612247565b905060200201358284610707919061225d565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d9061206e565b80601f01602080910402602001604051908101604052809291908181526020018280546107c99061206e565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d28587836120f7565b5060036109e08385836120f7565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121e0565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d9061206e565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612270565b610b3e604085016020860161229a565b610b4b60408601866122c4565b610b5860608801886122c4565b610b6560808a018a6122c4565b610b7560c08c0160a08d01612270565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122c4565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122c4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122c4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122c4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122c4565b8861010001356040518663ffffffff1660e01b8152600401610e9995949392919061230b565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda919061233d565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122c4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f91919061225d565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff69061206e565b915060009050611007838284611840565b905061109d816002805461101a9061206e565b80601f01602080910402602001604051908101604052809291908181526020018280546110469061206e565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f284601461225d565b6110fd85601461225d565b8651611109919061235f565b869190611840565b9050611124816003805461101a9061206e565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119c6565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f826119fc565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a999989796959493929190612372565b604051602081830303815290604052611a6d565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b600061140883600161225d565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611a94565b9050600019810361144d575060009695505050505050565b611457818461225d565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac83600161225d565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611add565b905060001981036114f1575060009695505050505050565b6114fb818461225d565b9250506001016114b1565b600080611514836000611b41565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611ce5565b90506000198103611571576000935050505061158d565b61157b818461225d565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611ce5565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b611602838361225d565b915060010161159b565b506116178582611ce5565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b60008061173484600161225d565b905060005b868110156117bf5761174b8883611b41565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a186600161225d565b6117ab919061225d565b6117b5908361225d565b9150600101611739565b506117ca8782611b41565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b61183581611822868561225d565b61182d90600161225d565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b838561225d565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b6000815183511461194e5760405162461bcd60e51b8152602060048201526014602482015273098cadccee8d0e640c8de40dcdee840dac2e8c6d60631b604482015260640161043f565b825160005b818110156119bb5783818151811061196d5761196d612247565b602001015160f81c60f81b6001600160f81b03191685828151811061199457611994612247565b01602001516001600160f81b031916146119b35760009250505061158d565b600101611953565b506001949350505050565b600080600280546119d69061206e565b9150600090506119e884836014611840565b6119f1906123db565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611aa38585611d83565b909250905060018201611abc576000199250505061158d565b80611ac883602561225d565b611ad2919061225d565b61166d90600461225d565b6000611aea82600961225d565b83511015611afb575060001961158d565b600080611b1285611b0d86600861225d565b611b41565b909250905060018201611b2b576000199250505061158d565b80611b3783600961225d565b61166d919061225d565b6000806000611b508585611dc5565b90508060ff16600003611b85576000858581518110611b7157611b71612247565b016020015190935060f81c9150611cde9050565b83611b9182600161242e565b60ff16611b9e919061225d565b85511015611bb55760001960009250925050611cde565b60008160ff16600203611bf957611bee611bda611bd387600161225d565b8890611e4b565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611cd4565b8160ff16600403611c4857611c3b611c15611bd387600161225d565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611cd4565b8160ff16600803611cd457611cc7611c64611bd387600161225d565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611cf48585611b41565b909250905060018201611d0d576000199250505061158d565b600080611d1b84600161225d565b905060005b83811015611d7857611d328883611b41565b909550925060018301611d4e576000199550505050505061158d565b82611d5a86600161225d565b611d64919061225d565b611d6e908361225d565b9150600101611d20565b509695505050505050565b600080611d9183602561225d565b84511015611da6575060001990506000611cde565b600080611db886611b0d87602461225d565b9097909650945050505050565b6000828281518110611dd957611dd9612247565b016020015160f81c60ff03611df05750600861158d565b828281518110611e0257611e02612247565b016020015160f81c60fe03611e195750600461158d565b828281518110611e2b57611e2b612247565b016020015160f81c60fd03611e425750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e6c57600080fd5b50813567ffffffffffffffff811115611e8457600080fd5b602083019150836020828501011115611cde57600080fd5b600080600080600060608688031215611eb457600080fd5b853567ffffffffffffffff811115611ecb57600080fd5b611ed788828901611e5a565b909650945050602086013567ffffffffffffffff811115611ef757600080fd5b611f0388828901611e5a565b96999598509660400135949350505050565b60008060208385031215611f2857600080fd5b823567ffffffffffffffff811115611f3f57600080fd5b8301601f81018513611f5057600080fd5b803567ffffffffffffffff811115611f6757600080fd5b8560208260051b8401011115611f7c57600080fd5b6020919091019590945092505050565b600060208284031215611f9e57600080fd5b5035919050565b602081526000825180602084015260005b81811015611fd35760208186018101516040868401015201611fb6565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561200557600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561202e57600080fd5b813567ffffffffffffffff81111561204557600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061208257607f821691505b6020821081036120a257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156120f257806000526020600020601f840160051c810160208510156120cf5750805b601f840160051c820191505b818110156120ef57600081556001016120db565b50505b505050565b67ffffffffffffffff83111561210f5761210f612058565b6121238361211d835461206e565b836120a8565b6000601f841160018114612157576000851561213f5750838201355b600019600387901b1c1916600186901b1783556120ef565b600083815260209020601f19861690835b828110156121885786850135825560209485019460019092019101612168565b50868210156121a55760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006121f46060830187896121b7565b82810360208401526122078186886121b7565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d61221a565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d61221a565b60006020828403121561228257600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122ac57600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122db57600080fd5b83018035915067ffffffffffffffff8211156122f657600080fd5b602001915036819003821315611cde57600080fd5b85815284602082015260806040820152600061232b6080830185876121b7565b90508260608301529695505050505050565b60006020828403121561234f57600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d61221a565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff19811691906014821015612427576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61221a56")), + Bytes::from_static(&hex!("6080604052600436106101355760003560e01c80638e19899e116100ab578063d761753e1161006f578063d761753e1461032d578063dd95c7c614610355578063e30c397814610375578063e613ae001461038a578063ec6925a7146103a5578063f2fde38b146103c057600080fd5b80638e19899e146102a55780639f963f59146102b8578063b3ab15fb146102d8578063b93780f6146102f8578063d1c444561461030d57600080fd5b80635e0e5b3e116100fd5780635e0e5b3e146101ff578063715018a61461022f578063781952a81461024457806379ba50971461025957806387f8bf561461026e5780638da5cb5b1461029057600080fd5b8063158ef93e1461013a578063412601371461016957806343e316871461018b578063570ca735146101af57806359c19cee146101ec575b600080fd5b34801561014657600080fd5b506000546101549060ff1681565b60405190151581526020015b60405180910390f35b34801561017557600080fd5b50610189610184366004611eb5565b6103e0565b005b34801561019757600080fd5b506101a160015481565b604051908152602001610160565b3480156101bb57600080fd5b506000546101d49061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610160565b6101896101fa366004611f2e565b610624565b34801561020b57600080fd5b5061015461021a366004611fa5565b60046020526000908152604090205460ff1681565b34801561023b57600080fd5b50610189610734565b34801561025057600080fd5b506005546101a1565b34801561026557600080fd5b50610189610748565b34801561027a57600080fd5b50610283610790565b6040516101609190611fbe565b34801561029c57600080fd5b506101d461081e565b6101896102b3366004611fa5565b610853565b3480156102c457600080fd5b506101896102d3366004611eb5565b61091c565b3480156102e457600080fd5b506101896102f336600461200c565b610a1e565b34801561030457600080fd5b50610283610a8f565b34801561031957600080fd5b506101a1610328366004611fa5565b610a9c565b34801561033957600080fd5b506101d473deaddeaddeaddeaddeaddeaddeaddeaddeaddead81565b34801561036157600080fd5b50610189610370366004612035565b610abd565b34801561038157600080fd5b506101d4611267565b34801561039657600080fd5b506101d46001603160981b0181565b3480156103b157600080fd5b506101a1662386f26fc1000081565b3480156103cc57600080fd5b506101896103db36600461200c565b611290565b3373deaddeaddeaddeaddeaddeaddeaddeaddeaddead146104485760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206973206e6f74207468652073797374656d2063616c6c65720060448201526064015b60405180910390fd5b60005460ff161561049b5760405162461bcd60e51b815260206004820152601f60248201527f436f6e747261637420697320616c726561647920696e697469616c697a656400604482015260640161043f565b806000036104eb5760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b600084900361053c5760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b6000805460ff191660011790556002610556858783612110565b506003610564838583612110565b50600181905560008054610100600160a81b03191674deaddeaddeaddeaddeaddeaddeaddeaddeaddead001781556040805191825273deaddeaddeaddeaddeaddeaddeaddeaddeaddead60208301527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a17f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c3485858585856040516106159594939291906121f9565b60405180910390a15050505050565b61063581662386f26fc10000612249565b341461067d5760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b60055460005b8281101561072e57600584848381811061069f5761069f612260565b835460018101855560009485526020948590209190940292909201359190920155507fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b8484838181106106f4576106f4612260565b9050602002013582846107079190612276565b604080519283526020830191909152429082015260600160405180910390a1600101610683565b50505050565b61073c611315565b6107466000611347565b565b3380610752611267565b6001600160a01b0316146107845760405163118cdaa760e01b81526001600160a01b038216600482015260240161043f565b61078d81611347565b50565b6003805461079d90612087565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612087565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b662386f26fc1000034146108a35760405162461bcd60e51b8152602060048201526017602482015276125b9d985b1a59081dda5d1a191c985dc8185b5bdd5b9d604a1b604482015260640161043f565b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db081018290556040805183815260208101839052428183015290517fc96d1af655ee5eb07357bb1097f3b2f247ea0c4e3cf5f9a5c8449c4f8b64fb6b9181900360600190a15050565b610924611315565b806000036109745760405162461bcd60e51b815260206004820152601a60248201527f566572696669657220636f756e742063616e6e6f742062652030000000000000604482015260640161043f565b60008490036109c55760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974207363726970742063616e6e6f7420626520656d7074790000604482015260640161043f565b60026109d2858783612110565b5060036109e0838583612110565b5060018190556040517f89ed79f38bee253aee2fb8d52df0d71b4aaf0843800d093a499a55eeca455c349061061590879087908790879087906121f9565b610a26611315565b60008054610100600160a81b0319166101006001600160a01b038481168281029390931793849055604080519290940416815260208101919091527ffbe5b6cbafb274f445d7fed869dc77a838d8243a22c460de156560e8857cad03910160405180910390a150565b6002805461079d90612087565b60058181548110610aac57600080fd5b600091825260209091200154905081565b60005461010090046001600160a01b03163314610b1c5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c6572206973206e6f7420746865206f70657261746f72000000000000604482015260640161043f565b6000610b7a610b2e6020840184612289565b610b3e60408501602086016122b3565b610b4b60408601866122dd565b610b5860608801886122dd565b610b6560808a018a6122dd565b610b7560c08c0160a08d01612289565b611383565b60008181526004602052604090205490915060ff1615610bd25760405162461bcd60e51b81526020600482015260136024820152721ddd1e125908185b1c9958591e481cdc195b9d606a1b604482015260640161043f565b60008181526004602052604090819020805460ff19166001179055610c3790610bfd908401846122dd565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cb92505050565b610c835760405162461bcd60e51b815260206004820152601d60248201527f56696e206973206e6f742070726f7065726c7920666f726d6174746564000000604482015260640161043f565b610ccd610c9360608401846122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061146f92505050565b610d195760405162461bcd60e51b815260206004820152601e60248201527f566f7574206973206e6f742070726f7065726c7920666f726d61747465640000604482015260640161043f565b6000610d65610d2b60408501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061150692505050565b91505080600114610db15760405162461bcd60e51b815260206004820152601660248201527513db9b1e481bdb99481a5b9c1d5d08185b1b1bddd95960521b604482015260640161043f565b610dfd610dc160808501856122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085925061151d915050565b610e535760405162461bcd60e51b815260206004820152602160248201527f5769746e657373206973206e6f742070726f7065726c7920666f726d617474656044820152601960fa1b606482015260840161043f565b6001603160981b01634ffd344a60e085013584610e7360c08801886122dd565b8861010001356040518663ffffffff1660e01b8152600401610e99959493929190612324565b602060405180830381865afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda9190612356565b610f265760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e206973206e6f7420696e20626c6f636b0000000000604482015260640161043f565b6000610f72610f3860808601866122dd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250611593915050565b90506000610f7f82611506565b9150506001546002610f919190612276565b8114610fd75760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964207769746e657373206974656d7360581b604482015260640161043f565b6000610fe583600154611676565b9050600060028054610ff690612087565b915060009050611007838284611840565b905061109d816002805461101a90612087565b80601f016020809104026020016040519081016040528092919081815260200182805461104690612087565b80156110935780601f1061106857610100808354040283529160200191611093565b820191906000526020600020905b81548152906001019060200180831161107657829003601f168201915b5050505050611904565b6110e25760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a590819195c1bdcda5d081cd8dc9a5c1d60521b604482015260640161043f565b60006111116110f2846014612276565b6110fd856014612276565b86516111099190612378565b869190611840565b9050611124816003805461101a90612087565b6111685760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840e6c6e4d2e0e840e6eaccccd2f605b1b604482015260640161043f565b6000611173856119db565b604080518b81526001600160a01b0383166020820152428183015290519192507f182fa52899142d44ff5c45a6354d3b3e868d5b07db6a65580b39bd321bdaf8ac919081900360600190a16000816001600160a01b0316662386f26fc1000060405160006040518083038185875af1925050503d8060008114611212576040519150601f19603f3d011682016040523d82523d6000602084013e611217565b606091505b505090508061125a5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161043f565b5050505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610843565b611298611315565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556112dc61081e565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b3361131e61081e565b6001600160a01b0316146107465760405163118cdaa760e01b815233600482015260240161043f565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561137f82611a11565b5050565b60006113bd8a8a8a8a8a8a8a8a8a6040516020016113a99998979695949392919061238b565b604051602081830303815290604052611a82565b9a9950505050505050505050565b60008060006113d984611506565b90925090508015806113ec575060001982145b156113fb575060009392505050565b6000611408836001612276565b905060005b8281101561146257855182106114295750600095945050505050565b60006114358784611aa9565b9050600019810361144d575060009695505050505050565b6114578184612276565b92505060010161140d565b5093519093149392505050565b600080600061147d84611506565b9092509050801580611490575060001982145b1561149f575060009392505050565b60006114ac836001612276565b905060005b8281101561146257855182106114cd5750600095945050505050565b60006114d98784611af2565b905060001981036114f1575060009695505050505050565b6114fb8184612276565b9250506001016114b1565b600080611514836000611b56565b91509150915091565b60008160000361152f5750600061158d565b6000805b83811015611586578451821061154e5760009250505061158d565b600061155a8684611cfa565b90506000198103611571576000935050505061158d565b61157b8184612276565b925050600101611533565b5083511490505b92915050565b606060008060005b8481101561160c576115ad8683611cfa565b925060001983036115f85760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b6116028383612276565b915060010161159b565b506116178582611cfa565b915060001982036116625760405162461bcd60e51b815260206004820152601560248201527442616420566172496e7420696e207769746e65737360581b604482015260640161043f565b61166d858284611840565b95945050505050565b606060008061168485611506565b9092509050600182016116e45760405162461bcd60e51b815260206004820152602260248201527f52656164206f76657272756e20647572696e6720566172496e742070617273696044820152616e6760f01b606482015260840161043f565b8084106117265760405162461bcd60e51b815260206004820152601060248201526f2b34b7103932b0b21037bb32b9393ab760811b604482015260640161043f565b600080611734846001612276565b905060005b868110156117bf5761174b8883611b56565b9095509250600183016117955760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b826117a1866001612276565b6117ab9190612276565b6117b59083612276565b9150600101611739565b506117ca8782611b56565b9094509150600182016118145760405162461bcd60e51b815260206004820152601260248201527142616420566172496e7420696e206974656d60701b604482015260640161043f565b611835816118228685612276565b61182d906001612276565b899190611840565b979650505050505050565b60608160000361185f57506040805160208101909152600081526118fd565b600061186b8385612276565b9050838111801561187d575080855110155b6118bf5760405162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015260640161043f565b604051915082604083010160405282825283850182038460208701018481015b808210156118f8578151838301526020820191506118df565b505050505b9392505050565b8151815160009190811461191c57600091505061158d565b60206000805b838311611952575050848101518482015160209092019180821461194d57600094505050505061158d565b611922565b600061195f602085612378565b90505b848110156119cd5786818151811061197c5761197c612260565b602001015160f81c60f81b6001600160f81b0319168882815181106119a3576119a3612260565b01602001516001600160f81b031916146119c55760009550505050505061158d565b600101611962565b506001979650505050505050565b600080600280546119eb90612087565b9150600090506119fd84836014611840565b611a06906123f4565b60601c949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60006020600083516020850160025afa50602060006020600060025afa5050600051919050565b6000806000611ab88585611d9c565b909250905060018201611ad1576000199250505061158d565b80611add836025612276565b611ae79190612276565b61166d906004612276565b6000611aff826009612276565b83511015611b10575060001961158d565b600080611b2785611b22866008612276565b611b56565b909250905060018201611b40576000199250505061158d565b80611b4c836009612276565b61166d9190612276565b6000806000611b658585611dde565b90508060ff16600003611b9a576000858581518110611b8657611b86612260565b016020015190935060f81c9150611cf39050565b83611ba6826001612447565b60ff16611bb39190612276565b85511015611bca5760001960009250925050611cf3565b60008160ff16600203611c0e57611c03611bef611be8876001612276565b8890611e64565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611ce9565b8160ff16600403611c5d57611c50611c2a611be8876001612276565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b63ffffffff169050611ce9565b8160ff16600803611ce957611cdc611c79611be8876001612276565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b6000806000611d098585611b56565b909250905060018201611d22576000199250505061158d565b600080611d30846001612276565b905060005b83811015611d9157611d4b88611b22848a612276565b909550925060018301611d67576000199550505050505061158d565b82611d73866001612276565b611d7d9190612276565b611d879083612276565b9150600101611d35565b509695505050505050565b600080611daa836025612276565b84511015611dbf575060001990506000611cf3565b600080611dd186611b22876024612276565b9097909650945050505050565b6000828281518110611df257611df2612260565b016020015160f81c60ff03611e095750600861158d565b828281518110611e1b57611e1b612260565b016020015160f81c60fe03611e325750600461158d565b828281518110611e4457611e44612260565b016020015160f81c60fd03611e5b5750600261158d565b50600092915050565b60006118fd8383016020015190565b60008083601f840112611e8557600080fd5b50813567ffffffffffffffff811115611e9d57600080fd5b602083019150836020828501011115611cf357600080fd5b600080600080600060608688031215611ecd57600080fd5b853567ffffffffffffffff811115611ee457600080fd5b611ef088828901611e73565b909650945050602086013567ffffffffffffffff811115611f1057600080fd5b611f1c88828901611e73565b96999598509660400135949350505050565b60008060208385031215611f4157600080fd5b823567ffffffffffffffff811115611f5857600080fd5b8301601f81018513611f6957600080fd5b803567ffffffffffffffff811115611f8057600080fd5b8560208260051b8401011115611f9557600080fd5b6020919091019590945092505050565b600060208284031215611fb757600080fd5b5035919050565b602081526000825180602084015260005b81811015611fec5760208186018101516040868401015201611fcf565b506000604082850101526040601f19601f83011684010191505092915050565b60006020828403121561201e57600080fd5b81356001600160a01b03811681146118fd57600080fd5b60006020828403121561204757600080fd5b813567ffffffffffffffff81111561205e57600080fd5b820161012081850312156118fd57600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061209b57607f821691505b6020821081036120bb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561210b57806000526020600020601f840160051c810160208510156120e85750805b601f840160051c820191505b8181101561210857600081556001016120f4565b50505b505050565b67ffffffffffffffff83111561212857612128612071565b61213c836121368354612087565b836120c1565b6000601f84116001811461217057600085156121585750838201355b600019600387901b1c1916600186901b178355612108565b600083815260209020601f19861690835b828110156121a15786850135825560209485019460019092019101612181565b50868210156121be5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061220d6060830187896121d0565b82810360208401526122208186886121d0565b9150508260408301529695505050505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761158d5761158d612233565b634e487b7160e01b600052603260045260246000fd5b8082018082111561158d5761158d612233565b60006020828403121561229b57600080fd5b81356001600160e01b0319811681146118fd57600080fd5b6000602082840312156122c557600080fd5b81356001600160f01b0319811681146118fd57600080fd5b6000808335601e198436030181126122f457600080fd5b83018035915067ffffffffffffffff82111561230f57600080fd5b602001915036819003821315611cf357600080fd5b8581528460208201526080604082015260006123446080830185876121d0565b90508260608301529695505050505050565b60006020828403121561236857600080fd5b815180151581146118fd57600080fd5b8181038181111561158d5761158d612233565b6001600160e01b03198a1681526001600160f01b031989166004820152868860068301376000878201600681016000815287898237506000908701600601908152848682376001600160e01b031993909316929093019182525060040198975050505050505050565b805160208201516bffffffffffffffffffffffff19811691906014821015612440576bffffffffffffffffffffffff196bffffffffffffffffffffffff198360140360031b1b82161692505b5050919050565b60ff818116838216019081111561158d5761158d61223356")), 0, HashMap::new() )); From 63e7d0e901d8a58bd70ce429ee46501824fd9776 Mon Sep 17 00:00:00 2001 From: jfldde <168934971+jfldde@users.noreply.github.com> Date: Fri, 2 Aug 2024 18:25:15 +0200 Subject: [PATCH 07/23] chore: Bitcoin RPC cleanup (#931) * Use anyhow::Result * Cleanup types * Use type inference * Cargo fmt * Cargo clippy --- crates/bitcoin-da/src/rpc.rs | 52 ++++++++++++++---------------- crates/bitcoin-da/src/service.rs | 6 ++-- crates/bitcoin-da/src/spec/utxo.rs | 2 +- 3 files changed, 28 insertions(+), 32 deletions(-) diff --git a/crates/bitcoin-da/src/rpc.rs b/crates/bitcoin-da/src/rpc.rs index d9146a44c..0269cc3eb 100644 --- a/crates/bitcoin-da/src/rpc.rs +++ b/crates/bitcoin-da/src/rpc.rs @@ -1,10 +1,11 @@ use core::fmt::{Debug, Display}; use core::str::FromStr; +use anyhow::Result; use bitcoin::block::{Header, Version}; use bitcoin::hash_types::{TxMerkleNode, WitnessMerkleNode}; use bitcoin::hashes::Hash; -use bitcoin::{merkle_tree, BlockHash, CompactTarget, Wtxid}; +use bitcoin::{merkle_tree, BlockHash, CompactTarget, Txid, Wtxid}; use reqwest::header::HeaderMap; use serde::{Deserialize, Serialize}; use serde_json::value::RawValue; @@ -44,6 +45,7 @@ pub struct BitcoinNode { url: String, client: reqwest::Client, } + impl BitcoinNode { #[instrument(level = "trace", ret)] pub fn new(url: String, username: String, password: String) -> Self { @@ -105,7 +107,7 @@ impl BitcoinNode { &self, method: &str, params: Vec, - ) -> Result { + ) -> Result { let mut attempt = 1; loop { match self.call_inner(method, ¶ms).await { @@ -130,19 +132,18 @@ impl BitcoinNode { } // get_block_count returns the current block height - pub async fn get_block_count(&self) -> Result { - self.call::("getblockcount", vec![]).await + pub async fn get_block_count(&self) -> Result { + self.call("getblockcount", vec![]).await } // get_block_hash returns the block hash of the block at the given height - pub async fn get_block_hash(&self, height: u64) -> Result { - self.call::("getblockhash", vec![to_value(height)?]) - .await + pub async fn get_block_hash(&self, height: u64) -> Result { + self.call("getblockhash", vec![to_value(height)?]).await } // get_best_blockhash returns the best blockhash of the chain - pub async fn get_best_blockhash(&self) -> Result { - self.call::("getbestblockhash", vec![]).await + pub async fn get_best_blockhash(&self) -> Result { + self.call("getbestblockhash", vec![]).await } fn calculate_witness_root(txdata: &[TransactionWrapper]) -> Option { @@ -158,16 +159,16 @@ impl BitcoinNode { } // get_block_header returns a particular block header with a given hash - pub async fn get_block_header(&self, hash: String) -> Result { + pub async fn get_block_header(&self, hash: BlockHash) -> Result { // The full block is requested here because txs_commitment is the witness root let full_block = self.get_block(hash).await?; Ok(full_block.header) } // get_block returns the block at the given hash - pub async fn get_block(&self, hash: String) -> Result { + pub async fn get_block(&self, hash: BlockHash) -> Result { let result = self - .call::>("getblock", vec![to_value(hash.clone())?, to_value(3)?]) + .call::>("getblock", vec![to_value(hash)?, to_value(3)?]) .await? .to_string(); @@ -209,9 +210,9 @@ impl BitcoinNode { } // get_utxos returns all unspent transaction outputs for the wallets of bitcoind - pub async fn get_utxos(&self) -> Result, anyhow::Error> { + pub async fn get_utxos(&self) -> Result> { let utxos = self - .call::>("listunspent", vec![to_value(0)?, to_value(9999999)?]) + .call("listunspent", vec![to_value(0)?, to_value(9999999)?]) .await?; Ok(utxos) @@ -219,7 +220,7 @@ impl BitcoinNode { // estimate_smart_fee estimates the fee to confirm a transaction in the next block #[instrument(level = "trace", skip(self), err, ret)] - pub async fn estimate_smart_fee(&self) -> Result { + pub async fn estimate_smart_fee(&self) -> Result { let result = self .call::>("estimatesmartfee", vec![to_value(1)?]) .await? @@ -239,10 +240,7 @@ impl BitcoinNode { } // sign_raw_transaction_with_wallet signs a raw transaction with the wallet of bitcoind - pub async fn sign_raw_transaction_with_wallet( - &self, - tx: String, - ) -> Result { + pub async fn sign_raw_transaction_with_wallet(&self, tx: String) -> Result { let result = self .call::>("signrawtransactionwithwallet", vec![to_value(tx)?]) .await? @@ -254,12 +252,11 @@ impl BitcoinNode { } // send_raw_transaction sends a raw transaction to the network - pub async fn send_raw_transaction(&self, tx: String) -> Result { - self.call::("sendrawtransaction", vec![to_value(tx)?]) - .await + pub async fn send_raw_transaction(&self, tx: String) -> Result { + self.call("sendrawtransaction", vec![to_value(tx)?]).await } - pub async fn list_wallets(&self) -> Result, anyhow::Error> { + pub async fn list_wallets(&self) -> Result> { let res = self.call::>("listwallets", vec![]).await; match res { Ok(wallets) => Ok(wallets), @@ -268,17 +265,16 @@ impl BitcoinNode { } /// Get unconfirmed utxos - pub async fn get_pending_utxos(&self) -> Result, anyhow::Error> { + pub async fn get_pending_utxos(&self) -> Result> { let utxos = self - .call::>("listunspent", vec![to_value(0)?, to_value(0)?]) + .call("listunspent", vec![to_value(0)?, to_value(0)?]) .await?; Ok(utxos) } /// Get a raw transaction by its txid - pub async fn get_raw_transaction(&self, txid: String) -> Result { - self.call::("getrawtransaction", vec![to_value(txid)?]) - .await + pub async fn get_raw_transaction(&self, txid: Txid) -> Result { + self.call("getrawtransaction", vec![to_value(txid)?]).await } } diff --git a/crates/bitcoin-da/src/service.rs b/crates/bitcoin-da/src/service.rs index 0a0dd0d12..e0d1cc556 100644 --- a/crates/bitcoin-da/src/service.rs +++ b/crates/bitcoin-da/src/service.rs @@ -237,7 +237,7 @@ impl BitcoinService { let mut scanned_txids = HashSet::new(); for utxo in pending_utxos.iter() { - let txid = utxo.txid.clone(); + let txid = utxo.txid; // Check if tx is already in the pending transactions vector if scanned_txids.contains(&txid) { continue; @@ -245,7 +245,7 @@ impl BitcoinService { let raw_tx = self .client - .get_raw_transaction(txid.clone()) + .get_raw_transaction(txid) .await .expect("Transaction should exist with existing utxo"); let parsed_tx = parse_hex_transaction(&raw_tx).expect("Rpc tx should be parsable"); @@ -555,7 +555,7 @@ impl DaService for BitcoinService { let hash = BlockHash::from_byte_array(hash); - let block = self.client.get_block(hash.to_string()).await?; + let block = self.client.get_block(hash).await?; Ok(block) } diff --git a/crates/bitcoin-da/src/spec/utxo.rs b/crates/bitcoin-da/src/spec/utxo.rs index a091f2861..c12442e67 100644 --- a/crates/bitcoin-da/src/spec/utxo.rs +++ b/crates/bitcoin-da/src/spec/utxo.rs @@ -49,7 +49,7 @@ impl<'de> serde::Deserialize<'de> for UTXO { #[derive(Debug, Serialize, Deserialize)] pub struct ListUnspentEntry { - pub txid: String, + pub txid: Txid, pub vout: u64, pub address: String, pub label: Option, From 3d90b3e2c69e3dd19ba3ca55d986dc7d285b265c Mon Sep 17 00:00:00 2001 From: joao <22820692+joaolago1113@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:41:07 +0100 Subject: [PATCH 08/23] chore: fix Citrea STF README (#944) * 404 link * 404 link * links * fix --- crates/citrea-stf/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/citrea-stf/README.md b/crates/citrea-stf/README.md index 854c58ada..681a360b3 100644 --- a/crates/citrea-stf/README.md +++ b/crates/citrea-stf/README.md @@ -3,9 +3,9 @@ This is the State Transition Function crate for the Citrea rollup. The Citrea State Transition Function consists of 3 modules: -- [EVM](../../evm/README.md): Used for handling EVM functionality. -- [sov-accounts](../../../sovereign-sdk/module-system/module-implementations/sov-accounts/README.md): Used for checking the sequencer's nonce. -- [Soft Confirmation Rule Enforcer](../../soft-confirmation-rule-enforcer/README.md): Used for enforcing Citrea's soft confirmation rules. +- [EVM](../evm/README.md): Used for handling EVM functionality. +- [sov-accounts](../sovereign-sdk/module-system/module-implementations/sov-accounts/README.md): Used for checking the sequencer's nonce. +- [Soft Confirmation Rule Enforcer](../soft-confirmation-rule-enforcer/README.md): Used for enforcing Citrea's soft confirmation rules.. Through applying transaction/blob/soft confirmation hooks (see [`hooks_impl.rs`](./src/hooks_impl.rs)), it runs the rollup via the [`Runtime`](./src/runtime.rs). From 816bfaa032063b63781829b6a1ca5e8d86c6cb99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Yaz=C4=B1c=C4=B1?= <75089142+yaziciahmet@users.noreply.github.com> Date: Mon, 5 Aug 2024 15:22:55 +0200 Subject: [PATCH 09/23] RISC0 guest read optimization (#943) * Replace Vec allocation with stdin reader * Open risc0 guest logging * Pleasing linter gods * Remove 0-alignment * Comment cycle print * Update bonsai upload * Use extend --- bin/citrea/src/lib.rs | 1 + crates/risc0-bonsai/src/host.rs | 46 ++++--------------- .../adapters/risc0/src/guest/native.rs | 28 ++++------- .../adapters/risc0/src/guest/zkvm.rs | 12 ++--- .../sovereign-sdk/adapters/risc0/src/host.rs | 17 ++----- 5 files changed, 25 insertions(+), 79 deletions(-) diff --git a/bin/citrea/src/lib.rs b/bin/citrea/src/lib.rs index 7c0f4e2ea..9779625a7 100644 --- a/bin/citrea/src/lib.rs +++ b/bin/citrea/src/lib.rs @@ -22,6 +22,7 @@ pub fn initialize_logging(level: Level) { "hyper=info".to_owned(), "alloy_transport_http=info".to_owned(), // Limit output as much as possible, use WARN. + "[executor]=info".to_owned(), // risc0 guest code stats logging "risc0_zkvm=warn".to_owned(), "risc0_circuit_rv32im=info".to_owned(), "guest_execution=info".to_owned(), diff --git a/crates/risc0-bonsai/src/host.rs b/crates/risc0-bonsai/src/host.rs index ac260dfab..8e6fd561c 100644 --- a/crates/risc0-bonsai/src/host.rs +++ b/crates/risc0-bonsai/src/host.rs @@ -287,7 +287,7 @@ impl BonsaiClient { #[derive(Clone)] pub struct Risc0BonsaiHost<'a> { elf: &'a [u8], - env: Vec, + env: Vec, image_id: Digest, client: Option, last_input_id: Option, @@ -325,28 +325,13 @@ impl<'a> Risc0BonsaiHost<'a> { } } - fn add_hint_bonsai(&mut self, item: T) { - // For running in "prove" mode. - - // Prepare input data and upload it. - let client = self.client.as_ref().unwrap(); - - let mut input_data = vec![]; - let mut buf = borsh::to_vec(&item).unwrap(); - // append [0..] alignment - let rem = buf.len() % 4; - if rem > 0 { - buf.extend(vec![0; 4 - rem]); - } - let buf_u32: &[u32] = bytemuck::cast_slice(&buf); - // write len(u64) in LE - let len = buf_u32.len() as u64; - input_data.extend(len.to_le_bytes()); - // write buf - input_data.extend(buf); - + fn upload_to_bonsai(&mut self, buf: Vec) { // handle error - let input_id = client.upload_input(input_data); + let input_id = self + .client + .as_ref() + .expect("Bonsai client is not initialized") + .upload_input(buf); tracing::info!("Uploaded input with id: {}", input_id); self.last_input_id = Some(input_id); } @@ -358,23 +343,12 @@ impl<'a> ZkvmHost for Risc0BonsaiHost<'a> { fn add_hint(&mut self, item: T) { // For running in "execute" mode. - let mut buf = borsh::to_vec(&item).expect("Risc0 hint serialization is infallible"); - // append [0..] alignment to cast &[u8] to &[u32] - let rem = buf.len() % 4; - if rem > 0 { - buf.extend(vec![0; 4 - rem]); - } - let buf: &[u32] = bytemuck::cast_slice(&buf); - // write len(u64) in LE - let len = buf.len() as u64; - let len_buf = &len.to_le_bytes()[..]; - let len_buf: &[u32] = bytemuck::cast_slice(len_buf); - self.env.extend_from_slice(len_buf); + let buf = borsh::to_vec(&item).expect("Risc0 hint serialization is infallible"); // write buf - self.env.extend_from_slice(buf); + self.env.extend_from_slice(&buf); if self.client.is_some() { - self.add_hint_bonsai(item) + self.upload_to_bonsai(buf); } } diff --git a/crates/sovereign-sdk/adapters/risc0/src/guest/native.rs b/crates/sovereign-sdk/adapters/risc0/src/guest/native.rs index 822f1e503..68457b497 100644 --- a/crates/sovereign-sdk/adapters/risc0/src/guest/native.rs +++ b/crates/sovereign-sdk/adapters/risc0/src/guest/native.rs @@ -1,19 +1,19 @@ //! This module implements the `ZkvmGuest` trait for the RISC0 VM. +use std::io::Cursor; + use borsh::{BorshDeserialize, BorshSerialize}; use sov_rollup_interface::zk::ZkvmGuest; #[derive(Default)] struct Hints { - values: Vec, - position: usize, + cursor: Cursor>, } impl Hints { - pub fn with_hints(hints: Vec) -> Self { + pub fn with_hints(hints: Vec) -> Self { Hints { - values: hints, - position: 0, + cursor: Cursor::new(hints), } } } @@ -33,7 +33,7 @@ impl Risc0Guest { } /// Constructs a new Risc0 Guest with the provided hints. - pub fn with_hints(hints: Vec) -> Self { + pub fn with_hints(hints: Vec) -> Self { Self { hints: std::sync::Mutex::new(Hints::with_hints(hints)), // commits: Default::default(), @@ -44,21 +44,9 @@ impl Risc0Guest { impl ZkvmGuest for Risc0Guest { fn read_from_host(&self) -> T { let mut hints = self.hints.lock().unwrap(); - let hints = &mut *hints; - let pos = &mut hints.position; - let env = &hints.values; - // read len(u64) in LE - let len_buf = &env[*pos..*pos + 2]; - let len_bytes = bytemuck::cast_slice(len_buf); - let len_bytes: [u8; 8] = len_bytes.try_into().expect("Exactly 4 bytes"); - let len = u64::from_le_bytes(len_bytes) as usize; - *pos += 2; - // read buf - let buf = &env[*pos..*pos + len]; - let buf: &[u8] = bytemuck::cast_slice(buf); - *pos += len; + let cursor = &mut hints.cursor; // deserialize - BorshDeserialize::deserialize(&mut &*buf).unwrap() + BorshDeserialize::deserialize_reader(&mut *cursor).unwrap() } fn commit(&self, _item: &T) { diff --git a/crates/sovereign-sdk/adapters/risc0/src/guest/zkvm.rs b/crates/sovereign-sdk/adapters/risc0/src/guest/zkvm.rs index cd718d200..4879c9b72 100644 --- a/crates/sovereign-sdk/adapters/risc0/src/guest/zkvm.rs +++ b/crates/sovereign-sdk/adapters/risc0/src/guest/zkvm.rs @@ -18,16 +18,10 @@ impl Risc0Guest { impl ZkvmGuest for Risc0Guest { fn read_from_host(&self) -> T { - // read len(u64) in LE - let mut len_buf = [0u8; 8]; - env::read_slice(&mut len_buf); - let len = u64::from_le_bytes(len_buf); - // read buf - let mut buf: Vec = vec![0; len as usize]; - env::read_slice(&mut buf); - let slice: &[u8] = bytemuck::cast_slice(&buf); + let mut reader = env::stdin(); // deserialize - BorshDeserialize::deserialize(&mut &*slice).expect("Failed to deserialize input from host") + BorshDeserialize::deserialize_reader(&mut reader) + .expect("Failed to deserialize input from host") } fn commit(&self, item: &T) { diff --git a/crates/sovereign-sdk/adapters/risc0/src/host.rs b/crates/sovereign-sdk/adapters/risc0/src/host.rs index 2a0edbee4..a1312eaaa 100644 --- a/crates/sovereign-sdk/adapters/risc0/src/host.rs +++ b/crates/sovereign-sdk/adapters/risc0/src/host.rs @@ -13,7 +13,7 @@ use crate::Risc0MethodId; /// provided to its execution. #[derive(Clone)] pub struct Risc0Host<'a> { - env: Vec, + env: Vec, elf: &'a [u8], } @@ -71,20 +71,9 @@ impl<'a> ZkvmHost for Risc0Host<'a> { type Guest = Risc0Guest; fn add_hint(&mut self, item: T) { - let mut buf = borsh::to_vec(&item).expect("Risc0 hint serialization is infallible"); - // append [0..] alignment to cast &[u8] to &[u32] - let rem = buf.len() % 4; - if rem > 0 { - buf.extend(vec![0; 4 - rem]); - } - let buf: &[u32] = bytemuck::cast_slice(&buf); - // write len(u64) in LE - let len = buf.len() as u64; - let len_buf = &len.to_le_bytes()[..]; - let len_buf: &[u32] = bytemuck::cast_slice(len_buf); - self.env.extend_from_slice(len_buf); + let buf = borsh::to_vec(&item).expect("Risc0 hint serialization is infallible"); // write buf - self.env.extend_from_slice(buf); + self.env.extend(buf); } fn simulate_with_hints(&mut self) -> Self::Guest { From 374c7e7d432615a6f439e62a02406ddafcd5440f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Yaz=C4=B1c=C4=B1?= <75089142+yaziciahmet@users.noreply.github.com> Date: Mon, 5 Aug 2024 20:33:59 +0200 Subject: [PATCH 10/23] Use borsh deser (#949) --- crates/risc0-bonsai/src/host.rs | 11 ++++------- .../sovereign-sdk/adapters/mock-zkvm/src/lib.rs | 12 +++--------- .../adapters/risc0/src/guest/mod.rs | 8 ++------ crates/sovereign-sdk/adapters/risc0/src/host.rs | 16 ++++------------ .../rollup-interface/src/state_machine/zk/mod.rs | 2 +- 5 files changed, 14 insertions(+), 35 deletions(-) diff --git a/crates/risc0-bonsai/src/host.rs b/crates/risc0-bonsai/src/host.rs index 8e6fd561c..ae83086f1 100644 --- a/crates/risc0-bonsai/src/host.rs +++ b/crates/risc0-bonsai/src/host.rs @@ -12,8 +12,6 @@ use risc0_zkvm::{ compute_image_id, ExecutorEnvBuilder, ExecutorImpl, Groth16Receipt, InnerReceipt, Journal, Receipt, }; -use serde::de::DeserializeOwned; -use serde::Serialize; use sov_risc0_adapter::guest::Risc0Guest; use sov_rollup_interface::zk::{Proof, Zkvm, ZkvmHost}; use tracing::{debug, error, instrument, trace, warn}; @@ -511,10 +509,7 @@ impl<'host> Zkvm for Risc0BonsaiHost<'host> { unimplemented!(); } - fn verify_and_extract_output< - Da: sov_rollup_interface::da::DaSpec, - Root: Serialize + DeserializeOwned, - >( + fn verify_and_extract_output( serialized_proof: &[u8], code_commitment: &Self::CodeCommitment, ) -> Result, Self::Error> { @@ -523,6 +518,8 @@ impl<'host> Zkvm for Risc0BonsaiHost<'host> { #[allow(clippy::clone_on_copy)] receipt.verify(code_commitment.clone())?; - Ok(receipt.journal.decode()?) + Ok(BorshDeserialize::deserialize( + &mut receipt.journal.bytes.as_slice(), + )?) } } diff --git a/crates/sovereign-sdk/adapters/mock-zkvm/src/lib.rs b/crates/sovereign-sdk/adapters/mock-zkvm/src/lib.rs index 770ed8199..847275814 100644 --- a/crates/sovereign-sdk/adapters/mock-zkvm/src/lib.rs +++ b/crates/sovereign-sdk/adapters/mock-zkvm/src/lib.rs @@ -135,15 +135,12 @@ impl sov_rollup_interface::zk::Zkvm for MockZkv Ok(&serialized_proof[33..]) } - fn verify_and_extract_output< - Da: sov_rollup_interface::da::DaSpec, - Root: serde::Serialize + serde::de::DeserializeOwned, - >( + fn verify_and_extract_output( serialized_proof: &[u8], code_commitment: &Self::CodeCommitment, ) -> Result, Self::Error> { let output = Self::verify(serialized_proof, code_commitment)?; - Ok(bincode::deserialize(output)?) + Ok(BorshDeserialize::deserialize(&mut &*output)?) } } @@ -216,10 +213,7 @@ impl sov_rollup_interface::zk::Zkvm for MockZkGuest { unimplemented!() } - fn verify_and_extract_output< - Da: sov_rollup_interface::da::DaSpec, - Root: Serialize + serde::de::DeserializeOwned, - >( + fn verify_and_extract_output( _serialized_proof: &[u8], _code_commitment: &Self::CodeCommitment, ) -> Result, Self::Error> { diff --git a/crates/sovereign-sdk/adapters/risc0/src/guest/mod.rs b/crates/sovereign-sdk/adapters/risc0/src/guest/mod.rs index caddcca4e..28e9e71b4 100644 --- a/crates/sovereign-sdk/adapters/risc0/src/guest/mod.rs +++ b/crates/sovereign-sdk/adapters/risc0/src/guest/mod.rs @@ -3,8 +3,7 @@ //! for host(native) and guest(zkvm) part. //! The host implementation is used for tests only and brings no real value. -use serde::de::DeserializeOwned; -use serde::Serialize; +use borsh::BorshDeserialize; use sov_rollup_interface::zk::Zkvm; use crate::Risc0MethodId; @@ -37,10 +36,7 @@ impl Zkvm for Risc0Guest { todo!("Implement once risc0 supports recursion: https://github.com/Sovereign-Labs/sovereign-sdk/issues/633") } - fn verify_and_extract_output< - Da: sov_rollup_interface::da::DaSpec, - Root: Serialize + DeserializeOwned, - >( + fn verify_and_extract_output( _serialized_proof: &[u8], _code_commitment: &Self::CodeCommitment, ) -> Result, Self::Error> { diff --git a/crates/sovereign-sdk/adapters/risc0/src/host.rs b/crates/sovereign-sdk/adapters/risc0/src/host.rs index a1312eaaa..4c2e3e922 100644 --- a/crates/sovereign-sdk/adapters/risc0/src/host.rs +++ b/crates/sovereign-sdk/adapters/risc0/src/host.rs @@ -2,8 +2,6 @@ use borsh::{BorshDeserialize, BorshSerialize}; use risc0_zkvm::{ExecutorEnvBuilder, ExecutorImpl, InnerReceipt, Journal, Receipt, Session}; -use serde::de::DeserializeOwned; -use serde::Serialize; use sov_rollup_interface::zk::{Proof, Zkvm, ZkvmHost}; use crate::guest::Risc0Guest; @@ -121,15 +119,12 @@ impl<'host> Zkvm for Risc0Host<'host> { verify_from_slice(serialized_proof, code_commitment) } - fn verify_and_extract_output< - Da: sov_rollup_interface::da::DaSpec, - Root: Serialize + DeserializeOwned, - >( + fn verify_and_extract_output( serialized_proof: &[u8], code_commitment: &Self::CodeCommitment, ) -> Result, Self::Error> { let output = Self::verify(serialized_proof, code_commitment)?; - Ok(risc0_zkvm::serde::from_slice(output)?) + Ok(BorshDeserialize::deserialize(&mut &*output)?) } } @@ -148,15 +143,12 @@ impl Zkvm for Risc0Verifier { verify_from_slice(serialized_proof, code_commitment) } - fn verify_and_extract_output< - Da: sov_rollup_interface::da::DaSpec, - Root: Serialize + DeserializeOwned, - >( + fn verify_and_extract_output( serialized_proof: &[u8], code_commitment: &Self::CodeCommitment, ) -> Result, Self::Error> { let output = Self::verify(serialized_proof, code_commitment)?; - Ok(risc0_zkvm::serde::from_slice(output)?) + Ok(BorshDeserialize::deserialize(&mut &*output)?) } } diff --git a/crates/sovereign-sdk/rollup-interface/src/state_machine/zk/mod.rs b/crates/sovereign-sdk/rollup-interface/src/state_machine/zk/mod.rs index 50d38d8d8..3e085a5a5 100644 --- a/crates/sovereign-sdk/rollup-interface/src/state_machine/zk/mod.rs +++ b/crates/sovereign-sdk/rollup-interface/src/state_machine/zk/mod.rs @@ -75,7 +75,7 @@ pub trait Zkvm: Send + Sync { /// Same as [`verify`](Zkvm::verify), except that instead of returning the output /// as a serialized array, it returns a state transition structure. /// TODO: specify a deserializer for the output - fn verify_and_extract_output( + fn verify_and_extract_output( serialized_proof: &[u8], code_commitment: &Self::CodeCommitment, ) -> Result, Self::Error>; From 589f650dfa9176491137870c07fe5c42d4325281 Mon Sep 17 00:00:00 2001 From: jfldde <168934971+jfldde@users.noreply.github.com> Date: Tue, 6 Aug 2024 10:20:37 +0200 Subject: [PATCH 11/23] Use bitcoincore-rpc client in BitcoinService (#942) * Extract background task out of service creation * Use bitcoin::Network directly * Remove Clone bound on DaService * Use bitconcore-rpc client instead of BitcoinNode * Fix lint * Format Cargo.toml * Remove unused base64 dep * Rename to spawn_da_queue * Use single get_fee_rate_as_sat_vb_ceiled method --- Cargo.lock | 49 ++- Cargo.toml | 3 +- .../provers/risc0/guest-bitcoin/Cargo.lock | 37 ++- bin/citrea/src/eth.rs | 3 +- bin/citrea/src/lib.rs | 1 - bin/citrea/src/rollup/bitcoin.rs | 37 ++- bin/citrea/src/rollup/mock.rs | 13 +- bin/citrea/src/rollup/mod.rs | 6 +- crates/bitcoin-da/Cargo.toml | 5 +- crates/bitcoin-da/src/helpers/builders.rs | 36 ++- crates/bitcoin-da/src/helpers/parsers.rs | 2 +- crates/bitcoin-da/src/lib.rs | 2 - crates/bitcoin-da/src/rpc.rs | 280 ------------------ crates/bitcoin-da/src/service.rs | 240 ++++++++++----- crates/bitcoin-da/src/spec/utxo.rs | 51 ++-- crates/ethereum-rpc/src/ethereum.rs | 6 +- crates/ethereum-rpc/src/lib.rs | 4 +- crates/fullnode/src/runner.rs | 8 +- .../tests/runner_initialization_tests.rs | 4 +- crates/fullnode/tests/runner_reorg_tests.rs | 8 +- crates/primitives/src/da.rs | 2 +- .../prover/src/prover_service/parallel/mod.rs | 2 +- crates/prover/src/runner.rs | 10 +- crates/prover/tests/prover_tests.rs | 5 +- crates/sequencer/src/sequencer.rs | 17 +- .../adapters/mock-da/src/service.rs | 6 +- .../sov-stf-runner/src/prover_service/mod.rs | 4 +- .../sov-modules-rollup-blueprint/src/lib.rs | 10 +- .../src/runtime_rpc.rs | 2 +- .../rollup-interface/src/node/services/da.rs | 8 +- .../utils/rng-da-service/src/lib.rs | 6 +- 31 files changed, 394 insertions(+), 473 deletions(-) delete mode 100644 crates/bitcoin-da/src/rpc.rs diff --git a/Cargo.lock b/Cargo.lock index 638328d70..2a1130adf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1099,6 +1099,15 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64-compat" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a8d4d2746f89841e49230dd26917df1876050f95abafafbe34f47cb534b88d7" +dependencies = [ + "byteorder", +] + [[package]] name = "base64ct" version = "1.6.0" @@ -1217,15 +1226,14 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "base64 0.13.1", "bitcoin", + "bitcoincore-rpc", "borsh", "brotli", "futures", "hex", "pin-project", "rand 0.8.5", - "reqwest 0.12.4", "serde", "serde_json", "sov-rollup-interface", @@ -1254,6 +1262,29 @@ dependencies = [ "serde", ] +[[package]] +name = "bitcoincore-rpc" +version = "0.18.0" +source = "git+https://github.com/jfldde/rust-bitcoincore-rpc.git#c60839cebb61d1a98b7dc652c7cc57f04e3c2600" +dependencies = [ + "async-trait", + "bitcoincore-rpc-json", + "jsonrpc-async", + "log", + "serde", + "serde_json", +] + +[[package]] +name = "bitcoincore-rpc-json" +version = "0.18.0" +source = "git+https://github.com/jfldde/rust-bitcoincore-rpc.git#c60839cebb61d1a98b7dc652c7cc57f04e3c2600" +dependencies = [ + "bitcoin", + "serde", + "serde_json", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -4367,6 +4398,20 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonrpc-async" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a20e8e4ed08ee58717113cbf277b1ecef5cd9554d3e48c114de338289727d466" +dependencies = [ + "async-trait", + "base64-compat", + "serde", + "serde_derive", + "serde_json", + "tokio", +] + [[package]] name = "jsonrpsee" version = "0.22.5" diff --git a/Cargo.toml b/Cargo.toml index 10cdfe740..3bce074d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,12 +72,12 @@ async-trait = "0.1.71" anyhow = { version = "1.0.68", default-features = false } arbitrary = { version = "1.3.1", features = ["derive"] } backoff = { version = "0.4.0", features = ["futures", "tokio"] } -base64 = "0.13" borsh = { version = "1.5", default-features = false, features = ["derive"] } # TODO: Consider replacing this serialization format # https://github.com/Sovereign-Labs/sovereign-sdk/issues/283 bincode = "1.3.3" bitcoin = { version = "0.31.2", features = ["serde", "rand"] } +bitcoincore-rpc = { version = "0.18.0" } bcs = "0.1.6" brotli = "6" byteorder = { version = "1.5.0", default-features = false } @@ -178,3 +178,4 @@ sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.8 # crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag = "v0.5.5-risczero.0" } secp256k1_v028 = { package = "secp256k1", version = "0.28", git = "https://github.com/Sovereign-Labs/rust-secp256k1.git", branch = "risc0-compatible-0-28-2" } k256 = { package = "k256", version = "0.13.3", git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "k256/v0.13.3-risczero.0" } +bitcoincore-rpc = { version = "0.18.0", git = "https://github.com/jfldde/rust-bitcoincore-rpc.git" } diff --git a/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock b/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock index 5a8c88155..80d43c70a 100644 --- a/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock +++ b/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock @@ -626,8 +626,8 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "base64 0.13.1", "bitcoin", + "bitcoincore-rpc", "borsh", "brotli", "futures", @@ -659,6 +659,30 @@ dependencies = [ "serde", ] +[[package]] +name = "bitcoincore-rpc" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eb70725a621848c83b3809913d5314c0d20ca84877d99dd909504b564edab00" +dependencies = [ + "bitcoincore-rpc-json", + "jsonrpc", + "log", + "serde", + "serde_json", +] + +[[package]] +name = "bitcoincore-rpc-json" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "856ffbee2e492c23bca715d72ea34aae80d58400f2bda26a82015d6bc2ec3662" +dependencies = [ + "bitcoin", + "serde", + "serde_json", +] + [[package]] name = "bitflags" version = "2.5.0" @@ -1875,6 +1899,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonrpc" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8128f36b47411cd3f044be8c1f5cc0c9e24d1d1bfdc45f0a57897b32513053f2" +dependencies = [ + "base64 0.13.1", + "serde", + "serde_json", +] + [[package]] name = "k256" version = "0.13.3" diff --git a/bin/citrea/src/eth.rs b/bin/citrea/src/eth.rs index 289154c2b..bacbfbd36 100644 --- a/bin/citrea/src/eth.rs +++ b/bin/citrea/src/eth.rs @@ -1,4 +1,5 @@ use std::str::FromStr; +use std::sync::Arc; use anyhow::Context as _; use ethereum_rpc::{EthRpcConfig, FeeHistoryCacheConfig, GasPriceOracleConfig}; @@ -10,7 +11,7 @@ use tokio::sync::broadcast; // register ethereum methods. pub(crate) fn register_ethereum( - da_service: Da, + da_service: Arc, storage: ProverStorage, methods: &mut jsonrpsee::RpcModule<()>, sequencer_client_url: Option, diff --git a/bin/citrea/src/lib.rs b/bin/citrea/src/lib.rs index 9779625a7..b194a0796 100644 --- a/bin/citrea/src/lib.rs +++ b/bin/citrea/src/lib.rs @@ -27,7 +27,6 @@ pub fn initialize_logging(level: Level) { "risc0_circuit_rv32im=info".to_owned(), "guest_execution=info".to_owned(), "jsonrpsee-server=info".to_owned(), - "reqwest=info".to_owned(), "sov_schema_db=info".to_owned(), "sov_prover_storage_manager=info".to_owned(), // Limit output as much as possible, use WARN. diff --git a/bin/citrea/src/rollup/bitcoin.rs b/bin/citrea/src/rollup/bitcoin.rs index 0f35a67c2..080eb7e52 100644 --- a/bin/citrea/src/rollup/bitcoin.rs +++ b/bin/citrea/src/rollup/bitcoin.rs @@ -1,5 +1,7 @@ +use std::sync::Arc; + use async_trait::async_trait; -use bitcoin_da::service::{BitcoinService, DaServiceConfig}; +use bitcoin_da::service::{BitcoinService, DaServiceConfig, TxidWrapper}; use bitcoin_da::spec::{BitcoinSpec, RollupParams}; use bitcoin_da::verifier::BitcoinVerifier; use citrea_primitives::{DA_TX_ID_LEADING_ZEROS, ROLLUP_NAME}; @@ -15,10 +17,12 @@ use sov_modules_rollup_blueprint::RollupBlueprint; use sov_modules_stf_blueprint::StfBlueprint; use sov_prover_storage_manager::ProverStorageManager; use sov_rollup_interface::da::DaVerifier; +use sov_rollup_interface::services::da::BlobWithNotifier; use sov_rollup_interface::zk::{Zkvm, ZkvmHost}; use sov_state::{DefaultStorageSpec, Storage, ZkStorage}; use sov_stf_runner::{FullNodeConfig, ProverConfig}; use tokio::sync::broadcast; +use tokio::sync::mpsc::unbounded_channel; use tracing::instrument; use crate::CitreaRollupBlueprint; @@ -60,7 +64,7 @@ impl RollupBlueprint for BitcoinRollup { &self, storage: &::Storage, ledger_db: &LedgerDB, - da_service: &Self::DaService, + da_service: &Arc, sequencer_client_url: Option, soft_confirmation_rx: Option>, ) -> Result, anyhow::Error> { @@ -105,15 +109,24 @@ impl RollupBlueprint for BitcoinRollup { async fn create_da_service( &self, rollup_config: &FullNodeConfig, - ) -> Self::DaService { - BitcoinService::new( - rollup_config.da.clone(), - RollupParams { - rollup_name: ROLLUP_NAME.to_string(), - reveal_tx_id_prefix: DA_TX_ID_LEADING_ZEROS.to_vec(), - }, - ) - .await + ) -> Result, anyhow::Error> { + let (tx, rx) = unbounded_channel::>(); + + let service = Arc::new( + BitcoinService::new( + rollup_config.da.clone(), + RollupParams { + rollup_name: ROLLUP_NAME.to_string(), + reveal_tx_id_prefix: DA_TX_ID_LEADING_ZEROS.to_vec(), + }, + tx, + ) + .await?, + ); + + Arc::clone(&service).spawn_da_queue(rx); + + Ok(service) } #[instrument(level = "trace", skip_all)] @@ -121,7 +134,7 @@ impl RollupBlueprint for BitcoinRollup { &self, prover_config: ProverConfig, _rollup_config: &FullNodeConfig, - _da_service: &Self::DaService, + _da_service: &Arc, ) -> Self::ProverService { let vm = Risc0BonsaiHost::new( citrea_risc0::BITCOIN_DA_ELF, diff --git a/bin/citrea/src/rollup/mock.rs b/bin/citrea/src/rollup/mock.rs index 463f81805..2ae87456f 100644 --- a/bin/citrea/src/rollup/mock.rs +++ b/bin/citrea/src/rollup/mock.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + use async_trait::async_trait; use citrea_prover::prover_service::ParallelProverService; use citrea_risc0_bonsai_adapter::host::Risc0BonsaiHost; @@ -54,7 +56,7 @@ impl RollupBlueprint for MockDemoRollup { &self, storage: &::Storage, ledger_db: &LedgerDB, - da_service: &Self::DaService, + da_service: &Arc, sequencer_client_url: Option, soft_confirmation_rx: Option>, ) -> Result, anyhow::Error> { @@ -86,15 +88,18 @@ impl RollupBlueprint for MockDemoRollup { async fn create_da_service( &self, rollup_config: &FullNodeConfig, - ) -> Self::DaService { - MockDaService::new(rollup_config.da.sender_address, &rollup_config.da.db_path) + ) -> Result, anyhow::Error> { + Ok(Arc::new(MockDaService::new( + rollup_config.da.sender_address, + &rollup_config.da.db_path, + ))) } async fn create_prover_service( &self, prover_config: ProverConfig, _rollup_config: &FullNodeConfig, - _da_service: &Self::DaService, + _da_service: &Arc, ) -> Self::ProverService { let vm = Risc0BonsaiHost::new( citrea_risc0::MOCK_DA_ELF, diff --git a/bin/citrea/src/rollup/mod.rs b/bin/citrea/src/rollup/mod.rs index 8e9d3b6b6..d513ea322 100644 --- a/bin/citrea/src/rollup/mod.rs +++ b/bin/citrea/src/rollup/mod.rs @@ -33,7 +33,7 @@ pub trait CitreaRollupBlueprint: RollupBlueprint { where ::Storage: NativeStorage, { - let da_service = self.create_da_service(&rollup_config).await; + let da_service = self.create_da_service(&rollup_config).await?; // TODO: Double check what kind of storage needed here. // Maybe whole "prev_root" can be initialized inside runner @@ -112,7 +112,7 @@ pub trait CitreaRollupBlueprint: RollupBlueprint { where ::Storage: NativeStorage, { - let da_service = self.create_da_service(&rollup_config).await; + let da_service = self.create_da_service(&rollup_config).await?; // TODO: Double check what kind of storage needed here. // Maybe whole "prev_root" can be initialized inside runner @@ -195,7 +195,7 @@ pub trait CitreaRollupBlueprint: RollupBlueprint { where ::Storage: NativeStorage, { - let da_service = self.create_da_service(&rollup_config).await; + let da_service = self.create_da_service(&rollup_config).await?; let prover_service = self .create_prover_service(prover_config.clone(), &rollup_config, &da_service) diff --git a/crates/bitcoin-da/Cargo.toml b/crates/bitcoin-da/Cargo.toml index fc39a2d24..81a041ad5 100644 --- a/crates/bitcoin-da/Cargo.toml +++ b/crates/bitcoin-da/Cargo.toml @@ -18,12 +18,10 @@ tokio = { workspace = true, features = ["full"], optional = true } anyhow = { workspace = true } async-trait = { workspace = true } -base64 = { workspace = true } borsh = { workspace = true } hex = { workspace = true, features = ["serde"] } pin-project = { workspace = true, optional = true, features = [] } rand = { workspace = true } -reqwest = { workspace = true, optional = true } serde = { workspace = true } serde_json = { workspace = true, features = ["raw_value"] } thiserror = { workspace = true } @@ -33,11 +31,12 @@ bitcoin = { workspace = true } brotli = { workspace = true } futures.workspace = true +bitcoincore-rpc.workspace = true + [features] default = [] native = [ "dep:tokio", - "dep:reqwest", "dep:pin-project", "dep:tracing", "sov-rollup-interface/native", diff --git a/crates/bitcoin-da/src/helpers/builders.rs b/crates/bitcoin-da/src/helpers/builders.rs index 53248ab1f..d013e7784 100644 --- a/crates/bitcoin-da/src/helpers/builders.rs +++ b/crates/bitcoin-da/src/helpers/builders.rs @@ -162,7 +162,7 @@ fn build_commit_transaction( tx_id: tx.id, vout: 0, script_pubkey: tx.tx.output[0].script_pubkey.to_hex_string(), - address: "ANY".into(), + address: None, amount: tx.tx.output[0].value.to_sat(), confirmations: 0, spendable: true, @@ -592,8 +592,12 @@ mod tests { ) .unwrap(), vout: 0, - address: "bc1pp8qru0ve43rw9xffmdd8pvveths3cx6a5t6mcr0xfn9cpxx2k24qf70xq9" - .to_string(), + address: Some( + Address::from_str( + "bc1pp8qru0ve43rw9xffmdd8pvveths3cx6a5t6mcr0xfn9cpxx2k24qf70xq9", + ) + .unwrap(), + ), script_pubkey: address.script_pubkey().to_hex_string(), amount: 1_000_000, confirmations: 100, @@ -606,8 +610,12 @@ mod tests { ) .unwrap(), vout: 0, - address: "bc1pp8qru0ve43rw9xffmdd8pvveths3cx6a5t6mcr0xfn9cpxx2k24qf70xq9" - .to_string(), + address: Some( + Address::from_str( + "bc1pp8qru0ve43rw9xffmdd8pvveths3cx6a5t6mcr0xfn9cpxx2k24qf70xq9", + ) + .unwrap(), + ), script_pubkey: address.script_pubkey().to_hex_string(), amount: 100_000, confirmations: 100, @@ -620,8 +628,12 @@ mod tests { ) .unwrap(), vout: 0, - address: "bc1pp8qru0ve43rw9xffmdd8pvveths3cx6a5t6mcr0xfn9cpxx2k24qf70xq9" - .to_string(), + address: Some( + Address::from_str( + "bc1pp8qru0ve43rw9xffmdd8pvveths3cx6a5t6mcr0xfn9cpxx2k24qf70xq9", + ) + .unwrap(), + ), script_pubkey: address.script_pubkey().to_hex_string(), amount: 10_000, confirmations: 100, @@ -827,7 +839,7 @@ mod tests { tx_id: prev_tx_id, vout: i as u32, script_pubkey: o.script_pubkey.to_hex_string(), - address: "ANY".into(), + address: None, confirmations: 0, amount: o.value.to_sat(), spendable: true, @@ -872,8 +884,12 @@ mod tests { ) .unwrap(), vout: 0, - address: "bc1pp8qru0ve43rw9xffmdd8pvveths3cx6a5t6mcr0xfn9cpxx2k24qf70xq9" - .to_string(), + address: Some( + Address::from_str( + "bc1pp8qru0ve43rw9xffmdd8pvveths3cx6a5t6mcr0xfn9cpxx2k24qf70xq9", + ) + .unwrap(), + ), script_pubkey: address.script_pubkey().to_hex_string(), amount: 152, confirmations: 100, diff --git a/crates/bitcoin-da/src/helpers/parsers.rs b/crates/bitcoin-da/src/helpers/parsers.rs index 0c50652c7..58f13b306 100644 --- a/crates/bitcoin-da/src/helpers/parsers.rs +++ b/crates/bitcoin-da/src/helpers/parsers.rs @@ -183,7 +183,7 @@ fn parse_relevant_inscriptions( }) } -#[cfg(any(feature = "native", test))] +#[cfg(test)] pub fn parse_hex_transaction( tx_hex: &str, ) -> Result { diff --git a/crates/bitcoin-da/src/lib.rs b/crates/bitcoin-da/src/lib.rs index 8a8925431..1d658af60 100644 --- a/crates/bitcoin-da/src/lib.rs +++ b/crates/bitcoin-da/src/lib.rs @@ -1,6 +1,4 @@ mod helpers; -#[cfg(feature = "native")] -mod rpc; pub mod spec; #[cfg(feature = "native")] diff --git a/crates/bitcoin-da/src/rpc.rs b/crates/bitcoin-da/src/rpc.rs deleted file mode 100644 index 0269cc3eb..000000000 --- a/crates/bitcoin-da/src/rpc.rs +++ /dev/null @@ -1,280 +0,0 @@ -use core::fmt::{Debug, Display}; -use core::str::FromStr; - -use anyhow::Result; -use bitcoin::block::{Header, Version}; -use bitcoin::hash_types::{TxMerkleNode, WitnessMerkleNode}; -use bitcoin::hashes::Hash; -use bitcoin::{merkle_tree, BlockHash, CompactTarget, Txid, Wtxid}; -use reqwest::header::HeaderMap; -use serde::{Deserialize, Serialize}; -use serde_json::value::RawValue; -use serde_json::{json, to_value}; -use tracing::{instrument, warn}; - -use crate::helpers::parsers::parse_hex_transaction; -use crate::spec::block::BitcoinBlock; -use crate::spec::header::HeaderWrapper; -use crate::spec::transaction::TransactionWrapper; -use crate::spec::utxo::{ListUnspentEntry, UTXO}; - -// RPCError is a struct that represents an error returned by the Bitcoin RPC -#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] -pub struct RPCError { - pub code: i32, - pub message: String, -} -impl Display for RPCError { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!(f, "RPCError {}: {}", self.code, self.message) - } -} - -// Response is a struct that represents a response returned by the Bitcoin RPC -// It is generic over the type of the result field, which is usually a String in Bitcoin Core -#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] -struct Response { - pub result: Option, - pub error: Option, - pub id: String, -} - -// BitcoinNode is a struct that represents a connection to a Bitcoin RPC node -#[derive(Debug, Clone)] -pub struct BitcoinNode { - url: String, - client: reqwest::Client, -} - -impl BitcoinNode { - #[instrument(level = "trace", ret)] - pub fn new(url: String, username: String, password: String) -> Self { - let mut headers = HeaderMap::new(); - headers.insert( - "Authorization", - format!( - "Basic {}", - base64::encode(format!("{}:{}", username, password)) - ) - .parse() - .expect("Failed to parse auth header!"), - ); - headers.insert( - "Content-Type", - "application/json" - .parse() - .expect("Failed to parse content type header!"), - ); - let client = reqwest::Client::builder() - .default_headers(headers) - .build() - .expect("Failed to build client!"); - - Self { url, client } - } - - #[instrument(level = "trace", skip_all, err)] - async fn call_inner( - &self, - method: &str, - params: &[serde_json::Value], - ) -> Result, reqwest::Error> { - let response = self - .client - .post(&self.url) - .json(&json!({ - "jsonrpc": "1.0", - "id": method, - "method": method, - "params": params - })) - .send() - .await?; - - let response = response.json::>().await?; - - if let Some(error) = response.error { - warn!(error=?error, "RPC returned error"); - return Ok(Err(error)); - } - - Ok(Ok(response.result.unwrap())) - } - - // TODO: add max retries - #[instrument(level = "trace", skip(self), err, ret)] - async fn call( - &self, - method: &str, - params: Vec, - ) -> Result { - let mut attempt = 1; - loop { - match self.call_inner(method, ¶ms).await { - Ok(Ok(result)) => return Ok(result), - Ok(Err(error)) => { - anyhow::bail!(error) - } - Err(error) => { - // sometimes requests to bitcoind are dropped without a reason - // TODO: maybe remove is_request() check? - if error.is_connect() || error.is_timeout() || error.is_request() { - warn!(error=?error, attempt=attempt, "Failed to send a call to bitcoind"); - attempt += 1; - tokio::time::sleep(tokio::time::Duration::from_millis(500)).await; - continue; // retry - } else { - anyhow::bail!(error) - } - } - } - } - } - - // get_block_count returns the current block height - pub async fn get_block_count(&self) -> Result { - self.call("getblockcount", vec![]).await - } - - // get_block_hash returns the block hash of the block at the given height - pub async fn get_block_hash(&self, height: u64) -> Result { - self.call("getblockhash", vec![to_value(height)?]).await - } - - // get_best_blockhash returns the best blockhash of the chain - pub async fn get_best_blockhash(&self) -> Result { - self.call("getbestblockhash", vec![]).await - } - - fn calculate_witness_root(txdata: &[TransactionWrapper]) -> Option { - let hashes = txdata.iter().enumerate().map(|(i, t)| { - if i == 0 { - // Replace the first hash with zeroes. - Wtxid::all_zeros().to_raw_hash() - } else { - t.wtxid().to_raw_hash() - } - }); - merkle_tree::calculate_root(hashes).map(|h| h.into()) - } - - // get_block_header returns a particular block header with a given hash - pub async fn get_block_header(&self, hash: BlockHash) -> Result { - // The full block is requested here because txs_commitment is the witness root - let full_block = self.get_block(hash).await?; - Ok(full_block.header) - } - - // get_block returns the block at the given hash - pub async fn get_block(&self, hash: BlockHash) -> Result { - let result = self - .call::>("getblock", vec![to_value(hash)?, to_value(3)?]) - .await? - .to_string(); - - let full_block: serde_json::Value = serde_json::from_str(&result)?; - - let header: Header = Header { - bits: CompactTarget::from_consensus(u32::from_str_radix( - full_block["bits"].as_str().unwrap(), - 16, - )?), - merkle_root: TxMerkleNode::from_str(full_block["merkleroot"].as_str().unwrap())?, - nonce: full_block["nonce"].as_u64().unwrap() as u32, - prev_blockhash: BlockHash::from_str(full_block["previousblockhash"].as_str().unwrap())?, - time: full_block["time"].as_u64().unwrap() as u32, - version: Version::from_consensus(full_block["version"].as_u64().unwrap() as i32), - }; - - let txdata = full_block["tx"].as_array().unwrap(); - - let txs: Vec = txdata - .iter() - .map(|tx| { - let tx_hex = tx["hex"].as_str().unwrap(); - - parse_hex_transaction(tx_hex).unwrap() // hex from rpc cannot be invalid - }) - .map(Into::into) - .collect(); - - let witness_root = - Self::calculate_witness_root(&txs).unwrap_or(WitnessMerkleNode::all_zeros()); - - let height = full_block["height"].as_u64().unwrap(); - - Ok(BitcoinBlock { - header: HeaderWrapper::new(header, txs.len() as u32, height, witness_root), - txdata: txs, - }) - } - - // get_utxos returns all unspent transaction outputs for the wallets of bitcoind - pub async fn get_utxos(&self) -> Result> { - let utxos = self - .call("listunspent", vec![to_value(0)?, to_value(9999999)?]) - .await?; - - Ok(utxos) - } - - // estimate_smart_fee estimates the fee to confirm a transaction in the next block - #[instrument(level = "trace", skip(self), err, ret)] - pub async fn estimate_smart_fee(&self) -> Result { - let result = self - .call::>("estimatesmartfee", vec![to_value(1)?]) - .await? - .to_string(); - - let result_map: serde_json::Value = serde_json::from_str(&result)?; - - // Issue: https://github.com/chainwayxyz/bitcoin-da/issues/3 - let btc_vkb = result_map - .get("feerate") - .unwrap_or(&serde_json::Value::from_str("0.00001").unwrap()) - .as_f64() - .unwrap(); - - // convert to sat/vB and round up - Ok((btc_vkb * 100_000_000.0 / 1000.0).ceil()) - } - - // sign_raw_transaction_with_wallet signs a raw transaction with the wallet of bitcoind - pub async fn sign_raw_transaction_with_wallet(&self, tx: String) -> Result { - let result = self - .call::>("signrawtransactionwithwallet", vec![to_value(tx)?]) - .await? - .to_string(); - - let signed_tx: serde_json::Value = serde_json::from_str(&result)?; - - Ok(signed_tx["hex"].as_str().unwrap().to_string()) - } - - // send_raw_transaction sends a raw transaction to the network - pub async fn send_raw_transaction(&self, tx: String) -> Result { - self.call("sendrawtransaction", vec![to_value(tx)?]).await - } - - pub async fn list_wallets(&self) -> Result> { - let res = self.call::>("listwallets", vec![]).await; - match res { - Ok(wallets) => Ok(wallets), - Err(_) => Ok(vec![]), - } - } - - /// Get unconfirmed utxos - pub async fn get_pending_utxos(&self) -> Result> { - let utxos = self - .call("listunspent", vec![to_value(0)?, to_value(0)?]) - .await?; - - Ok(utxos) - } - - /// Get a raw transaction by its txid - pub async fn get_raw_transaction(&self, txid: Txid) -> Result { - self.call("getrawtransaction", vec![to_value(txid)?]).await - } -} diff --git a/crates/bitcoin-da/src/service.rs b/crates/bitcoin-da/src/service.rs index e0d1cc556..d72127ec7 100644 --- a/crates/bitcoin-da/src/service.rs +++ b/crates/bitcoin-da/src/service.rs @@ -5,18 +5,23 @@ use core::result::Result::Ok; use core::str::FromStr; use core::time::Duration; use std::collections::HashSet; +use std::sync::Arc; +use anyhow::{Context, Result}; // use std::sync::Arc; use async_trait::async_trait; -use bitcoin::consensus::encode; +use bitcoin::block::Header; +use bitcoin::consensus::{encode, Decodable}; +use bitcoin::hash_types::WitnessMerkleNode; use bitcoin::hashes::{sha256d, Hash}; use bitcoin::secp256k1::SecretKey; -use bitcoin::{Address, BlockHash, Transaction, Txid}; -use hex::ToHex; +use bitcoin::{merkle_tree, Amount, BlockHash, Transaction, Txid, Wtxid}; +use bitcoincore_rpc::jsonrpc_async::Error as RpcError; +use bitcoincore_rpc::{Auth, Client, Error, RpcApi}; use serde::{Deserialize, Serialize}; use sov_rollup_interface::da::DaSpec; use sov_rollup_interface::services::da::{BlobWithNotifier, DaService}; -use tokio::sync::mpsc::{unbounded_channel, UnboundedSender}; +use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender}; use tokio::sync::oneshot::channel as oneshot_channel; use tracing::{debug, error, info, instrument, trace}; @@ -24,21 +29,22 @@ use crate::helpers::builders::{ create_inscription_transactions, sign_blob_with_private_key, write_reveal_tx, TxWithId, }; use crate::helpers::compression::{compress_blob, decompress_blob}; -use crate::helpers::parsers::{parse_hex_transaction, parse_transaction}; -use crate::rpc::{BitcoinNode, RPCError}; +use crate::helpers::parsers::parse_transaction; use crate::spec::blob::BlobWithSender; use crate::spec::block::BitcoinBlock; +use crate::spec::header::HeaderWrapper; use crate::spec::header_stream::BitcoinHeaderStream; use crate::spec::proof::InclusionMultiProof; +use crate::spec::transaction::TransactionWrapper; use crate::spec::utxo::UTXO; use crate::spec::{BitcoinSpec, RollupParams}; use crate::verifier::BitcoinVerifier; use crate::REVEAL_OUTPUT_AMOUNT; /// A service that provides data and data availability proofs for Bitcoin -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct BitcoinService { - client: BitcoinNode, + client: Client, rollup_name: String, network: bitcoin::Network, da_private_key: Option, @@ -55,7 +61,7 @@ pub struct DaServiceConfig { pub node_password: String, // network of the bitcoin node - pub network: String, + pub network: bitcoin::Network, // da private key of the sequencer pub da_private_key: Option, @@ -69,37 +75,44 @@ const POLLING_INTERVAL: u64 = 10; // seconds impl BitcoinService { // Create a new instance of the DA service from the given configuration. - pub async fn new(config: DaServiceConfig, chain_params: RollupParams) -> Self { - let network = - bitcoin::Network::from_str(&config.network).expect("Invalid bitcoin network name"); - - let client = BitcoinNode::new(config.node_url, config.node_username, config.node_password); + pub async fn new( + config: DaServiceConfig, + chain_params: RollupParams, + tx: UnboundedSender>, + ) -> Result { + let client = Client::new( + &config.node_url, + Auth::UserPass(config.node_username, config.node_password), + ) + .await?; let private_key = config .da_private_key - .map(|pk| SecretKey::from_str(&pk).expect("Invalid private key")); - - let (tx, mut rx) = unbounded_channel::>(); + .map(|pk| SecretKey::from_str(&pk)) + .transpose() + .context("Invalid private key")?; - let this = Self::with_client( + Ok(Self::with_client( client, chain_params.rollup_name, - network, + config.network, private_key, chain_params.reveal_tx_id_prefix, tx, ) - .await; - - let serv = this.clone(); + .await) + } + pub fn spawn_da_queue( + self: Arc, + mut rx: UnboundedReceiver>, + ) { // This is a queue of inscribe requests tokio::task::spawn_blocking(|| { - let this = serv; tokio::runtime::Handle::current().block_on(async move { // TODO https://github.com/chainwayxyz/citrea/issues/537 // TODO find last tx by utxo chain - let mut prev_tx = match this.get_pending_transactions().await { + let mut prev_tx = match self.get_pending_transactions().await { Ok(pending_txs) => { if !pending_txs.is_empty() { let tx = pending_txs.first().unwrap().clone(); @@ -124,7 +137,7 @@ impl BitcoinService { loop { // Build and send tx with retries: let blob = request.blob.clone(); - let fee_sat_per_vbyte = match this.get_fee_rate().await { + let fee_sat_per_vbyte = match self.get_fee_rate().await { Ok(rate) => rate, Err(e) => { error!(?e, "Failed to call get_fee_rate. Retrying..."); @@ -132,7 +145,7 @@ impl BitcoinService { continue; } }; - match this + match self .send_transaction_with_fee_rate(prev.clone(), blob, fee_sat_per_vbyte) .await { @@ -155,35 +168,41 @@ impl BitcoinService { error!("BitcoinDA queue stopped"); }); }); - - this } #[cfg(test)] - pub async fn new_without_client(config: DaServiceConfig, chain_params: RollupParams) -> Self { - let network = - bitcoin::Network::from_str(&config.network).expect("Invalid bitcoin network name"); - - let client = BitcoinNode::new(config.node_url, config.node_username, config.node_password); + pub async fn new_without_client( + config: DaServiceConfig, + chain_params: RollupParams, + ) -> Result { + use tokio::sync::mpsc::unbounded_channel; + + let client = Client::new( + &config.node_url, + Auth::UserPass(config.node_username, config.node_password), + ) + .await?; let private_key = config .da_private_key - .map(|pk| SecretKey::from_str(&pk).expect("Invalid private key")); + .map(|pk| SecretKey::from_str(&pk)) + .transpose() + .context("Invalid private key")?; let (tx, _rx) = unbounded_channel(); - Self { + Ok(Self { client, rollup_name: chain_params.rollup_name, - network, + network: config.network, da_private_key: private_key, reveal_tx_id_prefix: chain_params.reveal_tx_id_prefix, inscribes_queue: tx, - } + }) } async fn with_client( - client: BitcoinNode, + client: Client, rollup_name: String, network: bitcoin::Network, da_private_key: Option, @@ -211,14 +230,22 @@ impl BitcoinService { #[instrument(level = "trace", skip_all, ret)] async fn get_utxos(&self) -> Result, anyhow::Error> { - let utxos = self.client.get_utxos().await?; + let utxos = self + .client + .list_unspent(None, None, None, None, None) + .await?; if utxos.is_empty() { return Err(anyhow::anyhow!("There are no UTXOs")); } let utxos: Vec = utxos .into_iter() - .filter(|utxo| utxo.spendable && utxo.solvable && utxo.amount > REVEAL_OUTPUT_AMOUNT) + .filter(|utxo| { + utxo.spendable + && utxo.solvable + && utxo.amount > Amount::from_sat(REVEAL_OUTPUT_AMOUNT) + }) + .map(Into::into) .collect(); if utxos.is_empty() { return Err(anyhow::anyhow!("There are no spendable UTXOs")); @@ -229,7 +256,10 @@ impl BitcoinService { #[instrument(level = "trace", skip_all, ret)] async fn get_pending_transactions(&self) -> Result, anyhow::Error> { - let mut pending_utxos = self.client.get_pending_utxos().await?; + let mut pending_utxos = self + .client + .list_unspent(Some(0), Some(0), None, None, None) + .await?; // Sorted by ancestor count, the tx with the most ancestors is the latest tx pending_utxos.sort_unstable_by_key(|utxo| -(utxo.ancestor_count.unwrap_or(0) as i64)); @@ -243,13 +273,12 @@ impl BitcoinService { continue; } - let raw_tx = self + let tx = self .client - .get_raw_transaction(txid) + .get_raw_transaction(&txid, None) .await .expect("Transaction should exist with existing utxo"); - let parsed_tx = parse_hex_transaction(&raw_tx).expect("Rpc tx should be parsable"); - pending_transactions.push(parsed_tx); + pending_transactions.push(tx); scanned_txids.insert(txid); } @@ -263,7 +292,7 @@ impl BitcoinService { blob: Vec, fee_sat_per_vbyte: f64, ) -> Result { - let client = self.client.clone(); + let client = &self.client; let network = self.network; let rollup_name = self.rollup_name.clone(); @@ -273,13 +302,15 @@ impl BitcoinService { let blob = compress_blob(&blob); // get all available utxos - let utxos: Vec = self.get_utxos().await?; + let utxos = self.get_utxos().await?; // get address from a utxo - let address = Address::from_str(&utxos[0].address.clone()) - .unwrap() + let address = utxos[0] + .address + .clone() + .context("Missing address")? .require_network(network) - .expect("Invalid network for address"); + .context("Invalid network for address")?; // sign the blob for authentication of the sequencer let (signature, public_key) = @@ -302,13 +333,15 @@ impl BitcoinService { )?; // sign inscribe transactions - let serialized_unsigned_commit_tx = &encode::serialize(&unsigned_commit_tx); + // let serialized_unsigned_commit_tx = &encode::serialize(&unsigned_commit_tx); let signed_raw_commit_tx = client - .sign_raw_transaction_with_wallet(serialized_unsigned_commit_tx.encode_hex()) + .sign_raw_transaction_with_wallet(&unsigned_commit_tx, None, None) .await?; // send inscribe transactions - client.send_raw_transaction(signed_raw_commit_tx).await?; + client + .send_raw_transaction(&signed_raw_commit_tx.hex) + .await?; // serialize reveal tx let serialized_reveal_tx = &encode::serialize(&reveal_tx.tx); @@ -320,9 +353,7 @@ impl BitcoinService { ); // send reveal tx - let reveal_tx_hash = client - .send_raw_transaction(serialized_reveal_tx.encode_hex()) - .await?; + let reveal_tx_hash = client.send_raw_transaction(serialized_reveal_tx).await?; info!("Blob inscribe tx sent. Hash: {}", reveal_tx_hash); @@ -336,7 +367,14 @@ impl BitcoinService { return Ok(2.0); } - self.client.estimate_smart_fee().await + self.get_fee_rate_as_sat_vb_ceiled().await + } + + #[instrument(level = "trace", skip_all, ret)] + pub async fn get_fee_rate_as_sat_vb_ceiled(&self) -> Result { + let smart_fee = self.client.estimate_smart_fee(1, None).await?; + let btc_vkb = smart_fee.fee_rate.map_or(0.00001f64, |rate| rate.to_btc()); + Ok((btc_vkb * 100_000_000.0 / 1000.0).ceil()) } } @@ -348,6 +386,18 @@ impl From for [u8; 32] { } } +fn calculate_witness_root(txdata: &[TransactionWrapper]) -> Option { + let hashes = txdata.iter().enumerate().map(|(i, t)| { + if i == 0 { + // Replace the first hash with zeroes. + Wtxid::all_zeros().to_raw_hash() + } else { + t.wtxid().to_raw_hash() + } + }); + merkle_tree::calculate_root(hashes).map(|h| h.into()) +} + #[async_trait] impl DaService for BitcoinService { type Spec = BitcoinSpec; @@ -362,6 +412,8 @@ impl DaService for BitcoinService { type Error = anyhow::Error; + type BlockHash = bitcoin::BlockHash; + // Make an RPC call to the node to get the block at the given height // If no such block exists, block until one does. #[instrument(level = "trace", skip(self), err)] @@ -372,28 +424,27 @@ impl DaService for BitcoinService { loop { block_hash = match self.client.get_block_hash(height).await { Ok(block_hash_response) => block_hash_response, - Err(error) => { - match error.downcast_ref::() { - Some(error) => { - if error.code == -8 { + Err(e) => { + match e { + Error::JsonRpc(RpcError::Rpc(rpc_err)) => { + if rpc_err.code == -8 { info!("Block not found, waiting"); tokio::time::sleep(Duration::from_secs(POLLING_INTERVAL)).await; continue; } else { // other error, return message - return Err(anyhow::anyhow!(error.message.clone())); + return Err(anyhow::anyhow!(rpc_err.message)); } } - None => { - return Err(anyhow::anyhow!(error)); - } + _ => return Err(anyhow::anyhow!(e)), } } }; break; } - let block = self.client.get_block(block_hash).await?; + // block_hash.as_raw_hash().to_byte_array() + let block = self.get_block_by_hash(block_hash).await?; Ok(block) } @@ -410,9 +461,9 @@ impl DaService for BitcoinService { .get_block_hash(block_count - FINALITY_DEPTH) .await?; - let finalized_block_header = self.client.get_block_header(finalized_blockhash).await?; + let finalized_block_header = self.get_block_by_hash(finalized_blockhash).await?; - Ok(finalized_block_header) + Ok(finalized_block_header.header) } async fn subscribe_finalized_header(&self) -> Result { @@ -424,11 +475,11 @@ impl DaService for BitcoinService { async fn get_head_block_header( &self, ) -> Result<::BlockHeader, Self::Error> { - let best_blockhash = self.client.get_best_blockhash().await?; + let best_blockhash = self.client.get_best_block_hash().await?; - let head_block_header = self.client.get_block_header(best_blockhash).await?; + let head_block_header = self.get_block_by_hash(best_blockhash).await?; - Ok(head_block_header) + Ok(head_block_header.header) } // Extract the blob transactions relevant to a particular rollup from a block. @@ -542,21 +593,46 @@ impl DaService for BitcoinService { #[instrument(level = "trace", skip(self))] async fn get_fee_rate(&self) -> Result { - // This already returns ceil, so the conversion should work - let res = self.client.estimate_smart_fee().await? as u128; + let sat_vb_ceil = self.get_fee_rate_as_sat_vb_ceiled().await? as u128; + // multiply with 10^10/4 = 25*10^8 = 2_500_000_000 - let multiplied_fee = res.saturating_mul(2_500_000_000); + let multiplied_fee = sat_vb_ceil.saturating_mul(2_500_000_000); Ok(multiplied_fee) } #[instrument(level = "trace", skip(self))] - async fn get_block_by_hash(&self, hash: [u8; 32]) -> Result { + async fn get_block_by_hash( + &self, + hash: Self::BlockHash, + ) -> Result { info!("Getting block with hash {:?}", hash); - let hash = BlockHash::from_byte_array(hash); + let block = self.client.get_block_verbose(&hash).await?; - let block = self.client.get_block(hash).await?; - Ok(block) + let header: Header = Header { + bits: block.bits, + merkle_root: block.merkleroot, + nonce: block.nonce, + prev_blockhash: block.previousblockhash.unwrap_or_else(BlockHash::all_zeros), + time: block.time as u32, + version: block.version, + }; + + let txs = block + .tx + .iter() + .map(|tx| { + Transaction::consensus_decode(&mut &tx.hex[..]) + .map(|transaction| transaction.into()) + }) + .collect::, _>>()?; + + let witness_root = calculate_witness_root(&txs).unwrap_or(WitnessMerkleNode::all_zeros()); + + Ok(BitcoinBlock { + header: HeaderWrapper::new(header, txs.len() as u32, block.height, witness_root), + txdata: txs, + }) } #[instrument(level = "trace", skip(self))] @@ -637,7 +713,7 @@ mod tests { node_url: "http://localhost:38332".to_string(), node_username: "chainway".to_string(), node_password: "topsecret".to_string(), - network: "regtest".to_string(), + network: bitcoin::Network::Regtest, da_private_key: Some( "E9873D79C6D87DC0FB6A5778633389F4453213303DA61F20BD67FC233AA33262".to_string(), // Test key, safe to publish ), @@ -652,6 +728,7 @@ mod tests { }, ) .await + .expect("Error initialazing BitcoinService") } // #[tokio::test] @@ -753,7 +830,7 @@ mod tests { node_url: "http://localhost:38332".to_string(), node_username: "chainway".to_string(), node_password: "topsecret".to_string(), - network: "regtest".to_string(), + network: bitcoin::Network::Regtest, da_private_key: Some( "E9873D79C6D87DC0FB6A5778633389F4453213303DA61F20BD67FC233AA33261".to_string(), // Test key, safe to publish ), @@ -767,7 +844,8 @@ mod tests { reveal_tx_id_prefix: vec![0, 0], }, ) - .await; + .await + .expect("Error initialazing BitcoinService"); let incorrect_pub_key = Keypair::from_secret_key(&secp, &incorrect_service.da_private_key.unwrap()) diff --git a/crates/bitcoin-da/src/spec/utxo.rs b/crates/bitcoin-da/src/spec/utxo.rs index c12442e67..f90e459f8 100644 --- a/crates/bitcoin-da/src/spec/utxo.rs +++ b/crates/bitcoin-da/src/spec/utxo.rs @@ -1,49 +1,32 @@ -use bitcoin::Txid; +use bitcoin::address::NetworkUnchecked; +use bitcoin::{Address, Txid}; +use bitcoincore_rpc::json::ListUnspentResultEntry; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize)] pub struct UTXO { pub tx_id: Txid, pub vout: u32, - pub address: String, + pub address: Option>, pub script_pubkey: String, pub amount: u64, - pub confirmations: u64, + pub confirmations: u32, pub spendable: bool, pub solvable: bool, } -// Temporary struct to deserialize UTXO from JSON -#[derive(Deserialize)] -struct RawUTXO { - txid: String, - vout: u32, - address: String, - #[serde(rename = "scriptPubKey")] - script_pub_key: String, - amount: f64, - confirmations: u64, - spendable: bool, - solvable: bool, -} - -// Deserialize UTXO from JSON -impl<'de> serde::Deserialize<'de> for UTXO { - fn deserialize(deserializer: D) -> Result - where - D: serde::Deserializer<'de>, - { - let raw_utxo = RawUTXO::deserialize(deserializer)?; - Ok(UTXO { - tx_id: raw_utxo.txid.parse().unwrap(), - vout: raw_utxo.vout, - address: raw_utxo.address, - script_pubkey: raw_utxo.script_pub_key, - amount: (raw_utxo.amount * 100_000_000.0) as u64, // satoshis to bitcoin - confirmations: raw_utxo.confirmations, - spendable: raw_utxo.spendable, - solvable: raw_utxo.solvable, - }) +impl From for UTXO { + fn from(v: ListUnspentResultEntry) -> Self { + Self { + tx_id: v.txid, + vout: v.vout, + address: v.address, + script_pubkey: v.script_pub_key.to_hex_string(), + amount: v.amount.to_sat(), + confirmations: v.confirmations, + spendable: v.spendable, + solvable: v.solvable, + } } } diff --git a/crates/ethereum-rpc/src/ethereum.rs b/crates/ethereum-rpc/src/ethereum.rs index f9e129cc4..556878ae3 100644 --- a/crates/ethereum-rpc/src/ethereum.rs +++ b/crates/ethereum-rpc/src/ethereum.rs @@ -1,4 +1,4 @@ -use std::sync::Mutex; +use std::sync::{Arc, Mutex}; #[cfg(feature = "local")] use citrea_evm::DevSigner; @@ -30,7 +30,7 @@ pub struct EthRpcConfig { pub struct Ethereum { #[allow(dead_code)] - pub(crate) da_service: Da, + pub(crate) da_service: Arc, pub(crate) gas_price_oracle: GasPriceOracle, #[cfg(feature = "local")] pub(crate) eth_signer: DevSigner, @@ -43,7 +43,7 @@ pub struct Ethereum { impl Ethereum { pub(crate) fn new( - da_service: Da, + da_service: Arc, gas_price_oracle_config: GasPriceOracleConfig, fee_history_cache_config: FeeHistoryCacheConfig, #[cfg(feature = "local")] eth_signer: DevSigner, diff --git a/crates/ethereum-rpc/src/lib.rs b/crates/ethereum-rpc/src/lib.rs index 5ad63eade..7b90590ff 100644 --- a/crates/ethereum-rpc/src/lib.rs +++ b/crates/ethereum-rpc/src/lib.rs @@ -3,6 +3,8 @@ mod gas_price; mod subscription; mod trace; +use std::sync::Arc; + #[cfg(feature = "local")] pub use citrea_evm::DevSigner; use citrea_evm::{Evm, Filter}; @@ -40,7 +42,7 @@ pub enum CitreaStatus { } pub fn get_ethereum_rpc( - da_service: Da, + da_service: Arc, eth_rpc_config: EthRpcConfig, storage: C::Storage, sequencer_client_url: Option, diff --git a/crates/fullnode/src/runner.rs b/crates/fullnode/src/runner.rs index 779b6e76c..2f645d803 100644 --- a/crates/fullnode/src/runner.rs +++ b/crates/fullnode/src/runner.rs @@ -49,7 +49,7 @@ where { start_l2_height: u64, start_l1_height: u64, - da_service: Da, + da_service: Arc, stf: Stf, storage_manager: Sm, ledger_db: DB, @@ -71,7 +71,7 @@ where impl CitreaFullnode where - Da: DaService + Clone + Send + Sync + 'static, + Da: DaService + Send + Sync + 'static, Vm: ZkvmHost + Zkvm, Sm: HierarchicalStorageManager, Stf: StateTransitionFunction< @@ -94,7 +94,7 @@ where runner_config: RunnerConfig, public_keys: RollupPublicKeys, rpc_config: RpcConfig, - da_service: Da, + da_service: Arc, ledger_db: DB, stf: Stf, mut storage_manager: Sm, @@ -652,7 +652,7 @@ where async fn l1_sync( start_l1_height: u64, - da_service: Da, + da_service: Arc, sender: mpsc::Sender, l1_block_cache: Arc>>, ) where diff --git a/crates/fullnode/tests/runner_initialization_tests.rs b/crates/fullnode/tests/runner_initialization_tests.rs index 54db3fdbe..47d8145d3 100644 --- a/crates/fullnode/tests/runner_initialization_tests.rs +++ b/crates/fullnode/tests/runner_initialization_tests.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + use citrea_fullnode::CitreaFullnode; use sov_db::ledger_db::LedgerDB; use sov_mock_da::{MockAddress, MockDaConfig, MockDaService, MockDaSpec, MockValidityCond}; @@ -111,7 +113,7 @@ fn initialize_runner( rollup_config.runner.unwrap(), rollup_config.public_keys, rollup_config.rpc, - da_service, + Arc::new(da_service), ledger_db, stf, storage_manager, diff --git a/crates/fullnode/tests/runner_reorg_tests.rs b/crates/fullnode/tests/runner_reorg_tests.rs index 0df95281a..f392bdb05 100644 --- a/crates/fullnode/tests/runner_reorg_tests.rs +++ b/crates/fullnode/tests/runner_reorg_tests.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + use citrea_fullnode::CitreaFullnode; use sov_mock_da::{ MockAddress, MockBlob, MockBlock, MockBlockHeader, MockDaConfig, MockDaService, MockDaSpec, @@ -68,7 +70,7 @@ async fn test_simple_reorg_case() { let init_variant: MockInitVariant = InitVariant::Genesis(genesis_params); - let (before, after) = runner_execution(tmpdir.path(), init_variant, da_service).await; + let (before, after) = runner_execution(tmpdir.path(), init_variant, Arc::new(da_service)).await; assert_ne!(before, after); assert_eq!(expected_state_root, after); @@ -104,7 +106,7 @@ async fn test_instant_finality_data_stored() { let init_variant: MockInitVariant = InitVariant::Genesis(genesis_params); - let (before, after) = runner_execution(tmpdir.path(), init_variant, da_service).await; + let (before, after) = runner_execution(tmpdir.path(), init_variant, Arc::new(da_service)).await; assert_ne!(before, after); assert_eq!(expected_state_root, after); @@ -116,7 +118,7 @@ async fn test_instant_finality_data_stored() { async fn runner_execution( storage_path: &std::path::Path, init_variant: MockInitVariant, - da_service: MockDaService, + da_service: Arc, ) -> ([u8; 32], [u8; 32]) { let rollup_storage_path = storage_path.join("rollup").to_path_buf(); let rollup_config = FullNodeConfig:: { diff --git a/crates/primitives/src/da.rs b/crates/primitives/src/da.rs index ea20ab77b..818509cb8 100644 --- a/crates/primitives/src/da.rs +++ b/crates/primitives/src/da.rs @@ -11,7 +11,7 @@ use tokio::sync::Mutex; use crate::L1BlockCache; pub async fn get_da_block_at_height( - da_service: &Da, + da_service: &Arc, height: u64, l1_block_cache: Arc>>, ) -> anyhow::Result { diff --git a/crates/prover/src/prover_service/parallel/mod.rs b/crates/prover/src/prover_service/parallel/mod.rs index 311278eba..b82bea9d7 100644 --- a/crates/prover/src/prover_service/parallel/mod.rs +++ b/crates/prover/src/prover_service/parallel/mod.rs @@ -177,7 +177,7 @@ where async fn wait_for_proving_and_send_to_da( &self, block_header_hash: ::SlotHash, - da_service: &Self::DaService, + da_service: &Arc, ) -> Result<(::TransactionId, Proof), anyhow::Error> { loop { let status = self diff --git a/crates/prover/src/runner.rs b/crates/prover/src/runner.rs index b7c164d6d..16d16f42e 100644 --- a/crates/prover/src/runner.rs +++ b/crates/prover/src/runner.rs @@ -56,7 +56,7 @@ where DB: ProverLedgerOps + Clone, { start_l2_height: u64, - da_service: Da, + da_service: Arc, stf: Stf, storage_manager: Sm, ledger_db: DB, @@ -79,7 +79,7 @@ where impl CitreaProver where C: Context, - Da: DaService + Clone + Send + Sync + 'static, + Da: DaService + Send + Sync + 'static, Sm: HierarchicalStorageManager, Vm: ZkvmHost, Stf: StateTransitionFunction< @@ -102,7 +102,7 @@ where runner_config: RunnerConfig, public_keys: RollupPublicKeys, rpc_config: RpcConfig, - da_service: Da, + da_service: Arc, ledger_db: DB, stf: Stf, mut storage_manager: Sm, @@ -587,7 +587,7 @@ where async fn get_state_transition_data_from_commitments( &self, sequencer_commitments: &[SequencerCommitment], - da_service: &Da, + da_service: &Arc, ) -> Result, anyhow::Error> { let mut state_transition_witnesses: VecDeque< Vec<::Spec>>::Witness>, @@ -807,7 +807,7 @@ where async fn l1_sync( start_l1_height: u64, - da_service: Da, + da_service: Arc, sender: mpsc::Sender, l1_block_cache: Arc>>, ) where diff --git a/crates/prover/tests/prover_tests.rs b/crates/prover/tests/prover_tests.rs index 5eca80be7..c869f4cb5 100644 --- a/crates/prover/tests/prover_tests.rs +++ b/crates/prover/tests/prover_tests.rs @@ -1,4 +1,5 @@ use std::collections::VecDeque; +use std::sync::Arc; use citrea_prover::prover_service::ParallelProverService; use sov_mock_da::{ @@ -18,7 +19,7 @@ use sov_stf_runner::{ async fn test_successful_prover_execution() -> Result<(), ProverServiceError> { let temp = tempfile::tempdir().unwrap(); - let da_service = MockDaService::new(MockAddress::from([0; 32]), temp.path()); + let da_service = Arc::new(MockDaService::new(MockAddress::from([0; 32]), temp.path())); let TestProver { prover_service, vm, .. @@ -51,7 +52,7 @@ async fn test_successful_prover_execution() -> Result<(), ProverServiceError> { #[tokio::test] async fn test_prover_status_busy() -> Result<(), anyhow::Error> { let temp = tempfile::tempdir().unwrap(); - let da_service = MockDaService::new(MockAddress::from([0; 32]), temp.path()); + let da_service = Arc::new(MockDaService::new(MockAddress::from([0; 32]), temp.path())); let TestProver { prover_service, vm, diff --git a/crates/sequencer/src/sequencer.rs b/crates/sequencer/src/sequencer.rs index 338ac80b7..8010dbe55 100644 --- a/crates/sequencer/src/sequencer.rs +++ b/crates/sequencer/src/sequencer.rs @@ -74,7 +74,7 @@ where + StfBlueprintTrait, DB: SequencerLedgerOps + Send + Clone + 'static, { - da_service: Da, + da_service: Arc, mempool: Arc>, sov_tx_signer_priv_key: C::PrivateKey, l2_force_block_tx: UnboundedSender<()>, @@ -103,7 +103,7 @@ enum L2BlockMode { impl CitreaSequencer where C: Context, - Da: DaService + Clone, + Da: DaService, Sm: HierarchicalStorageManager, Vm: ZkvmHost, Stf: StateTransitionFunction< @@ -117,7 +117,7 @@ where { #[allow(clippy::too_many_arguments)] pub fn new( - da_service: Da, + da_service: Arc, storage: C::Storage, config: SequencerConfig, stf: Stf, @@ -1271,9 +1271,12 @@ where .map_err(|e| anyhow::anyhow!("Error reading min max l1 fee rate: {}", e)) } -async fn da_block_monitor(da_service: Da, sender: mpsc::Sender>, loop_interval: u64) -where - Da: DaService + Clone, +async fn da_block_monitor( + da_service: Arc, + sender: mpsc::Sender>, + loop_interval: u64, +) where + Da: DaService, { loop { let l1_data = match get_da_block_data(da_service.clone()).await { @@ -1290,7 +1293,7 @@ where } } -async fn get_da_block_data(da_service: Da) -> anyhow::Result> +async fn get_da_block_data(da_service: Arc) -> anyhow::Result> where Da: DaService, { diff --git a/crates/sovereign-sdk/adapters/mock-da/src/service.rs b/crates/sovereign-sdk/adapters/mock-da/src/service.rs index 8d94640be..468d86ebc 100644 --- a/crates/sovereign-sdk/adapters/mock-da/src/service.rs +++ b/crates/sovereign-sdk/adapters/mock-da/src/service.rs @@ -303,6 +303,7 @@ impl DaService for MockDaService { type HeaderStream = MockDaBlockHeaderStream; type TransactionId = MockHash; type Error = anyhow::Error; + type BlockHash = [u8; 32]; /// Gets block at given height /// If block is not available, waits until it is @@ -426,7 +427,10 @@ impl DaService for MockDaService { Ok(10_u128) } - async fn get_block_by_hash(&self, hash: [u8; 32]) -> Result { + async fn get_block_by_hash( + &self, + hash: Self::BlockHash, + ) -> Result { self.blocks .lock() .await diff --git a/crates/sovereign-sdk/full-node/sov-stf-runner/src/prover_service/mod.rs b/crates/sovereign-sdk/full-node/sov-stf-runner/src/prover_service/mod.rs index 0977562ee..82900a561 100644 --- a/crates/sovereign-sdk/full-node/sov-stf-runner/src/prover_service/mod.rs +++ b/crates/sovereign-sdk/full-node/sov-stf-runner/src/prover_service/mod.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + use async_trait::async_trait; use serde::{Deserialize, Serialize}; use sov_modules_api::Zkvm; @@ -109,6 +111,6 @@ pub trait ProverService { async fn wait_for_proving_and_send_to_da( &self, block_header_hash: <::Spec as DaSpec>::SlotHash, - da_service: &Self::DaService, + da_service: &Arc, ) -> Result<(::TransactionId, Proof), anyhow::Error>; } diff --git a/crates/sovereign-sdk/module-system/sov-modules-rollup-blueprint/src/lib.rs b/crates/sovereign-sdk/module-system/sov-modules-rollup-blueprint/src/lib.rs index ffe86eff8..1491caf6b 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-rollup-blueprint/src/lib.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-rollup-blueprint/src/lib.rs @@ -4,6 +4,8 @@ mod runtime_rpc; mod wallet; +use std::sync::Arc; + use async_trait::async_trait; pub use runtime_rpc::*; use sov_db::ledger_db::LedgerDB; @@ -21,7 +23,7 @@ pub use wallet::*; #[async_trait] pub trait RollupBlueprint: Sized + Send + Sync { /// Data Availability service. - type DaService: DaService + Clone + Send + Sync; + type DaService: DaService + Send + Sync; /// A specification for the types used by a DA layer. type DaSpec: DaSpec + Send + Sync; /// Data Availability config. @@ -66,7 +68,7 @@ pub trait RollupBlueprint: Sized + Send + Sync { &self, storage: &::Storage, ledger_db: &LedgerDB, - da_service: &Self::DaService, + da_service: &Arc, sequencer_client_url: Option, soft_confirmation_rx: Option>, ) -> Result, anyhow::Error>; @@ -99,14 +101,14 @@ pub trait RollupBlueprint: Sized + Send + Sync { async fn create_da_service( &self, rollup_config: &FullNodeConfig, - ) -> Self::DaService; + ) -> Result, anyhow::Error>; /// Creates instance of [`ProverService`]. async fn create_prover_service( &self, prover_config: ProverConfig, rollup_config: &FullNodeConfig, - da_service: &Self::DaService, + da_service: &Arc, ) -> Self::ProverService; /// Creates instance of [`Self::StorageManager`]. diff --git a/crates/sovereign-sdk/module-system/sov-modules-rollup-blueprint/src/runtime_rpc.rs b/crates/sovereign-sdk/module-system/sov-modules-rollup-blueprint/src/runtime_rpc.rs index ff743abf7..268eb1d4d 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-rollup-blueprint/src/runtime_rpc.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-rollup-blueprint/src/runtime_rpc.rs @@ -13,7 +13,7 @@ pub fn register_rpc( where RT: RuntimeTrait::Spec> + Send + Sync + 'static, C: Context, - Da: DaService + Clone, + Da: DaService, { // runtime rpc. let mut rpc_methods = RT::rpc_methods(storage.clone()); diff --git a/crates/sovereign-sdk/rollup-interface/src/node/services/da.rs b/crates/sovereign-sdk/rollup-interface/src/node/services/da.rs index ae9e95fc3..32a4584b2 100644 --- a/crates/sovereign-sdk/rollup-interface/src/node/services/da.rs +++ b/crates/sovereign-sdk/rollup-interface/src/node/services/da.rs @@ -52,6 +52,9 @@ pub trait DaService: Send + Sync + 'static { /// The error type for fallible methods. type Error: core::fmt::Debug + Send + Sync + core::fmt::Display; + /// Use for get_block_by_hash retrieval + type BlockHash; + /// Fetch the block at the given height, waiting for one to be mined if necessary. /// The returned block may not be final, and can be reverted without a consensus violation. /// Call it for the same height are allowed to return different results. @@ -59,7 +62,10 @@ pub trait DaService: Send + Sync + 'static { async fn get_block_at(&self, height: u64) -> Result; /// Fetch block by hash. - async fn get_block_by_hash(&self, hash: [u8; 32]) -> Result; + async fn get_block_by_hash( + &self, + hash: Self::BlockHash, + ) -> Result; /// Fetch the [`DaSpec::BlockHeader`] of the last finalized block. /// If there's no finalized block yet, it should return an error. diff --git a/crates/sovereign-sdk/utils/rng-da-service/src/lib.rs b/crates/sovereign-sdk/utils/rng-da-service/src/lib.rs index 5ae6e43ec..780f27796 100644 --- a/crates/sovereign-sdk/utils/rng-da-service/src/lib.rs +++ b/crates/sovereign-sdk/utils/rng-da-service/src/lib.rs @@ -98,6 +98,7 @@ impl DaService for RngDaService { type HeaderStream = RngHeaderStream; type TransactionId = RngHash; type Error = anyhow::Error; + type BlockHash = [u8; 32]; async fn get_block_at(&self, height: u64) -> Result { let num_bytes = height.to_le_bytes(); @@ -135,7 +136,10 @@ impl DaService for RngDaService { unimplemented!() } - async fn get_block_by_hash(&self, _hash: [u8; 32]) -> Result { + async fn get_block_by_hash( + &self, + _hash: Self::BlockHash, + ) -> Result { unimplemented!() } From fcc48ad71b888dc6ac25fd382a9ca5ab6f0ec419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Yaz=C4=B1c=C4=B1?= <75089142+yaziciahmet@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:16:47 +0300 Subject: [PATCH 12/23] Disable resubmit on init (#950) --- crates/sequencer/src/sequencer.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/sequencer/src/sequencer.rs b/crates/sequencer/src/sequencer.rs index 8010dbe55..fd391b921 100644 --- a/crates/sequencer/src/sequencer.rs +++ b/crates/sequencer/src/sequencer.rs @@ -842,8 +842,10 @@ where #[instrument(level = "trace", skip(self), err, ret)] pub async fn run(&mut self) -> Result<(), anyhow::Error> { - // Resubmit if there were pending commitments on restart - self.resubmit_pending_commitments().await?; + if self.batch_hash != [0; 32] { + // Resubmit if there were pending commitments on restart, skip it on first init + self.resubmit_pending_commitments().await?; + } // TODO: hotfix for mock da self.da_service From 35081e52a0d6faedd248311712122e315149a745 Mon Sep 17 00:00:00 2001 From: Rakan Al-Huneiti Date: Tue, 6 Aug 2024 14:14:30 +0300 Subject: [PATCH 13/23] Fix duration underflow issue (#946) * Fix duration underflow issue * Fix calculation * Improve next block wait duration --- crates/sequencer/src/sequencer.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/crates/sequencer/src/sequencer.rs b/crates/sequencer/src/sequencer.rs index fd391b921..262d4b71b 100644 --- a/crates/sequencer/src/sequencer.rs +++ b/crates/sequencer/src/sequencer.rs @@ -924,10 +924,15 @@ where let mut missed_da_blocks_count = 0; loop { - let mut interval = tokio::time::interval(target_block_time - parent_block_exec_time); - // The first ticket completes immediately. - // See: https://docs.rs/tokio/latest/tokio/time/struct.Interval.html#method.tick - interval.tick().await; + let block_production_tick = tokio::time::sleep( + target_block_time + .checked_sub( + parent_block_exec_time + .checked_sub(target_block_time) + .unwrap_or_default(), + ) + .unwrap_or_default(), + ); tokio::select! { // Run the DA monitor worker @@ -1007,7 +1012,7 @@ where } }, // If sequencer is in production mode, it will build a block every 2 seconds - _ = interval.tick(), if !self.config.test_mode => { + _ = block_production_tick, if !self.config.test_mode => { // By default, we produce a non-empty block IFF we were caught up all the way to // last_finalized_block. If there are missed DA blocks, we start producing // empty blocks at ~2 second rate, 1 L2 block per respective missed DA block From 8b688af18a15a72d557dd4a70e38fe85f31d9952 Mon Sep 17 00:00:00 2001 From: jfldde <168934971+jfldde@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:32:43 +0200 Subject: [PATCH 14/23] Fix getblock verbosity 2 bits type (#951) * Fix header bits type * Increase get_block_by_hash log level --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- crates/bitcoin-da/src/service.rs | 9 +++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2a1130adf..b7daa52f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1265,7 +1265,7 @@ dependencies = [ [[package]] name = "bitcoincore-rpc" version = "0.18.0" -source = "git+https://github.com/jfldde/rust-bitcoincore-rpc.git#c60839cebb61d1a98b7dc652c7cc57f04e3c2600" +source = "git+https://github.com/jfldde/rust-bitcoincore-rpc.git?rev=5527a8d#5527a8df4bde0f2154e8fe3cb2c661bd3ed27286" dependencies = [ "async-trait", "bitcoincore-rpc-json", @@ -1278,7 +1278,7 @@ dependencies = [ [[package]] name = "bitcoincore-rpc-json" version = "0.18.0" -source = "git+https://github.com/jfldde/rust-bitcoincore-rpc.git#c60839cebb61d1a98b7dc652c7cc57f04e3c2600" +source = "git+https://github.com/jfldde/rust-bitcoincore-rpc.git?rev=5527a8d#5527a8df4bde0f2154e8fe3cb2c661bd3ed27286" dependencies = [ "bitcoin", "serde", diff --git a/Cargo.toml b/Cargo.toml index 3bce074d6..b99262a8b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -178,4 +178,4 @@ sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.8 # crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag = "v0.5.5-risczero.0" } secp256k1_v028 = { package = "secp256k1", version = "0.28", git = "https://github.com/Sovereign-Labs/rust-secp256k1.git", branch = "risc0-compatible-0-28-2" } k256 = { package = "k256", version = "0.13.3", git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "k256/v0.13.3-risczero.0" } -bitcoincore-rpc = { version = "0.18.0", git = "https://github.com/jfldde/rust-bitcoincore-rpc.git" } +bitcoincore-rpc = { version = "0.18.0", git = "https://github.com/jfldde/rust-bitcoincore-rpc.git", rev = "5527a8d" } diff --git a/crates/bitcoin-da/src/service.rs b/crates/bitcoin-da/src/service.rs index d72127ec7..9fb2ec584 100644 --- a/crates/bitcoin-da/src/service.rs +++ b/crates/bitcoin-da/src/service.rs @@ -15,7 +15,8 @@ use bitcoin::consensus::{encode, Decodable}; use bitcoin::hash_types::WitnessMerkleNode; use bitcoin::hashes::{sha256d, Hash}; use bitcoin::secp256k1::SecretKey; -use bitcoin::{merkle_tree, Amount, BlockHash, Transaction, Txid, Wtxid}; +use bitcoin::string::FromHexStr; +use bitcoin::{merkle_tree, Amount, BlockHash, CompactTarget, Transaction, Txid, Wtxid}; use bitcoincore_rpc::jsonrpc_async::Error as RpcError; use bitcoincore_rpc::{Auth, Client, Error, RpcApi}; use serde::{Deserialize, Serialize}; @@ -443,7 +444,7 @@ impl DaService for BitcoinService { break; } - // block_hash.as_raw_hash().to_byte_array() + let block = self.get_block_by_hash(block_hash).await?; Ok(block) @@ -605,12 +606,12 @@ impl DaService for BitcoinService { &self, hash: Self::BlockHash, ) -> Result { - info!("Getting block with hash {:?}", hash); + debug!("Getting block with hash {:?}", hash); let block = self.client.get_block_verbose(&hash).await?; let header: Header = Header { - bits: block.bits, + bits: CompactTarget::from_hex_str_no_prefix(block.bits)?, merkle_root: block.merkleroot, nonce: block.nonce, prev_blockhash: block.previousblockhash.unwrap_or_else(BlockHash::all_zeros), From 62d8944fb8c502eece79778268cb91f92f8a66c5 Mon Sep 17 00:00:00 2001 From: Esad Yusuf Atik Date: Tue, 6 Aug 2024 14:55:32 +0200 Subject: [PATCH 15/23] sequencer substraction overflow followup (#953) * Fix duration underflow issue * Fix calculation * Improve next block wait duration * fix unnecessary checked sub --------- Co-authored-by: Rakan Alhneiti --- crates/sequencer/src/sequencer.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/sequencer/src/sequencer.rs b/crates/sequencer/src/sequencer.rs index 262d4b71b..a40c62bb5 100644 --- a/crates/sequencer/src/sequencer.rs +++ b/crates/sequencer/src/sequencer.rs @@ -926,11 +926,7 @@ where loop { let block_production_tick = tokio::time::sleep( target_block_time - .checked_sub( - parent_block_exec_time - .checked_sub(target_block_time) - .unwrap_or_default(), - ) + .checked_sub(parent_block_exec_time) .unwrap_or_default(), ); From e4368103297934c991e4ea9f6527f96008e0dffc Mon Sep 17 00:00:00 2001 From: jfldde <168934971+jfldde@users.noreply.github.com> Date: Wed, 7 Aug 2024 13:24:55 +0200 Subject: [PATCH 16/23] Keep bitcoincore-rpc behind native feature (#955) * Target chainwayxyz fork * Set bitcoincore-rpc behind native feature --- Cargo.lock | 4 +- Cargo.toml | 2 +- .../provers/risc0/guest-bitcoin/Cargo.lock | 42 ------------------- crates/bitcoin-da/Cargo.toml | 3 +- crates/bitcoin-da/src/spec/utxo.rs | 2 + 5 files changed, 7 insertions(+), 46 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b7daa52f3..d6d39b263 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1265,7 +1265,7 @@ dependencies = [ [[package]] name = "bitcoincore-rpc" version = "0.18.0" -source = "git+https://github.com/jfldde/rust-bitcoincore-rpc.git?rev=5527a8d#5527a8df4bde0f2154e8fe3cb2c661bd3ed27286" +source = "git+https://github.com/chainwayxyz/rust-bitcoincore-rpc.git?rev=5527a8d#5527a8df4bde0f2154e8fe3cb2c661bd3ed27286" dependencies = [ "async-trait", "bitcoincore-rpc-json", @@ -1278,7 +1278,7 @@ dependencies = [ [[package]] name = "bitcoincore-rpc-json" version = "0.18.0" -source = "git+https://github.com/jfldde/rust-bitcoincore-rpc.git?rev=5527a8d#5527a8df4bde0f2154e8fe3cb2c661bd3ed27286" +source = "git+https://github.com/chainwayxyz/rust-bitcoincore-rpc.git?rev=5527a8d#5527a8df4bde0f2154e8fe3cb2c661bd3ed27286" dependencies = [ "bitcoin", "serde", diff --git a/Cargo.toml b/Cargo.toml index b99262a8b..9d09cbee0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -178,4 +178,4 @@ sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.8 # crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag = "v0.5.5-risczero.0" } secp256k1_v028 = { package = "secp256k1", version = "0.28", git = "https://github.com/Sovereign-Labs/rust-secp256k1.git", branch = "risc0-compatible-0-28-2" } k256 = { package = "k256", version = "0.13.3", git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "k256/v0.13.3-risczero.0" } -bitcoincore-rpc = { version = "0.18.0", git = "https://github.com/jfldde/rust-bitcoincore-rpc.git", rev = "5527a8d" } +bitcoincore-rpc = { version = "0.18.0", git = "https://github.com/chainwayxyz/rust-bitcoincore-rpc.git", rev = "5527a8d" } diff --git a/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock b/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock index 80d43c70a..a6260c3cd 100644 --- a/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock +++ b/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock @@ -535,12 +535,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -627,7 +621,6 @@ dependencies = [ "anyhow", "async-trait", "bitcoin", - "bitcoincore-rpc", "borsh", "brotli", "futures", @@ -659,30 +652,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bitcoincore-rpc" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb70725a621848c83b3809913d5314c0d20ca84877d99dd909504b564edab00" -dependencies = [ - "bitcoincore-rpc-json", - "jsonrpc", - "log", - "serde", - "serde_json", -] - -[[package]] -name = "bitcoincore-rpc-json" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "856ffbee2e492c23bca715d72ea34aae80d58400f2bda26a82015d6bc2ec3662" -dependencies = [ - "bitcoin", - "serde", - "serde_json", -] - [[package]] name = "bitflags" version = "2.5.0" @@ -1899,17 +1868,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonrpc" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8128f36b47411cd3f044be8c1f5cc0c9e24d1d1bfdc45f0a57897b32513053f2" -dependencies = [ - "base64 0.13.1", - "serde", - "serde_json", -] - [[package]] name = "k256" version = "0.13.3" diff --git a/crates/bitcoin-da/Cargo.toml b/crates/bitcoin-da/Cargo.toml index 81a041ad5..6652131d1 100644 --- a/crates/bitcoin-da/Cargo.toml +++ b/crates/bitcoin-da/Cargo.toml @@ -31,7 +31,7 @@ bitcoin = { workspace = true } brotli = { workspace = true } futures.workspace = true -bitcoincore-rpc.workspace = true +bitcoincore-rpc = { workspace = true, optional = true } [features] default = [] @@ -40,4 +40,5 @@ native = [ "dep:pin-project", "dep:tracing", "sov-rollup-interface/native", + "dep:bitcoincore-rpc" ] diff --git a/crates/bitcoin-da/src/spec/utxo.rs b/crates/bitcoin-da/src/spec/utxo.rs index f90e459f8..15b33192d 100644 --- a/crates/bitcoin-da/src/spec/utxo.rs +++ b/crates/bitcoin-da/src/spec/utxo.rs @@ -1,5 +1,6 @@ use bitcoin::address::NetworkUnchecked; use bitcoin::{Address, Txid}; +#[cfg(feature = "native")] use bitcoincore_rpc::json::ListUnspentResultEntry; use serde::{Deserialize, Serialize}; @@ -15,6 +16,7 @@ pub struct UTXO { pub solvable: bool, } +#[cfg(feature = "native")] impl From for UTXO { fn from(v: ListUnspentResultEntry) -> Self { Self { From cd1a59b9ada221a5753b92c0d61ff55cbcccc4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Yaz=C4=B1c=C4=B1?= <75089142+yaziciahmet@users.noreply.github.com> Date: Wed, 7 Aug 2024 14:46:15 +0300 Subject: [PATCH 17/23] Fix lint (#956) --- crates/bitcoin-da/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bitcoin-da/Cargo.toml b/crates/bitcoin-da/Cargo.toml index 6652131d1..e6ece3710 100644 --- a/crates/bitcoin-da/Cargo.toml +++ b/crates/bitcoin-da/Cargo.toml @@ -40,5 +40,5 @@ native = [ "dep:pin-project", "dep:tracing", "sov-rollup-interface/native", - "dep:bitcoincore-rpc" + "dep:bitcoincore-rpc", ] From 0230d55d7bc096dec7d003fa764efe8dc1f739b4 Mon Sep 17 00:00:00 2001 From: jfldde <168934971+jfldde@users.noreply.github.com> Date: Wed, 7 Aug 2024 14:11:44 +0200 Subject: [PATCH 18/23] Add dprint to lint-fix --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cf93397f6..72d55782a 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,8 @@ lint: ## cargo check and clippy. Skip clippy on guest code since it's not suppo $(MAKE) check-fuzz SKIP_GUEST_BUILD=1 cargo clippy --all-targets --all-features -lint-fix: ## cargo fmt, fix and clippy. Skip clippy on guest code since it's not supported by risc0 +lint-fix: ## dprint fmt, cargo fmt, fix and clippy. Skip clippy on guest code since it's not supported by risc0 + dprint fmt cargo +nightly fmt --all cargo fix --allow-dirty SKIP_GUEST_BUILD=1 cargo clippy --fix --allow-dirty From 116f03a5ba99eb2e99192d194607441e9245bd7c Mon Sep 17 00:00:00 2001 From: jfldde <168934971+jfldde@users.noreply.github.com> Date: Wed, 7 Aug 2024 14:24:09 +0200 Subject: [PATCH 19/23] Add dprint check to lint --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 72d55782a..ac6cd13aa 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ endif lint: ## cargo check and clippy. Skip clippy on guest code since it's not supported by risc0 ## fmt first, because it's the cheapest + dprint check cargo +nightly fmt --all --check cargo check --all-targets --all-features $(MAKE) check-fuzz From 4b0f35545ff281583307c425748b926b4867be74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Yaz=C4=B1c=C4=B1?= <75089142+yaziciahmet@users.noreply.github.com> Date: Thu, 8 Aug 2024 21:23:08 +0300 Subject: [PATCH 20/23] RISC0 guest optimization: Compiler parameter optimizations & Lower memory copies (#959) * Enable cycle logs * Compile time optimizations * Remove println from guest code * Log cycles in prove mode * Lower mem copies * Log hint size * Replace with from_bytes_array * Add dont delete comments * Re-add checking order of wtxs and proof * Return error if wtxid not found * Uncomment printlns * Remove build-override * into_iter * Return more appropriate error * Check wtxids in same loop as txids * Comment back println * Add prover to docs * Separate witness commitment prefix to a constant * Remove build profile --- Cargo.lock | 11 +- .../provers/risc0/guest-bitcoin/Cargo.lock | 4 +- .../provers/risc0/guest-bitcoin/Cargo.toml | 11 +- .../provers/risc0/guest-mock/Cargo.toml | 11 +- crates/bitcoin-da/src/verifier.rs | 187 +++++++++--------- crates/risc0-bonsai/src/host.rs | 13 +- docs/run.md | 28 ++- 7 files changed, 135 insertions(+), 130 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d6d39b263..d686c1f42 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2416,16 +2416,15 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.2" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "platforms", "rustc_version 0.4.0", "subtle", "zeroize", @@ -5770,12 +5769,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "platforms" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" - [[package]] name = "plotters" version = "0.3.6" diff --git a/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock b/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock index a6260c3cd..82160a931 100644 --- a/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock +++ b/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock @@ -2185,9 +2185,9 @@ dependencies = [ [[package]] name = "platforms" -version = "3.4.0" +version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" +checksum = "0e4c7666f2019727f9e8e14bf14456e99c707d780922869f1ba473eee101fa49" [[package]] name = "powerfmt" diff --git a/bin/citrea/provers/risc0/guest-bitcoin/Cargo.toml b/bin/citrea/provers/risc0/guest-bitcoin/Cargo.toml index f5a264b69..4a34bfa36 100644 --- a/bin/citrea/provers/risc0/guest-bitcoin/Cargo.toml +++ b/bin/citrea/provers/risc0/guest-bitcoin/Cargo.toml @@ -27,18 +27,11 @@ crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag secp256k1_v028 = { package = "secp256k1", version = "0.28", git = "https://github.com/Sovereign-Labs/rust-secp256k1.git", branch = "risc0-compatible-0-28-2" } k256 = { package = "k256", version = "0.13.3", git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "k256/v0.13.3-risczero.0" } -[profile.dev] -opt-level = 3 - -[profile.dev.build-override] -opt-level = 3 - [profile.release] -debug = 1 +debug = 0 lto = true - -[profile.release.build-override] opt-level = 3 +codegen-units = 1 [features] bench = [ diff --git a/bin/citrea/provers/risc0/guest-mock/Cargo.toml b/bin/citrea/provers/risc0/guest-mock/Cargo.toml index f0928bf23..815b19467 100644 --- a/bin/citrea/provers/risc0/guest-mock/Cargo.toml +++ b/bin/citrea/provers/risc0/guest-mock/Cargo.toml @@ -25,18 +25,11 @@ crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag secp256k1_v028 = { package = "secp256k1", version = "0.28", git = "https://github.com/Sovereign-Labs/rust-secp256k1.git", branch = "risc0-compatible-0-28-2" } k256 = { package = "k256", version = "0.13.3", git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "k256/v0.13.3-risczero.0" } -[profile.dev] -opt-level = 3 - -[profile.dev.build-override] -opt-level = 3 - [profile.release] -debug = 1 +debug = 0 lto = true - -[profile.release.build-override] opt-level = 3 +codegen-units = 1 [features] bench = [ diff --git a/crates/bitcoin-da/src/verifier.rs b/crates/bitcoin-da/src/verifier.rs index 873a164ef..9d8c19b9d 100644 --- a/crates/bitcoin-da/src/verifier.rs +++ b/crates/bitcoin-da/src/verifier.rs @@ -1,4 +1,4 @@ -use std::collections::HashSet; +use std::collections::BTreeSet; use bitcoin::hashes::{sha256d, Hash}; use bitcoin::{merkle_tree, Txid}; @@ -13,6 +13,8 @@ use crate::helpers::compression::decompress_blob; use crate::helpers::parsers::parse_transaction; use crate::spec::BitcoinSpec; +pub const WITNESS_COMMITMENT_PREFIX: &[u8] = &[0x6a, 0x24, 0xaa, 0x21, 0xa9, 0xed]; + pub struct BitcoinVerifier { rollup_name: String, reveal_tx_id_prefix: Vec, @@ -89,102 +91,33 @@ impl DaVerifier for BitcoinVerifier { inclusion_proof: ::InclusionMultiProof, completeness_proof: ::CompletenessProof, ) -> Result<::ValidityCondition, Self::Error> { - let validity_condition = ChainValidityCondition { - prev_hash: block_header.prev_hash().to_byte_array(), - block_hash: block_header.block_hash().to_byte_array(), - }; - - // check that wtxid's of transactions in completeness proof are included in the InclusionMultiProof - // and are in the same order as in the completeness proof - let mut iter = inclusion_proof.wtxids.iter(); - completeness_proof - .iter() - .all(|tx| iter.any(|&y| y == tx.wtxid().to_byte_array())); - - // verify that one of the outputs of the coinbase transaction has script pub key starting with 0x6a24aa21a9ed, - // and the rest of the script pub key is the commitment of witness data. - if !completeness_proof.is_empty() { - let coinbase_tx = &inclusion_proof.coinbase_tx; - // If there are more than one scriptPubKey matching the pattern, - // the one with highest output index is assumed to be the commitment. - // That is why the iterator is reversed. - let commitment_idx = coinbase_tx.output.iter().rev().position(|output| { - output - .script_pubkey - .to_bytes() - .starts_with(&[0x6a, 0x24, 0xaa, 0x21, 0xa9, 0xed]) - }); - match commitment_idx { - // If commitmet does not exist - None => { - // Relevant txs should be empty if there is no wtiness data because data is inscribed in the witness - if !blobs.is_empty() { - return Err(ValidationError::InvalidBlock); - } - // Check if all the wtxids are equal to txids - for (wtxid, txid) in inclusion_proof - .wtxids - .iter() - .zip(inclusion_proof.txids.iter()) - { - if wtxid != txid { - return Err(ValidationError::InvalidSegWitCommitment); - } - } - } - Some(mut commitment_idx) => { - let wtxids = inclusion_proof - .wtxids - .iter() - .copied() - .map(Txid::from_byte_array); - - let merkle_root = merkle_tree::calculate_root(wtxids).unwrap(); - - let input_witness_value = coinbase_tx.input[0].witness.iter().next().unwrap(); - - let mut vec_merkle = merkle_root.to_byte_array().to_vec(); - - vec_merkle.extend_from_slice(input_witness_value); - - // check with sha256(sha256()) - let commitment = sha256d::Hash::hash(&vec_merkle); - - // check if the commitment is correct - // on signet there is an additional commitment after the segwit commitment - // so we check only the first 32 bytes after commitment header (bytes [2, 5]) - commitment_idx = coinbase_tx.output.len() - commitment_idx - 1; // The index is reversed - let script_pubkey = coinbase_tx.output[commitment_idx].script_pubkey.to_bytes(); - if script_pubkey[6..38] != *commitment.as_byte_array() { - return Err(ValidationError::NonMatchingScript); - } - } - } - } - // create hash set of blobs let mut blobs_iter = blobs.iter(); - let mut inclusion_iter = inclusion_proof.txids.iter(); + let mut inclusion_iter = inclusion_proof + .txids + .iter() + .zip(inclusion_proof.wtxids.iter()); let prefix = self.reveal_tx_id_prefix.as_slice(); // Check starting bytes tx that parsed correctly is in blobs - let mut completeness_tx_hashes = HashSet::new(); + let mut completeness_tx_hashes = BTreeSet::new(); for (index_completeness, tx) in completeness_proof.iter().enumerate() { let txid = tx.txid().to_byte_array(); - // make sure it starts with the correct prefix if !txid.starts_with(prefix) { return Err(ValidationError::NonRelevantTxInProof); } + let wtxid = tx.wtxid(); + let wtxid = wtxid.as_byte_array(); + // make sure completeness txs are ordered same in inclusion proof // this logic always start seaching from the last found index // ordering should be preserved naturally - let is_found_in_block = inclusion_iter.any(|&txid_in_proof| txid_in_proof == txid); - - // assert tx is included in inclusion proof, thus in block + let is_found_in_block = + inclusion_iter.any(|(txid_inc, wtxid_inc)| *txid_inc == txid && wtxid_inc == wtxid); if !is_found_in_block { return Err(ValidationError::RelevantTxNotFoundInBlock); } @@ -246,27 +179,85 @@ impl DaVerifier for BitcoinVerifier { return Err(ValidationError::NonRelevantTxInProof); } - let tx_root = block_header.merkle_root(); + // verify that one of the outputs of the coinbase transaction has script pub key starting with 0x6a24aa21a9ed, + // and the rest of the script pub key is the commitment of witness data. + if !completeness_proof.is_empty() { + let coinbase_tx = &inclusion_proof.coinbase_tx; + // If there are more than one scriptPubKey matching the pattern, + // the one with highest output index is assumed to be the commitment. + // That is why the iterator is reversed. + let commitment_idx = coinbase_tx.output.iter().rev().position(|output| { + output + .script_pubkey + .as_bytes() + .starts_with(WITNESS_COMMITMENT_PREFIX) + }); + match commitment_idx { + // If commitmet does not exist + None => { + // Relevant txs should be empty if there is no wtiness data because data is inscribed in the witness + if !blobs.is_empty() { + return Err(ValidationError::InvalidBlock); + } + // Check if all the wtxids are equal to txids + for (wtxid, txid) in inclusion_proof + .wtxids + .iter() + .zip(inclusion_proof.txids.iter()) + { + if wtxid != txid { + return Err(ValidationError::InvalidSegWitCommitment); + } + } + } + Some(mut commitment_idx) => { + let wtxids = inclusion_proof + .wtxids + .iter() + .map(|wtxid| Txid::from_byte_array(*wtxid)); - // Inclusion proof is all the txs in the block. - let tx_hashes = inclusion_proof - .txids - .iter() - .map(|tx| Txid::from_slice(tx).unwrap()) - .collect::>(); + let merkle_root = merkle_tree::calculate_root(wtxids).unwrap(); + + let input_witness_value = coinbase_tx.input[0].witness.iter().next().unwrap(); + + let mut vec_merkle = merkle_root.as_byte_array().to_vec(); + + vec_merkle.extend_from_slice(input_witness_value); - if let Some(root_from_inclusion) = merkle_tree::calculate_root(tx_hashes.into_iter()) { - let root_from_inclusion = root_from_inclusion.to_raw_hash().to_byte_array(); + // check with sha256(sha256()) + let commitment = sha256d::Hash::hash(&vec_merkle); - // Check that the tx root in the block header matches the tx root in the inclusion proof. - if root_from_inclusion != tx_root { - return Err(ValidationError::IncorrectInclusionProof); + // check if the commitment is correct + // on signet there is an additional commitment after the segwit commitment + // so we check only the first 32 bytes after commitment header (bytes [2, 5]) + commitment_idx = coinbase_tx.output.len() - commitment_idx - 1; // The index is reversed + let script_pubkey = coinbase_tx.output[commitment_idx].script_pubkey.as_bytes(); + if script_pubkey[6..38] != *commitment.as_byte_array() { + return Err(ValidationError::NonMatchingScript); + } + } } + } + + let tx_root = block_header.merkle_root(); + + // Inclusion proof is all the txs in the block. + let tx_hashes = inclusion_proof.txids.into_iter().map(Txid::from_byte_array); + + let Some(root_from_inclusion) = merkle_tree::calculate_root(tx_hashes) else { + return Err(ValidationError::FailedToCalculateMerkleRoot); + }; - Ok(validity_condition) - } else { - Err(ValidationError::FailedToCalculateMerkleRoot) + let root_from_inclusion = root_from_inclusion.to_raw_hash().to_byte_array(); + // Check that the tx root in the block header matches the tx root in the inclusion proof. + if root_from_inclusion != tx_root { + return Err(ValidationError::IncorrectInclusionProof); } + + Ok(ChainValidityCondition { + prev_hash: block_header.prev_hash().to_byte_array(), + block_hash: block_header.block_hash().to_byte_array(), + }) } } @@ -295,7 +286,7 @@ mod tests { use crate::spec::proof::InclusionMultiProof; use crate::spec::transaction::TransactionWrapper; use crate::spec::RollupParams; - use crate::verifier::{ChainValidityCondition, ValidationError}; + use crate::verifier::{ChainValidityCondition, ValidationError, WITNESS_COMMITMENT_PREFIX}; #[test] fn correct() { @@ -353,7 +344,7 @@ mod tests { output .script_pubkey .to_bytes() - .starts_with(&[0x6a, 0x24, 0xaa, 0x21, 0xa9, 0xed]) + .starts_with(WITNESS_COMMITMENT_PREFIX) }); assert!(idx.is_none()); @@ -511,7 +502,7 @@ mod tests { output .script_pubkey .to_bytes() - .starts_with(&[0x6a, 0x24, 0xaa, 0x21, 0xa9, 0xed]) + .starts_with(WITNESS_COMMITMENT_PREFIX) }) .unwrap(); diff --git a/crates/risc0-bonsai/src/host.rs b/crates/risc0-bonsai/src/host.rs index ae83086f1..663b8720e 100644 --- a/crates/risc0-bonsai/src/host.rs +++ b/crates/risc0-bonsai/src/host.rs @@ -14,7 +14,7 @@ use risc0_zkvm::{ }; use sov_risc0_adapter::guest::Risc0Guest; use sov_rollup_interface::zk::{Proof, Zkvm, ZkvmHost}; -use tracing::{debug, error, instrument, trace, warn}; +use tracing::{debug, error, info, instrument, trace, warn}; /// Requests to bonsai client. Each variant represents its own method. #[derive(Clone)] @@ -342,6 +342,8 @@ impl<'a> ZkvmHost for Risc0BonsaiHost<'a> { // For running in "execute" mode. let buf = borsh::to_vec(&item).expect("Risc0 hint serialization is infallible"); + info!("Added hint to guest with size {}", buf.len()); + // write buf self.env.extend_from_slice(&buf); @@ -412,6 +414,15 @@ impl<'a> ZkvmHost for Risc0BonsaiHost<'a> { .expect("API error, missing receipt on completed session"); tracing::info!("Receipt URL: {}", receipt_url); + if let Some(stats) = res.stats { + tracing::info!( + "User cycles: {} - Total cycles: {} - Segments: {}", + stats.cycles, + stats.total_cycles, + stats.segments, + ); + } + let receipt_buf = client.download(receipt_url); let receipt: Receipt = bincode::deserialize(&receipt_buf).unwrap(); diff --git a/docs/run.md b/docs/run.md index 5f59e44ce..7e51f959c 100644 --- a/docs/run.md +++ b/docs/run.md @@ -3,10 +3,13 @@ This document covers how to run Citrea sequencer and a full node locally using a mock DA layer and Bitcoin Regtest. ## Prerequisites + Follow the instructions in [this document.](./dev-setup.md) ## Building and running + Build citrea: + ```sh make build ``` @@ -21,12 +24,15 @@ If running Postgres is prefered, you can execute the following command: docker compose -f docker-compose.postgres.yml up -d ``` + this will run postgres in a dockerized daemon mode. ### Run on Mock DA + Run on a local da layer, sharable between nodes that run on your computer. Run sequencer on Mock DA: + ```sh ./target/debug/citrea --da-layer mock --rollup-config-path resources/configs/mock/sequencer_rollup_config.toml --sequencer-config-path resources/configs/mock/sequencer_config.toml --genesis-paths resources/genesis/mock/ ``` @@ -34,6 +40,7 @@ Run sequencer on Mock DA: Sequencer RPC is accessible at `127.0.0.1:12345` _Optional_: Run full node on Mock DA: + ```sh ./target/debug/citrea --rollup-config-path resources/configs/mock/sequencer_rollup_config.toml --genesis-paths resources/test-data/demo-tests/mock ``` @@ -41,6 +48,7 @@ _Optional_: Run full node on Mock DA: Full node RPC is accessible at `127.0.0.1:12346` If test_mode is set to false in the sequencer config, the sequencer will publish blocks every 2 seconds. To also publish mock DA blocks, run this script: + ```sh ./configs/mock-dockerized/publish_da_block.sh ``` @@ -50,18 +58,22 @@ If test_mode is set to false in the sequencer config, the sequencer will publish Run on local Bitcoin network. Run Bitcoin Regtest: + ```sh bitcoind -regtest -txindex=1 ``` + Keep this terminal open. Create bitcoin wallet for Bitcoin DA adapter. + ```sh bitcoin-cli -regtest createwallet citreatesting bitcoin-cli -regtest loadwallet citreatesting ``` Mine blocks so that the wallet has BTC: + ```sh bitcoin-cli -regtest -generate 201 ``` @@ -74,11 +86,12 @@ Edit `resources/configs/bitcoin-regtest/sequencer_rollup_config.toml` and `resou node_url = "" # fill here node_username = "" -# fill here +# fill here node_password = "" ``` Run sequencer: + ```sh ./target/debug/citrea --da-layer bitcoin --rollup-config-path resources/configs/bitcoin-regtest/sequencer_rollup_config.toml --sequencer-config-path resources/configs/bitcoin-regtest/sequencer_config.toml --genesis-paths resources/genesis/bitcoin-regtest/ ``` @@ -88,16 +101,25 @@ Sequencer RPC is accessible at `127.0.0.1:12345` _Optional_: Run full node Run full node: + ```sh ./target/debug/citrea --da-layer bitcoin --rollup-config-path resources/configs/bitcoin-regtest/rollup_config.toml --genesis-paths resources/genesis/bitcoin-regtest/ ``` Full node RPC is accessible at `127.0.0.1:12346` -To publish blocks on Bitcoin Regtest, run the sequencer with `test_mode` in sequencer config set to false and blocks will be published every two seconds. +_Optional_: Run prover: + +```sh +./target/debug/citrea --da-layer bitcoin --rollup-config-path resources/configs/bitcoin-regtest/prover_rollup_config.toml --prover-config-path resources/configs/bitcoin-regtest/prover_config.toml --genesis-paths resources/genesis/bitcoin-regtest +``` + +If you want to test proofs, make sure to set `proof_sampling_number` in `resources/configs/bitcion-regtest/prover_config.toml` to 0, and you can lower the `min_soft_confirmations_per_commitment` to a number between 5-50, as higher numbers than that takes too long even if you run the prover in execute mode. +To publish blocks on Bitcoin Regtest, run the sequencer with `test_mode` in sequencer config set to false and blocks will be published every two seconds. To delete sequencer or full nodes databases run: + ```sh make clean-node ``` @@ -105,7 +127,9 @@ make clean-node ## Testing To run tests: + ```sh make test ``` + This will run [`cargo nextest`](https://nexte.st). From 70e19befa3b8fb663e967dcfd0e935552f7d2af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Yaz=C4=B1c=C4=B1?= <75089142+yaziciahmet@users.noreply.github.com> Date: Fri, 9 Aug 2024 14:36:36 +0300 Subject: [PATCH 21/23] Enable fast feature for ed25519-dalek (#968) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ahmet Yazıcı --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 9d09cbee0..5683b8890 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -152,7 +152,7 @@ alloy-primitives = { version = "0.7.6", default-features = false } alloy-sol-types = { version = "0.7.6", default-features = false, features = ["json"] } alloy = { git = "https://github.com/alloy-rs/alloy", rev = "77c1240", default-features = false } -ed25519-dalek = { version = "2", default-features = false, features = ["serde"] } +ed25519-dalek = { version = "2", default-features = false, features = ["serde", "fast"] } secp256k1 = { version = "0.28.2", default-features = false, features = ["global-context", "recovery"] } tower-http = { version = "0.4.0", features = ["full"] } From 0ab85c2f6524ea6eca766a9d5502b669a3c784ea Mon Sep 17 00:00:00 2001 From: Rakan Al-Huneiti Date: Sun, 11 Aug 2024 12:27:44 +0300 Subject: [PATCH 22/23] Fork Manager (#922) * Fork Manager * Pass around fork manager * Implement ForkMigration for ledgerDB * Commit missing files * Move SpecId to sov interface * Pass SpecID around * Cleanups * Register block with fork manager * Pass active fork down to verifier * Add type alias * Register block with fullnode and prover * Invoke spec_activated callback * Fix comments * Fix tests * Fix send / sync issue * Fix too many arguments * Set default fork specs * Log fork activation * Use forks instead of config * Remove activated config * Remove fork_specs from config * Mark FORKS as pub crate * Clippy * Deref instead of clone * Clippy again * Update current_spec inside guest code * Fix lints * Fix prover tests * Remove dummy forks * Add fork manager tests * Pass current_spec to HookSoftConfirmationInfo * Add current_spec to RuntimeTxHook * Fix test compilation * Fix nostd checks * Allow module inception * Fix clippy warning * Pass specId to dispatch_call * Fix module dispatch tests * Store SpecId directly * Fix rpc tests * Remove need for lazy_static * Fix macros RPC tests --- Cargo.lock | 9 +- Cargo.toml | 1 + .../provers/risc0/guest-bitcoin/Cargo.lock | 3 + .../risc0/guest-bitcoin/src/bin/bitcoin_da.rs | 1 - .../provers/risc0/guest-mock/Cargo.lock | 11 + bin/citrea/src/rollup/mod.rs | 47 +- crates/citrea-stf/Cargo.toml | 1 + crates/citrea-stf/src/hooks_impl.rs | 6 +- crates/citrea-stf/src/verifier.rs | 2 + crates/evm/Cargo.toml | 1 + crates/evm/src/tests/call_tests.rs | 12 + .../tests/ef_tests/cases/blockchain_test.rs | 2 + crates/evm/src/tests/hooks_tests.rs | 9 + .../evm/src/tests/queries/evm_call_tests.rs | 2 + crates/evm/src/tests/queries/log_tests.rs | 6 + crates/evm/src/tests/queries/mod.rs | 7 + crates/evm/src/tests/sys_tx_tests.rs | 8 + crates/evm/src/tests/utils.rs | 2 + crates/fullnode/src/runner.rs | 13 +- crates/fullnode/tests/hash_stf.rs | 9 + .../tests/runner_initialization_tests.rs | 6 + crates/fullnode/tests/runner_reorg_tests.rs | 6 + crates/primitives/Cargo.toml | 14 +- crates/primitives/src/error.rs | 4 +- crates/primitives/src/fork/manager.rs | 83 +++ crates/primitives/src/fork/migration.rs | 16 + crates/primitives/src/fork/mod.rs | 7 + crates/primitives/src/fork/tests.rs | 64 ++ crates/primitives/src/forks.rs | 10 + crates/primitives/src/lib.rs | 2 + crates/primitives/src/types.rs | 1 + crates/prover/src/runner.rs | 9 + crates/sequencer/src/sequencer.rs | 28 +- .../Cargo.toml | 1 + .../src/tests/hooks_tests.rs | 80 ++- .../src/tests/query_tests.rs | 26 +- .../examples/demo-simple-stf/src/lib.rs | 4 + .../demo-simple-stf/tests/stf_test.rs | 2 + .../examples/demo-stf/src/hooks_impl.rs | 6 +- .../full-node/db/sov-db/Cargo.toml | 31 +- .../full-node/db/sov-db/src/ledger_db/mod.rs | 21 +- .../db/sov-db/src/ledger_db/traits.rs | 4 + .../full-node/db/sov-db/src/schema/tables.rs | 7 + .../sov-sequencer/src/batch_builder.rs | 14 +- .../full-node/sov-sequencer/src/lib.rs | 5 +- .../full-node/sov-stf-runner/Cargo.toml | 1 + .../full-node/sov-stf-runner/src/mock/mod.rs | 4 + .../sov-modules-api/src/hooks.rs | 5 + .../sov-modules-core/src/module/dispatch.rs | 2 + .../sov-modules-macros/Cargo.toml | 10 +- .../src/dispatch/dispatch_call.rs | 1 + .../tests/dispatch/derive_dispatch.rs | 5 +- .../expose_rpc_associated_type_not_static.rs | 3 +- ...pose_rpc_associated_type_not_static.stderr | 6 +- .../tests/rpc/expose_rpc_associated_types.rs | 3 +- .../rpc/expose_rpc_associated_types_nested.rs | 3 +- .../expose_rpc_first_generic_not_context.rs | 3 +- ...xpose_rpc_first_generic_not_context.stderr | 578 +++++++++--------- .../sov-modules-stf-blueprint/Cargo.toml | 45 +- .../sov-modules-stf-blueprint/src/lib.rs | 59 +- .../src/stf_blueprint.rs | 19 +- .../sovereign-sdk/rollup-interface/Cargo.toml | 1 + .../sovereign-sdk/rollup-interface/Makefile | 2 +- .../sovereign-sdk/rollup-interface/src/lib.rs | 3 + .../src/node/services/batch_builder.rs | 4 +- .../rollup-interface/src/spec.rs | 56 ++ .../rollup-interface/src/state_machine/stf.rs | 5 + 67 files changed, 1021 insertions(+), 400 deletions(-) create mode 100644 crates/primitives/src/fork/manager.rs create mode 100644 crates/primitives/src/fork/migration.rs create mode 100644 crates/primitives/src/fork/mod.rs create mode 100644 crates/primitives/src/fork/tests.rs create mode 100644 crates/primitives/src/forks.rs create mode 100644 crates/sovereign-sdk/rollup-interface/src/spec.rs diff --git a/Cargo.lock b/Cargo.lock index d686c1f42..838de227b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1871,6 +1871,7 @@ dependencies = [ "serde_json", "sov-modules-api", "sov-prover-storage-manager", + "sov-rollup-interface", "sov-state", "tempfile", "thiserror", @@ -1919,9 +1920,10 @@ dependencies = [ "anyhow", "backoff", "lru", - "sov-db", + "serde", "sov-rollup-interface", "tokio", + "tracing", ] [[package]] @@ -2038,6 +2040,7 @@ dependencies = [ "anyhow", "borsh", "citrea-evm", + "citrea-primitives", "clap", "hex", "jsonrpsee", @@ -8556,6 +8559,7 @@ dependencies = [ "bincode", "borsh", "byteorder", + "citrea-primitives", "criterion", "hex", "jmt", @@ -8715,6 +8719,7 @@ dependencies = [ "serde_json", "sov-modules-api", "sov-modules-core", + "sov-rollup-interface", "sov-state", "syn 1.0.109", "trybuild", @@ -8749,6 +8754,7 @@ version = "0.4.0-rc.3" dependencies = [ "anyhow", "borsh", + "citrea-primitives", "hex", "itertools 0.13.0", "jmt", @@ -8960,6 +8966,7 @@ dependencies = [ "anyhow", "async-trait", "borsh", + "citrea-primitives", "futures", "hex", "hyper 0.14.29", diff --git a/Cargo.toml b/Cargo.toml index 5683b8890..ddd892f3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -93,6 +93,7 @@ futures = "0.3" pin-project = { version = "1.1.3" } hashbrown = { version = "0.14", default-features = false, features = ["ahash"] } hex = { version = "0.4.3", default-features = false, features = ["alloc", "serde"] } +lazy_static = { version = "1.5.0" } log-panics = { version = "2", features = ["with-backtrace"] } once_cell = { version = "1.19.0", default-features = false, features = ["alloc"] } prometheus = { version = "0.13.3", default-features = false } diff --git a/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock b/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock index 82160a931..a97330c84 100644 --- a/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock +++ b/bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock @@ -904,6 +904,7 @@ dependencies = [ "anyhow", "borsh", "citrea-evm", + "citrea-primitives", "hex", "secp256k1", "serde", @@ -3101,6 +3102,7 @@ version = "0.4.0-rc.3" dependencies = [ "anyhow", "borsh", + "citrea-primitives", "hex", "itertools 0.13.0", "jmt", @@ -3171,6 +3173,7 @@ version = "0.4.0-rc.3" dependencies = [ "anyhow", "borsh", + "citrea-primitives", "hex", "num_cpus", "serde", diff --git a/bin/citrea/provers/risc0/guest-bitcoin/src/bin/bitcoin_da.rs b/bin/citrea/provers/risc0/guest-bitcoin/src/bin/bitcoin_da.rs index 637ef1636..13634cae1 100644 --- a/bin/citrea/provers/risc0/guest-bitcoin/src/bin/bitcoin_da.rs +++ b/bin/citrea/provers/risc0/guest-bitcoin/src/bin/bitcoin_da.rs @@ -1,7 +1,6 @@ #![no_main] use bitcoin_da::spec::RollupParams; use bitcoin_da::verifier::BitcoinVerifier; - use citrea_primitives::{DA_TX_ID_LEADING_ZEROS, ROLLUP_NAME}; use citrea_stf::runtime::Runtime; use citrea_stf::StfVerifier; diff --git a/bin/citrea/provers/risc0/guest-mock/Cargo.lock b/bin/citrea/provers/risc0/guest-mock/Cargo.lock index 42f4783ec..8bfe5df05 100644 --- a/bin/citrea/provers/risc0/guest-mock/Cargo.lock +++ b/bin/citrea/provers/risc0/guest-mock/Cargo.lock @@ -777,6 +777,14 @@ dependencies = [ "thiserror", ] +[[package]] +name = "citrea-primitives" +version = "0.4.0-rc.3" +dependencies = [ + "anyhow", + "sov-rollup-interface", +] + [[package]] name = "citrea-stf" version = "0.4.0-rc.3" @@ -784,6 +792,7 @@ dependencies = [ "anyhow", "borsh", "citrea-evm", + "citrea-primitives", "hex", "secp256k1", "serde", @@ -2893,6 +2902,7 @@ version = "0.4.0-rc.3" dependencies = [ "anyhow", "borsh", + "citrea-primitives", "hex", "itertools 0.13.0", "jmt", @@ -2963,6 +2973,7 @@ version = "0.4.0-rc.3" dependencies = [ "anyhow", "borsh", + "citrea-primitives", "hex", "num_cpus", "serde", diff --git a/bin/citrea/src/rollup/mod.rs b/bin/citrea/src/rollup/mod.rs index d513ea322..809dffa06 100644 --- a/bin/citrea/src/rollup/mod.rs +++ b/bin/citrea/src/rollup/mod.rs @@ -1,20 +1,26 @@ +use anyhow::anyhow; use async_trait::async_trait; -pub use bitcoin::*; use citrea_fullnode::{CitreaFullnode, FullNode}; +use citrea_primitives::fork::ForkManager; +use citrea_primitives::forks::FORKS; use citrea_prover::{CitreaProver, Prover}; use citrea_sequencer::{CitreaSequencer, Sequencer, SequencerConfig}; -pub use mock::*; use sov_db::ledger_db::SharedLedgerOps; +use sov_db::schema::types::BatchNumber; use sov_modules_api::storage::HierarchicalStorageManager; use sov_modules_api::Spec; use sov_modules_rollup_blueprint::RollupBlueprint; use sov_modules_stf_blueprint::{Runtime as RuntimeTrait, StfBlueprint}; +use sov_rollup_interface::spec::SpecId; use sov_state::storage::NativeStorage; use sov_stf_runner::{FullNodeConfig, InitVariant, ProverConfig}; use tokio::sync::broadcast; use tracing::instrument; + mod bitcoin; mod mock; +pub use bitcoin::*; +pub use mock::*; /// Overrides RollupBlueprint methods #[async_trait] @@ -79,6 +85,18 @@ pub trait CitreaRollupBlueprint: RollupBlueprint { }, }; + let current_l2_height = ledger_db + .get_head_soft_batch() + .map_err(|e| anyhow!("Failed to get head soft batch: {}", e))? + .map(|(l2_height, _)| l2_height) + .unwrap_or(BatchNumber(0)); + + let active_spec: SpecId = ledger_db.get_active_fork()?; + + let mut fork_manager = + ForkManager::new(current_l2_height.into(), active_spec, FORKS.to_vec()); + fork_manager.register_handler(Box::new(ledger_db.clone())); + let seq = CitreaSequencer::new( da_service, prover_storage, @@ -89,6 +107,7 @@ pub trait CitreaRollupBlueprint: RollupBlueprint { rollup_config.public_keys, ledger_db, rollup_config.rpc, + fork_manager, soft_confirmation_tx, ) .unwrap(); @@ -161,6 +180,17 @@ pub trait CitreaRollupBlueprint: RollupBlueprint { let code_commitment = self.get_code_commitment(); + let current_l2_height = ledger_db + .get_head_soft_batch() + .map_err(|e| anyhow!("Failed to get head soft batch: {}", e))? + .map(|(l2_height, _)| l2_height) + .unwrap_or(BatchNumber(0)); + + let active_spec: SpecId = ledger_db.get_active_fork()?; + let mut fork_manager = + ForkManager::new(current_l2_height.into(), active_spec, FORKS.to_vec()); + fork_manager.register_handler(Box::new(ledger_db.clone())); + let runner = CitreaFullnode::new( runner_config, rollup_config.public_keys, @@ -172,6 +202,7 @@ pub trait CitreaRollupBlueprint: RollupBlueprint { init_variant, code_commitment, rollup_config.sync_blocks_count, + fork_manager, soft_confirmation_tx, )?; @@ -248,6 +279,17 @@ pub trait CitreaRollupBlueprint: RollupBlueprint { let code_commitment = self.get_code_commitment(); + let current_l2_height = ledger_db + .get_head_soft_batch() + .map_err(|e| anyhow!("Failed to get head soft batch: {}", e))? + .map(|(l2_height, _)| l2_height) + .unwrap_or(BatchNumber(0)); + + let active_spec: SpecId = ledger_db.get_active_fork()?; + let mut fork_manager = + ForkManager::new(current_l2_height.into(), active_spec, FORKS.to_vec()); + fork_manager.register_handler(Box::new(ledger_db.clone())); + let runner = CitreaProver::new( runner_config, rollup_config.public_keys, @@ -261,6 +303,7 @@ pub trait CitreaRollupBlueprint: RollupBlueprint { Some(prover_config), code_commitment, rollup_config.sync_blocks_count, + fork_manager, soft_confirmation_tx, )?; diff --git a/crates/citrea-stf/Cargo.toml b/crates/citrea-stf/Cargo.toml index 352303df6..e7aab2494 100644 --- a/crates/citrea-stf/Cargo.toml +++ b/crates/citrea-stf/Cargo.toml @@ -31,6 +31,7 @@ sov-state = { path = "../sovereign-sdk/module-system/sov-state" } sov-stf-runner = { path = "../sovereign-sdk/full-node/sov-stf-runner" } citrea-evm = { path = "../evm" } +citrea-primitives = { path = "../primitives" } soft-confirmation-rule-enforcer = { path = "../soft-confirmation-rule-enforcer" } [dev-dependencies] diff --git a/crates/citrea-stf/src/hooks_impl.rs b/crates/citrea-stf/src/hooks_impl.rs index 0482b1b07..fd19a4e4f 100644 --- a/crates/citrea-stf/src/hooks_impl.rs +++ b/crates/citrea-stf/src/hooks_impl.rs @@ -25,7 +25,11 @@ impl TxHooks for Runtime { working_set: &mut WorkingSet, arg: &RuntimeTxHook, ) -> anyhow::Result { - let RuntimeTxHook { height, sequencer } = arg; + let RuntimeTxHook { + height, + sequencer, + current_spec: _current_spec, + } = arg; let AccountsTxHook { sender, sequencer } = self.accounts .pre_dispatch_tx_hook(tx, working_set, sequencer)?; diff --git a/crates/citrea-stf/src/verifier.rs b/crates/citrea-stf/src/verifier.rs index ce1f004a6..20188bbf7 100644 --- a/crates/citrea-stf/src/verifier.rs +++ b/crates/citrea-stf/src/verifier.rs @@ -1,5 +1,6 @@ use std::marker::PhantomData; +use citrea_primitives::forks::FORKS; use sov_rollup_interface::da::{BlockHeaderTrait, DaVerifier}; use sov_rollup_interface::stf::StateTransitionFunction; use sov_rollup_interface::zk::{StateTransition, StateTransitionData, Zkvm, ZkvmGuest}; @@ -61,6 +62,7 @@ where data.da_block_headers_of_soft_confirmations, &validity_condition, data.soft_confirmations, + FORKS.to_vec(), ); println!("out of apply_soft_confirmations_from_sequencer_commitments"); diff --git a/crates/evm/Cargo.toml b/crates/evm/Cargo.toml index 727670892..59024981e 100644 --- a/crates/evm/Cargo.toml +++ b/crates/evm/Cargo.toml @@ -51,6 +51,7 @@ reth-provider = { workspace = true } revm = { workspace = true, features = ["optional_block_gas_limit", "optional_eip3607", "optional_no_base_fee"] } sov-modules-api = { path = "../sovereign-sdk/module-system/sov-modules-api", features = ["macros"] } sov-prover-storage-manager = { path = "../sovereign-sdk/full-node/sov-prover-storage-manager", features = ["test-utils"] } +sov-rollup-interface = { path = "../sovereign-sdk/rollup-interface", features = ["testing"] } tempfile = { workspace = true } tracing-subscriber = { workspace = true } walkdir = "2.3.3" diff --git a/crates/evm/src/tests/call_tests.rs b/crates/evm/src/tests/call_tests.rs index b1ba5140b..690b0dd2f 100644 --- a/crates/evm/src/tests/call_tests.rs +++ b/crates/evm/src/tests/call_tests.rs @@ -8,6 +8,7 @@ use sov_modules_api::default_context::DefaultContext; use sov_modules_api::hooks::HookSoftConfirmationInfo; use sov_modules_api::utils::generate_address; use sov_modules_api::{Context, Module, StateMapAccessor, StateVecAccessor}; +use sov_rollup_interface::spec::SpecId as SovSpecId; use crate::call::CallMessage; use crate::evm::primitive_types::Receipt; @@ -55,6 +56,7 @@ fn call_multiple_test() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -163,6 +165,7 @@ fn call_test() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -242,6 +245,7 @@ fn failed_transaction_test() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -299,6 +303,7 @@ fn self_destruct_test() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -359,6 +364,7 @@ fn self_destruct_test() { da_slot_height: 2, da_slot_txs_commitment: [42u8; 32], pre_state_root: [99u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -440,6 +446,7 @@ fn test_block_hash_in_evm() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -475,6 +482,7 @@ fn test_block_hash_in_evm() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [99u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -551,6 +559,7 @@ fn test_block_gas_limit() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -830,6 +839,7 @@ fn test_l1_fee_success() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -933,6 +943,7 @@ fn test_l1_fee_not_enough_funds() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -993,6 +1004,7 @@ fn test_l1_fee_halt() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, diff --git a/crates/evm/src/tests/ef_tests/cases/blockchain_test.rs b/crates/evm/src/tests/ef_tests/cases/blockchain_test.rs index 01887ea8f..31241731b 100644 --- a/crates/evm/src/tests/ef_tests/cases/blockchain_test.rs +++ b/crates/evm/src/tests/ef_tests/cases/blockchain_test.rs @@ -14,6 +14,7 @@ use sov_modules_api::hooks::HookSoftConfirmationInfo; use sov_modules_api::utils::generate_address; use sov_modules_api::{Context, StateMapAccessor, StateValueAccessor, WorkingSet}; use sov_prover_storage_manager::SnapshotManager; +use sov_rollup_interface::spec::SpecId as SovSpecId; use sov_state::{DefaultStorageSpec, ProverStorage}; use crate::primitive_types::Block; @@ -69,6 +70,7 @@ impl BlockchainTestCase { da_slot_height: 0, da_slot_txs_commitment: [0u8; 32], pre_state_root: root.to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 0, diff --git a/crates/evm/src/tests/hooks_tests.rs b/crates/evm/src/tests/hooks_tests.rs index 080f33daf..e2cc808a0 100644 --- a/crates/evm/src/tests/hooks_tests.rs +++ b/crates/evm/src/tests/hooks_tests.rs @@ -7,6 +7,7 @@ use reth_primitives::{ }; use sov_modules_api::hooks::HookSoftConfirmationInfo; use sov_modules_api::{StateMapAccessor, StateValueAccessor, StateVecAccessor}; +use sov_rollup_interface::spec::SpecId; use super::genesis_tests::{GENESIS_DA_TXS_COMMITMENT, TEST_CONFIG}; use crate::evm::primitive_types::{ @@ -31,6 +32,7 @@ fn begin_soft_confirmation_hook_creates_pending_block() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -66,6 +68,7 @@ fn end_soft_confirmation_hook_sets_head() { da_slot_height: 1, da_slot_txs_commitment: txs_commitment.into(), pre_state_root: pre_state_root.to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -141,6 +144,7 @@ fn end_soft_confirmation_hook_moves_transactions_and_receipts() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -246,6 +250,7 @@ fn finalize_hook_creates_final_block() { da_slot_height: 1, da_slot_txs_commitment: txs_commitment.into(), pre_state_root: root.to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -276,6 +281,7 @@ fn finalize_hook_creates_final_block() { da_slot_height: 1, da_slot_txs_commitment: txs_commitment.into(), pre_state_root: root_hash.to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -362,6 +368,7 @@ fn begin_soft_confirmation_hook_appends_last_block_hashes() { da_slot_height: 1, da_slot_txs_commitment: txs_commitment.into(), pre_state_root: root.to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -403,6 +410,7 @@ fn begin_soft_confirmation_hook_appends_last_block_hashes() { da_slot_height: 1, da_slot_txs_commitment: random_32_bytes, pre_state_root: random_32_bytes.to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -425,6 +433,7 @@ fn begin_soft_confirmation_hook_appends_last_block_hashes() { da_slot_height: 1, da_slot_txs_commitment: random_32_bytes, pre_state_root: random_32_bytes.to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, diff --git a/crates/evm/src/tests/queries/evm_call_tests.rs b/crates/evm/src/tests/queries/evm_call_tests.rs index f20deb838..ce6a91e49 100644 --- a/crates/evm/src/tests/queries/evm_call_tests.rs +++ b/crates/evm/src/tests/queries/evm_call_tests.rs @@ -7,6 +7,7 @@ use reth_rpc_types::request::{TransactionInput, TransactionRequest}; use revm::primitives::U256; use sov_modules_api::hooks::HookSoftConfirmationInfo; use sov_modules_api::WorkingSet; +use sov_rollup_interface::spec::SpecId; use super::C; use crate::smart_contracts::SimpleStorageContract; @@ -76,6 +77,7 @@ fn test_state_change() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, diff --git a/crates/evm/src/tests/queries/log_tests.rs b/crates/evm/src/tests/queries/log_tests.rs index 7edd3d268..75d8da5b7 100644 --- a/crates/evm/src/tests/queries/log_tests.rs +++ b/crates/evm/src/tests/queries/log_tests.rs @@ -8,6 +8,7 @@ use sov_modules_api::default_context::DefaultContext; use sov_modules_api::hooks::HookSoftConfirmationInfo; use sov_modules_api::utils::generate_address; use sov_modules_api::{Context, Module, StateVecAccessor}; +use sov_rollup_interface::spec::SpecId; use crate::call::CallMessage; use crate::smart_contracts::LogsContract; @@ -71,6 +72,7 @@ fn log_filter_test_at_block_hash() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, @@ -277,6 +279,7 @@ fn log_filter_test_with_range() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, @@ -338,6 +341,7 @@ fn log_filter_test_with_range() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [99u8; 32].to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, @@ -399,6 +403,7 @@ fn test_log_limits() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, @@ -499,6 +504,7 @@ fn test_log_limits() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [99u8; 32].to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, diff --git a/crates/evm/src/tests/queries/mod.rs b/crates/evm/src/tests/queries/mod.rs index ebd0a7c33..e8b8e402d 100644 --- a/crates/evm/src/tests/queries/mod.rs +++ b/crates/evm/src/tests/queries/mod.rs @@ -11,6 +11,7 @@ use sov_modules_api::default_context::DefaultContext; use sov_modules_api::hooks::HookSoftConfirmationInfo; use sov_modules_api::utils::generate_address; use sov_modules_api::{Context, Module, WorkingSet}; +use sov_rollup_interface::spec::SpecId as SovSpecId; use crate::call::CallMessage; use crate::smart_contracts::{ @@ -67,6 +68,7 @@ fn init_evm() -> (Evm, WorkingSet, TestSigner) { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, @@ -107,6 +109,7 @@ fn init_evm() -> (Evm, WorkingSet, TestSigner) { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [99u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, @@ -148,6 +151,7 @@ fn init_evm() -> (Evm, WorkingSet, TestSigner) { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [100u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, @@ -224,6 +228,7 @@ pub fn init_evm_single_block() -> (Evm, WorkingSet, TestSigner) { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [0u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, @@ -295,6 +300,7 @@ pub fn init_evm_with_caller_contract() -> (Evm, WorkingSet, TestSigner) { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [0u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, @@ -334,6 +340,7 @@ pub fn init_evm_with_caller_contract() -> (Evm, WorkingSet, TestSigner) { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [2u8; 32].to_vec(), + current_spec: SovSpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, diff --git a/crates/evm/src/tests/sys_tx_tests.rs b/crates/evm/src/tests/sys_tx_tests.rs index 5ce4dffec..a613fc553 100644 --- a/crates/evm/src/tests/sys_tx_tests.rs +++ b/crates/evm/src/tests/sys_tx_tests.rs @@ -10,6 +10,7 @@ use sov_modules_api::default_context::DefaultContext; use sov_modules_api::hooks::HookSoftConfirmationInfo; use sov_modules_api::utils::generate_address; use sov_modules_api::{Context, Module, StateMapAccessor, StateVecAccessor}; +use sov_rollup_interface::spec::SpecId; use crate::call::CallMessage; use crate::evm::primitive_types::Receipt; @@ -144,6 +145,7 @@ fn test_sys_bitcoin_light_client() { da_slot_height: 2, da_slot_txs_commitment: [3u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -280,6 +282,7 @@ fn test_sys_tx_gas_usage_effect_on_block_gas_limit() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, @@ -311,6 +314,7 @@ fn test_sys_tx_gas_usage_effect_on_block_gas_limit() { da_slot_height: 2, da_slot_txs_commitment: [43u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate, @@ -387,6 +391,7 @@ fn test_bridge() { 214, 251, 181, 122, 169, 246, 188, 29, 186, 32, 227, 33, 199, 38, ], pre_state_root: [1u8; 32].to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -521,6 +526,7 @@ fn test_upgrade_light_client() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, @@ -645,6 +651,7 @@ fn test_change_upgrade_owner() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, @@ -680,6 +687,7 @@ fn test_change_upgrade_owner() { da_slot_height: 1, da_slot_txs_commitment: [42u8; 32], pre_state_root: [10u8; 32].to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 1, diff --git a/crates/evm/src/tests/utils.rs b/crates/evm/src/tests/utils.rs index e6d79f724..6bd970124 100644 --- a/crates/evm/src/tests/utils.rs +++ b/crates/evm/src/tests/utils.rs @@ -5,6 +5,7 @@ use sov_modules_api::default_context::DefaultContext; use sov_modules_api::hooks::HookSoftConfirmationInfo; use sov_modules_api::{Module, WorkingSet}; use sov_prover_storage_manager::{new_orphan_storage, SnapshotManager}; +use sov_rollup_interface::spec::SpecId; use sov_state::{DefaultStorageSpec, ProverStorage, Storage}; use crate::{Evm, EvmConfig}; @@ -61,6 +62,7 @@ pub(crate) fn get_evm(config: &EvmConfig) -> (Evm, WorkingSet) { da_slot_height: 1, da_slot_txs_commitment: [2u8; 32], pre_state_root: root.to_vec(), + current_spec: SpecId::Genesis, pub_key: vec![], deposit_data: vec![], l1_fee_rate: 0, diff --git a/crates/fullnode/src/runner.rs b/crates/fullnode/src/runner.rs index 2f645d803..0f66eaba3 100644 --- a/crates/fullnode/src/runner.rs +++ b/crates/fullnode/src/runner.rs @@ -7,6 +7,7 @@ use anyhow::{anyhow, bail}; use backoff::future::retry as retry_backoff; use backoff::ExponentialBackoffBuilder; use borsh::de::BorshDeserialize; +use citrea_primitives::fork::{Fork, ForkManager}; use citrea_primitives::types::SoftConfirmationHash; use citrea_primitives::{get_da_block_at_height, L1BlockCache, SyncError}; use jsonrpsee::core::client::Error as JsonrpseeError; @@ -66,6 +67,7 @@ where accept_public_input_as_proven: bool, l1_block_cache: Arc>>, sync_blocks_count: u64, + fork_manager: ForkManager, soft_confirmation_tx: broadcast::Sender, } @@ -101,6 +103,7 @@ where init_variant: InitVariant, code_commitment: Vm::CodeCommitment, sync_blocks_count: u64, + fork_manager: ForkManager, soft_confirmation_tx: broadcast::Sender, ) -> Result { let (prev_state_root, prev_batch_hash) = match init_variant { @@ -152,6 +155,7 @@ where .unwrap_or(false), sync_blocks_count, l1_block_cache: Arc::new(Mutex::new(L1BlockCache::new())), + fork_manager, soft_confirmation_tx, }) } @@ -364,8 +368,8 @@ where if stored_soft_batches.len() < ((end_l2_height - start_l2_height) as usize) { return Err(SyncError::MissingL2( "L2 range not synced yet", - BatchNumber(start_l2_height), - BatchNumber(end_l2_height), + start_l2_height, + end_l2_height, )); } @@ -428,6 +432,7 @@ where .create_storage_on_l2_height(l2_height)?; let slot_result = self.stf.apply_soft_batch( + self.fork_manager.active_fork(), self.sequencer_pub_key.as_slice(), // TODO(https://github.com/Sovereign-Labs/sovereign-sdk/issues/1247): incorrect pre-state root in case of re-org &self.state_root, @@ -479,6 +484,10 @@ where BatchNumber(l2_height), )?; + // Register this new block with the fork manager to active + // the new fork on the next block. + self.fork_manager.register_block(l2_height)?; + // Only errors when there are no receivers let _ = self.soft_confirmation_tx.send(l2_height); diff --git a/crates/fullnode/tests/hash_stf.rs b/crates/fullnode/tests/hash_stf.rs index 50db11729..c4c3d7f76 100644 --- a/crates/fullnode/tests/hash_stf.rs +++ b/crates/fullnode/tests/hash_stf.rs @@ -7,6 +7,7 @@ use sov_modules_api::Context; use sov_modules_stf_blueprint::StfBlueprintTrait; use sov_prover_storage_manager::{new_orphan_storage, SnapshotManager}; use sov_rollup_interface::da::{BlobReaderTrait, BlockHeaderTrait, DaSpec}; +use sov_rollup_interface::spec::SpecId; use sov_rollup_interface::stf::{SlotResult, StateTransitionFunction}; use sov_rollup_interface::zk::{CumulativeStateDiff, ValidityCondition, Zkvm}; use sov_state::storage::{NativeStorage, StorageKey, StorageValue}; @@ -70,6 +71,7 @@ impl StfBlueprintTrai { fn begin_soft_batch( &self, + _current_spec: SpecId, _sequencer_public_key: &[u8], _pre_state_root: &Self::StateRoot, _pre_state: Self::PreState, @@ -85,6 +87,7 @@ impl StfBlueprintTrai fn apply_soft_batch_txs( &self, + _current_spec: SpecId, _txs: Vec>, _batch_workspace: sov_modules_api::WorkingSet, ) -> ( @@ -96,6 +99,7 @@ impl StfBlueprintTrai fn end_soft_batch( &self, + _current_spec: SpecId, _sequencer_public_key: &[u8], _soft_batch: &mut sov_modules_api::SignedSoftConfirmationBatch, _tx_receipts: Vec< @@ -111,6 +115,7 @@ impl StfBlueprintTrai fn finalize_soft_batch( &self, + _current_spec: SpecId, _batch_receipt: sov_modules_stf_blueprint::BatchReceipt< (), sov_modules_stf_blueprint::TxEffect, @@ -154,6 +159,7 @@ impl StateTransitionFunction( &self, + _current_spec: SpecId, pre_state_root: &Self::StateRoot, storage: Self::PreState, mut witness: Self::Witness, @@ -205,6 +211,7 @@ impl StateTransitionFunction StateTransitionFunction, >, + _forks: Vec<(SpecId, u64)>, ) -> (Self::StateRoot, CumulativeStateDiff) { todo!() } @@ -319,6 +327,7 @@ pub fn get_result_from_blocks( MockDaSpec, >>::apply_slot::<&mut Vec>( &stf, + SpecId::Genesis, &state_root, storage, ArrayWitness::default(), diff --git a/crates/fullnode/tests/runner_initialization_tests.rs b/crates/fullnode/tests/runner_initialization_tests.rs index 47d8145d3..012bf699a 100644 --- a/crates/fullnode/tests/runner_initialization_tests.rs +++ b/crates/fullnode/tests/runner_initialization_tests.rs @@ -1,10 +1,12 @@ use std::sync::Arc; use citrea_fullnode::CitreaFullnode; +use citrea_primitives::fork::ForkManager; use sov_db::ledger_db::LedgerDB; use sov_mock_da::{MockAddress, MockDaConfig, MockDaService, MockDaSpec, MockValidityCond}; use sov_mock_zkvm::{MockCodeCommitment, MockZkvm}; use sov_prover_storage_manager::ProverStorageManager; +use sov_rollup_interface::spec::SpecId; use sov_state::DefaultStorageSpec; use sov_stf_runner::{ FullNodeConfig, InitVariant, RollupPublicKeys, RpcConfig, RunnerConfig, StorageConfig, @@ -53,6 +55,7 @@ fn initialize_runner( sov_modules_api::default_context::DefaultContext, LedgerDB, > { + let specs = vec![(SpecId::Genesis, 0)]; let da_storage_path = storage_path.join("da").to_path_buf(); let rollup_storage_path = storage_path.join("rollup").to_path_buf(); @@ -109,6 +112,8 @@ fn initialize_runner( // let vm = MockZkvm::new(MockValidityCond::default()); // let verifier = MockDaVerifier::default(); + let fork_manager = ForkManager::new(0, SpecId::Genesis, specs); + CitreaFullnode::new( rollup_config.runner.unwrap(), rollup_config.public_keys, @@ -120,6 +125,7 @@ fn initialize_runner( init_variant, MockCodeCommitment([1u8; 32]), 10, + fork_manager, broadcast::channel(1).0, ) .unwrap() diff --git a/crates/fullnode/tests/runner_reorg_tests.rs b/crates/fullnode/tests/runner_reorg_tests.rs index f392bdb05..0eccada0d 100644 --- a/crates/fullnode/tests/runner_reorg_tests.rs +++ b/crates/fullnode/tests/runner_reorg_tests.rs @@ -1,12 +1,14 @@ use std::sync::Arc; use citrea_fullnode::CitreaFullnode; +use citrea_primitives::fork::ForkManager; use sov_mock_da::{ MockAddress, MockBlob, MockBlock, MockBlockHeader, MockDaConfig, MockDaService, MockDaSpec, MockValidityCond, PlannedFork, }; use sov_mock_zkvm::MockZkvm; use sov_modules_api::default_context::DefaultContext; +use sov_rollup_interface::spec::SpecId; use sov_stf_runner::{ FullNodeConfig, InitVariant, RollupPublicKeys, RpcConfig, RunnerConfig, StorageConfig, }; @@ -120,6 +122,7 @@ async fn runner_execution( init_variant: MockInitVariant, da_service: Arc, ) -> ([u8; 32], [u8; 32]) { + let specs = vec![(SpecId::Genesis, 0)]; let rollup_storage_path = storage_path.join("rollup").to_path_buf(); let rollup_config = FullNodeConfig:: { storage: StorageConfig { @@ -161,6 +164,8 @@ async fn runner_execution( }; let storage_manager = ProverStorageManager::new(storage_config).unwrap(); + let fork_manager = ForkManager::new(0, SpecId::Genesis, specs); + let mut runner: CitreaFullnode<_, _, _, _, DefaultContext, _> = CitreaFullnode::new( rollup_config.runner.unwrap(), rollup_config.public_keys, @@ -172,6 +177,7 @@ async fn runner_execution( init_variant, MockCodeCommitment([1u8; 32]), 10, + fork_manager, broadcast::channel(1).0, ) .unwrap(); diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 10b31e0c1..64a436e03 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -8,20 +8,26 @@ publish = false [dependencies] # Sov SDK deps -sov-db = { path = "../sovereign-sdk/full-node/db/sov-db", optional = true } sov-rollup-interface = { path = "../sovereign-sdk/rollup-interface" } # 3rd-party deps anyhow = { workspace = true } backoff = { workspace = true, optional = true } lru = { workspace = true, optional = true } +serde = { workspace = true, optional = true } tokio = { workspace = true, optional = true } +tracing = { workspace = true, optional = true } + +[dev-dependencies] +# Sov SDK deps +sov-rollup-interface = { path = "../sovereign-sdk/rollup-interface", features = ["testing"] } [features] native = [ + "dep:backoff", "dep:lru", - "sov-rollup-interface/native", - "sov-db", + "dep:serde", "dep:tokio", - "dep:backoff", + "dep:tracing", + "sov-rollup-interface/native", ] diff --git a/crates/primitives/src/error.rs b/crates/primitives/src/error.rs index 9b9635e83..da11e19c7 100644 --- a/crates/primitives/src/error.rs +++ b/crates/primitives/src/error.rs @@ -1,8 +1,8 @@ -use sov_db::schema::types::BatchNumber; +use crate::types::BlockNumber; #[derive(Debug)] pub enum SyncError { - MissingL2(&'static str, BatchNumber, BatchNumber), + MissingL2(&'static str, BlockNumber, BlockNumber), Error(anyhow::Error), } diff --git a/crates/primitives/src/fork/manager.rs b/crates/primitives/src/fork/manager.rs new file mode 100644 index 000000000..c8a5ac233 --- /dev/null +++ b/crates/primitives/src/fork/manager.rs @@ -0,0 +1,83 @@ +use std::collections::VecDeque; + +use sov_rollup_interface::spec::SpecId; +#[cfg(feature = "native")] +use tracing::info; + +use super::ForkMigration; + +/// Defines the interface which a fork manager needs to implement. +pub trait Fork { + /// Returns the currently active fork. + fn active_fork(&self) -> SpecId; + + /// Register a new L2 block with fork manager + fn register_block(&mut self, height: u64) -> anyhow::Result<()>; +} + +pub type SpecActivationBlockHeight = u64; + +pub struct ForkManager { + active_spec: SpecId, + specs: VecDeque<(SpecId, SpecActivationBlockHeight)>, + migration_handlers: Vec>, +} + +impl ForkManager { + pub fn new( + current_l2_height: u64, + active_spec: SpecId, + mut specs: Vec<(SpecId, SpecActivationBlockHeight)>, + ) -> Self { + // Filter out specs which have already been activated. + specs.retain(|(spec, block)| *spec != active_spec && *block > current_l2_height); + // Make sure the list of specs is sorted by the block number at which they activate. + specs.sort_by_key(|(_, block_number)| *block_number); + Self { + specs: specs.into(), + active_spec, + migration_handlers: vec![], + } + } + + pub fn register_handler(&mut self, handler: Box) { + self.migration_handlers.push(handler); + } +} + +impl Fork for ForkManager { + fn active_fork(&self) -> SpecId { + self.active_spec + } + + fn register_block(&mut self, height: u64) -> anyhow::Result<()> { + if let Some((new_spec, activation_block_height)) = self.specs.front() { + if height == *activation_block_height { + #[cfg(feature = "native")] + info!("Activating fork {:?} at height: {}", *new_spec, height); + + self.active_spec = *new_spec; + for handler in self.migration_handlers.iter() { + handler.spec_activated(self.active_spec)?; + } + self.specs.pop_front(); + } + } + Ok(()) + } +} + +/// Simple search for the fork to which a specific block number blongs. +/// This assumes that the list of forks is sorted by block number in ascending fashion. +pub fn fork_from_block_number(forks: &[(SpecId, u64)], block_number: u64) -> SpecId { + let mut fork = forks[0].0; + if forks.len() == 1 { + return fork; + } + for (spec_id, activation_block) in &forks[1..] { + if block_number >= *activation_block { + fork = *spec_id; + } + } + fork +} diff --git a/crates/primitives/src/fork/migration.rs b/crates/primitives/src/fork/migration.rs new file mode 100644 index 000000000..f87783e15 --- /dev/null +++ b/crates/primitives/src/fork/migration.rs @@ -0,0 +1,16 @@ +use sov_rollup_interface::spec::SpecId; + +/// Defines the interface of a migration +pub trait ForkMigration { + /// Invoked when a spec is activated. + fn spec_activated(&self, spec_id: SpecId) -> anyhow::Result<()>; +} + +pub struct NoOpMigration {} + +impl ForkMigration for NoOpMigration { + fn spec_activated(&self, _spec_id: SpecId) -> anyhow::Result<()> { + // Do nothing + Ok(()) + } +} diff --git a/crates/primitives/src/fork/mod.rs b/crates/primitives/src/fork/mod.rs new file mode 100644 index 000000000..b77cfcf7e --- /dev/null +++ b/crates/primitives/src/fork/mod.rs @@ -0,0 +1,7 @@ +mod manager; +mod migration; +#[cfg(test)] +mod tests; + +pub use manager::*; +pub use migration::*; diff --git a/crates/primitives/src/fork/tests.rs b/crates/primitives/src/fork/tests.rs new file mode 100644 index 000000000..802697963 --- /dev/null +++ b/crates/primitives/src/fork/tests.rs @@ -0,0 +1,64 @@ +use anyhow::anyhow; +use sov_rollup_interface::spec::SpecId; + +use super::{Fork, ForkManager}; +use crate::fork::{fork_from_block_number, ForkMigration}; + +#[test] +fn test_fork_from_block_number() { + let forks = vec![ + (SpecId::Genesis, 0), + (SpecId::Fork1, 100), + (SpecId::Fork2, 500), + ]; + + assert_eq!(fork_from_block_number(&forks, 5), SpecId::Genesis); + assert_eq!(fork_from_block_number(&forks, 105), SpecId::Fork1); + assert_eq!(fork_from_block_number(&forks, 350), SpecId::Fork1); + assert_eq!(fork_from_block_number(&forks, 505), SpecId::Fork2); +} + +#[test] +fn test_fork_manager() { + let forks = vec![ + (SpecId::Genesis, 0), + (SpecId::Fork1, 100), + (SpecId::Fork2, 500), + ]; + let mut fork_manager = ForkManager::new(0, SpecId::Genesis, forks); + fork_manager.register_block(5).unwrap(); + assert_eq!(fork_manager.active_fork(), SpecId::Genesis); + fork_manager.register_block(100).unwrap(); + assert_eq!(fork_manager.active_fork(), SpecId::Fork1); + fork_manager.register_block(350).unwrap(); + assert_eq!(fork_manager.active_fork(), SpecId::Fork1); + fork_manager.register_block(500).unwrap(); + assert_eq!(fork_manager.active_fork(), SpecId::Fork2); +} + +#[test] +fn test_fork_manager_callbacks() { + let forks = vec![ + (SpecId::Genesis, 0), + (SpecId::Fork1, 100), + (SpecId::Fork2, 500), + ]; + + struct Handler {} + impl ForkMigration for Handler { + fn spec_activated(&self, spec_id: SpecId) -> anyhow::Result<()> { + if spec_id == SpecId::Fork1 { + return Err(anyhow!("Called")); + } + Ok(()) + } + } + let handler = Box::new(Handler {}); + let mut fork_manager = ForkManager::new(0, SpecId::Genesis, forks); + fork_manager.register_handler(handler); + let result = fork_manager.register_block(100); + assert!(result.is_err()); + if let Err(msg) = result { + assert_eq!(msg.to_string(), "Called"); + } +} diff --git a/crates/primitives/src/forks.rs b/crates/primitives/src/forks.rs new file mode 100644 index 000000000..b5cba58db --- /dev/null +++ b/crates/primitives/src/forks.rs @@ -0,0 +1,10 @@ +use sov_rollup_interface::spec::SpecId; + +/// This defines the list of forks which will be activated +/// at specific heights. +pub const FORKS: [(SpecId, u64); 1] = [ + (SpecId::Genesis, 0), + // Examples of how we can define further forks + // (SpecId::Fork1, 100), + // (SpecId::Fork2, 200) +]; diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index dc53eab26..b91c008e1 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -5,6 +5,8 @@ mod constants; mod da; #[cfg(feature = "native")] mod error; +pub mod fork; +pub mod forks; pub mod types; #[cfg(feature = "native")] diff --git a/crates/primitives/src/types.rs b/crates/primitives/src/types.rs index 61d8239df..4158e59ba 100644 --- a/crates/primitives/src/types.rs +++ b/crates/primitives/src/types.rs @@ -1 +1,2 @@ pub type SoftConfirmationHash = [u8; 32]; +pub type BlockNumber = u64; diff --git a/crates/prover/src/runner.rs b/crates/prover/src/runner.rs index 16d16f42e..669b5b493 100644 --- a/crates/prover/src/runner.rs +++ b/crates/prover/src/runner.rs @@ -9,6 +9,7 @@ use anyhow::{anyhow, bail}; use backoff::exponential::ExponentialBackoffBuilder; use backoff::future::retry as retry_backoff; use borsh::de::BorshDeserialize; +use citrea_primitives::fork::{Fork, ForkManager}; use citrea_primitives::types::SoftConfirmationHash; use citrea_primitives::{get_da_block_at_height, L1BlockCache}; use jsonrpsee::core::client::Error as JsonrpseeError; @@ -73,6 +74,7 @@ where code_commitment: Vm::CodeCommitment, l1_block_cache: Arc>>, sync_blocks_count: u64, + fork_manager: ForkManager, soft_confirmation_tx: broadcast::Sender, } @@ -111,6 +113,7 @@ where prover_config: Option, code_commitment: Vm::CodeCommitment, sync_blocks_count: u64, + fork_manager: ForkManager, soft_confirmation_tx: broadcast::Sender, ) -> Result { let (prev_state_root, prev_batch_hash) = match init_variant { @@ -157,6 +160,7 @@ where code_commitment, l1_block_cache: Arc::new(Mutex::new(L1BlockCache::new())), sync_blocks_count, + fork_manager, soft_confirmation_tx, }) } @@ -332,6 +336,7 @@ where .create_storage_on_l2_height(l2_height)?; let slot_result = self.stf.apply_soft_batch( + self.fork_manager.active_fork(), self.sequencer_pub_key.as_slice(), // TODO(https://github.com/Sovereign-Labs/sovereign-sdk/issues/1247): incorrect pre-state root in case of re-org &self.state_root, @@ -386,6 +391,10 @@ where BatchNumber(l2_height), )?; + // Register this new block with the fork manager to active + // the new fork on the next block + self.fork_manager.register_block(l2_height)?; + // Only errors when there are no receivers let _ = self.soft_confirmation_tx.send(l2_height); diff --git a/crates/sequencer/src/sequencer.rs b/crates/sequencer/src/sequencer.rs index a40c62bb5..7e56adfb2 100644 --- a/crates/sequencer/src/sequencer.rs +++ b/crates/sequencer/src/sequencer.rs @@ -9,6 +9,7 @@ use std::vec; use anyhow::anyhow; use borsh::BorshDeserialize; use citrea_evm::{CallMessage, Evm, RlpEvmTransaction, MIN_TRANSACTION_GAS}; +use citrea_primitives::fork::{Fork, ForkManager}; use citrea_primitives::types::SoftConfirmationHash; use citrea_stf::runtime::Runtime; use digest::Digest; @@ -92,6 +93,7 @@ where rpc_config: RpcConfig, soft_confirmation_rule_enforcer: SoftConfirmationRuleEnforcer, last_state_diff: StateDiff, + fork_manager: ForkManager, soft_confirmation_tx: broadcast::Sender, } @@ -126,6 +128,7 @@ where public_keys: RollupPublicKeys, ledger_db: DB, rpc_config: RpcConfig, + fork_manager: ForkManager, soft_confirmation_tx: broadcast::Sender, ) -> anyhow::Result { let (l2_force_block_tx, l2_force_block_rx) = unbounded(); @@ -184,6 +187,7 @@ where rpc_config, soft_confirmation_rule_enforcer, last_state_diff, + fork_manager, soft_confirmation_tx, }) } @@ -267,6 +271,7 @@ where l2_block_mode: L2BlockMode, ) -> anyhow::Result<(Vec, Vec)> { match self.stf.begin_soft_batch( + self.fork_manager.active_fork(), pub_key, &self.state_root, prestate.clone(), @@ -303,9 +308,11 @@ where let txs = vec![signed_blob.clone()]; - let (batch_workspace, _) = self - .stf - .apply_soft_batch_txs(txs.clone(), working_set_to_discard); + let (batch_workspace, _) = self.stf.apply_soft_batch_txs( + self.fork_manager.active_fork(), + txs.clone(), + working_set_to_discard, + ); working_set_to_discard = batch_workspace; @@ -387,6 +394,7 @@ where da_slot_txs_commitment: da_block.header().txs_commitment().into(), pre_state_root: self.state_root.clone().as_ref().to_vec(), deposit_data: deposit_data.clone(), + current_spec: self.fork_manager.active_fork(), pub_key, l1_fee_rate, timestamp, @@ -428,6 +436,7 @@ where // Execute the selected transactions match self.stf.begin_soft_batch( + self.fork_manager.active_fork(), &pub_key, &self.state_root, prestate.clone(), @@ -443,8 +452,11 @@ where let signed_blob = self.make_blob(raw_message, &mut batch_workspace)?; let txs = vec![signed_blob.clone()]; - let (batch_workspace, tx_receipts) = - self.stf.apply_soft_batch_txs(txs.clone(), batch_workspace); + let (batch_workspace, tx_receipts) = self.stf.apply_soft_batch_txs( + self.fork_manager.active_fork(), + txs.clone(), + batch_workspace, + ); // create the unsigned batch with the txs then sign th sc let unsigned_batch = UnsignedSoftConfirmationBatch::new( @@ -461,6 +473,7 @@ where self.sign_soft_confirmation_batch(unsigned_batch, self.batch_hash)?; let (batch_receipt, checkpoint) = self.stf.end_soft_batch( + self.fork_manager.active_fork(), self.sequencer_pub_key.as_ref(), &mut signed_soft_batch, tx_receipts, @@ -469,6 +482,7 @@ where // Finalize soft confirmation let slot_result = self.stf.finalize_soft_batch( + self.fork_manager.active_fork(), batch_receipt, checkpoint, prestate, @@ -534,6 +548,10 @@ where BatchNumber(l2_height), )?; + // Register this new block with the fork manager to active + // the new fork on the next block + self.fork_manager.register_block(l2_height)?; + // Only errors when there are no receivers let _ = self.soft_confirmation_tx.send(l2_height); diff --git a/crates/soft-confirmation-rule-enforcer/Cargo.toml b/crates/soft-confirmation-rule-enforcer/Cargo.toml index dda909a5e..edac26036 100644 --- a/crates/soft-confirmation-rule-enforcer/Cargo.toml +++ b/crates/soft-confirmation-rule-enforcer/Cargo.toml @@ -28,6 +28,7 @@ lazy_static = "1.4.0" sov-mock-da = { path = "../sovereign-sdk/adapters/mock-da", features = ["native"] } sov-modules-api = { path = "../sovereign-sdk/module-system/sov-modules-api", features = ["native"] } sov-prover-storage-manager = { path = "../sovereign-sdk/full-node/sov-prover-storage-manager", features = ["test-utils"] } +sov-rollup-interface = { path = "../sovereign-sdk/rollup-interface", features = ["testing"] } tempfile = { workspace = true } [features] diff --git a/crates/soft-confirmation-rule-enforcer/src/tests/hooks_tests.rs b/crates/soft-confirmation-rule-enforcer/src/tests/hooks_tests.rs index 01e862ce1..8eb27a6a9 100644 --- a/crates/soft-confirmation-rule-enforcer/src/tests/hooks_tests.rs +++ b/crates/soft-confirmation-rule-enforcer/src/tests/hooks_tests.rs @@ -7,6 +7,7 @@ use sov_modules_api::hooks::HookSoftConfirmationInfo; use sov_modules_api::utils::generate_address; use sov_modules_api::{Context, Module, Spec, StateValueAccessor}; use sov_rollup_interface::soft_confirmation::SignedSoftConfirmationBatch; +use sov_rollup_interface::spec::SpecId; use crate::call::CallMessage; use crate::tests::genesis_tests::{get_soft_confirmation_rule_enforcer, TEST_CONFIG}; @@ -55,6 +56,7 @@ fn begin_soft_confirmation_hook_checks_max_l2_blocks_per_l1() { &mut HookSoftConfirmationInfo::new( signed_soft_confirmation_batch.clone(), vec![0; 32], + SpecId::Genesis, ), &mut working_set, ) @@ -87,7 +89,11 @@ fn begin_soft_confirmation_hook_checks_l1_fee_rate() { // call first with 100 fee rate to set last_l1_fee_rate let res = soft_confirmation_rule_enforcer.begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ); @@ -98,7 +104,11 @@ fn begin_soft_confirmation_hook_checks_l1_fee_rate() { signed_soft_confirmation_batch.set_l1_fee_rate(111); let res = soft_confirmation_rule_enforcer.begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ); @@ -123,7 +133,11 @@ fn begin_soft_confirmation_hook_checks_l1_fee_rate() { signed_soft_confirmation_batch.set_l1_fee_rate(110); let res = soft_confirmation_rule_enforcer.begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ); @@ -133,7 +147,11 @@ fn begin_soft_confirmation_hook_checks_l1_fee_rate() { signed_soft_confirmation_batch.set_l1_fee_rate(122); let res = soft_confirmation_rule_enforcer.begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ); @@ -142,7 +160,11 @@ fn begin_soft_confirmation_hook_checks_l1_fee_rate() { signed_soft_confirmation_batch.set_l1_fee_rate(121); let res = soft_confirmation_rule_enforcer.begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ); @@ -152,13 +174,21 @@ fn begin_soft_confirmation_hook_checks_l1_fee_rate() { signed_soft_confirmation_batch.set_l1_fee_rate(109); let res = soft_confirmation_rule_enforcer.begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ); assert!(res.is_ok()); signed_soft_confirmation_batch.set_l1_fee_rate(100); let res = soft_confirmation_rule_enforcer.begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ); assert!(res.is_ok()); @@ -170,7 +200,11 @@ fn begin_soft_confirmation_hook_checks_l1_fee_rate() { signed_soft_confirmation_batch.set_l1_fee_rate(89); let res = soft_confirmation_rule_enforcer.begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ); @@ -194,7 +228,11 @@ fn begin_soft_confirmation_hook_checks_l1_fee_rate() { signed_soft_confirmation_batch.set_l1_fee_rate(90); let res = soft_confirmation_rule_enforcer.begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ); @@ -205,7 +243,11 @@ fn begin_soft_confirmation_hook_checks_l1_fee_rate() { signed_soft_confirmation_batch.set_l1_fee_rate(89); let res = soft_confirmation_rule_enforcer.begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ); @@ -235,7 +277,11 @@ fn begin_soft_confirmation_hook_checks_timestamp() { // call first with `original_timestamp` let res = soft_confirmation_rule_enforcer.begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ); @@ -258,7 +304,11 @@ fn begin_soft_confirmation_hook_checks_timestamp() { ); let res = soft_confirmation_rule_enforcer.begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ); @@ -296,7 +346,11 @@ fn begin_soft_confirmation_hook_checks_timestamp() { ); let res = soft_confirmation_rule_enforcer.begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ); diff --git a/crates/soft-confirmation-rule-enforcer/src/tests/query_tests.rs b/crates/soft-confirmation-rule-enforcer/src/tests/query_tests.rs index a85cf8688..dabb8e64a 100644 --- a/crates/soft-confirmation-rule-enforcer/src/tests/query_tests.rs +++ b/crates/soft-confirmation-rule-enforcer/src/tests/query_tests.rs @@ -2,6 +2,7 @@ use sov_mock_da::MockDaSpec; use sov_modules_api::hooks::HookSoftConfirmationInfo; use sov_modules_api::StateMapAccessor; use sov_rollup_interface::soft_confirmation::SignedSoftConfirmationBatch; +use sov_rollup_interface::spec::SpecId; use crate::tests::genesis_tests::{get_soft_confirmation_rule_enforcer, TEST_CONFIG}; @@ -30,6 +31,7 @@ fn block_count_per_da_hash_must_be_correct() { &mut HookSoftConfirmationInfo::new( signed_soft_confirmation_batch.clone(), vec![0; 32], + SpecId::Genesis, ), &mut working_set, ) @@ -49,7 +51,11 @@ fn block_count_per_da_hash_must_be_correct() { // call with a different da hash soft_confirmation_rule_enforcer .begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ) .unwrap(); @@ -91,7 +97,11 @@ fn get_max_l1_fee_rate_change_percentage_must_be_correct() { soft_confirmation_rule_enforcer .begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ) .unwrap(); @@ -132,7 +142,11 @@ fn get_last_l1_fee_rate_must_be_correct() { ); soft_confirmation_rule_enforcer .begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ) .unwrap(); @@ -174,7 +188,11 @@ fn get_last_timestamp_must_be_correct() { ); soft_confirmation_rule_enforcer .begin_soft_confirmation_hook( - &mut HookSoftConfirmationInfo::new(signed_soft_confirmation_batch.clone(), vec![0; 32]), + &mut HookSoftConfirmationInfo::new( + signed_soft_confirmation_batch.clone(), + vec![0; 32], + SpecId::Genesis, + ), &mut working_set, ) .unwrap(); diff --git a/crates/sovereign-sdk/examples/demo-simple-stf/src/lib.rs b/crates/sovereign-sdk/examples/demo-simple-stf/src/lib.rs index 7e5c4f478..0bbc45bd3 100644 --- a/crates/sovereign-sdk/examples/demo-simple-stf/src/lib.rs +++ b/crates/sovereign-sdk/examples/demo-simple-stf/src/lib.rs @@ -5,6 +5,7 @@ use std::marker::PhantomData; use sha2::Digest; use sov_rollup_interface::da::{BlobReaderTrait, DaSpec}; use sov_rollup_interface::soft_confirmation::SignedSoftConfirmationBatch; +use sov_rollup_interface::spec::SpecId; use sov_rollup_interface::stf::{BatchReceipt, SlotResult, StateTransitionFunction}; use sov_rollup_interface::zk::{CumulativeStateDiff, ValidityCondition, Zkvm}; @@ -58,6 +59,7 @@ impl StateTransitionFunction( &self, + _current_spec: SpecId, _pre_state_root: &[u8; 0], _base_state: Self::PreState, _witness: Self::Witness, @@ -112,6 +114,7 @@ impl StateTransitionFunction StateTransitionFunction::BlockHeader>>, _validity_condition: &::ValidityCondition, _soft_batch: std::collections::VecDeque>, + _forks: Vec<(SpecId, u64)>, ) -> (Self::StateRoot, CumulativeStateDiff) { todo!() } diff --git a/crates/sovereign-sdk/examples/demo-simple-stf/tests/stf_test.rs b/crates/sovereign-sdk/examples/demo-simple-stf/tests/stf_test.rs index 73ca15d37..2930a42a3 100644 --- a/crates/sovereign-sdk/examples/demo-simple-stf/tests/stf_test.rs +++ b/crates/sovereign-sdk/examples/demo-simple-stf/tests/stf_test.rs @@ -2,6 +2,7 @@ use demo_simple_stf::CheckHashPreimageStf; use sov_mock_da::verifier::MockDaSpec; use sov_mock_da::{MockAddress, MockBlob, MockBlockHeader, MockValidityCond}; use sov_mock_zkvm::MockZkvm; +use sov_rollup_interface::spec::SpecId; use sov_rollup_interface::stf::StateTransitionFunction; #[test] @@ -28,6 +29,7 @@ fn test_stf_success() { let result = StateTransitionFunction::, MockDaSpec>::apply_slot( stf, + SpecId::Genesis, &[], (), (), diff --git a/crates/sovereign-sdk/examples/demo-stf/src/hooks_impl.rs b/crates/sovereign-sdk/examples/demo-stf/src/hooks_impl.rs index e9afc5f59..6ab15c732 100644 --- a/crates/sovereign-sdk/examples/demo-stf/src/hooks_impl.rs +++ b/crates/sovereign-sdk/examples/demo-stf/src/hooks_impl.rs @@ -23,7 +23,11 @@ impl TxHooks for Runtime { working_set: &mut WorkingSet, arg: &RuntimeTxHook, ) -> anyhow::Result { - let RuntimeTxHook { height, sequencer } = arg; + let RuntimeTxHook { + height, + sequencer, + current_spec: _current_spec, + } = arg; let AccountsTxHook { sender, sequencer } = self.accounts .pre_dispatch_tx_hook(tx, working_set, sequencer)?; diff --git a/crates/sovereign-sdk/full-node/db/sov-db/Cargo.toml b/crates/sovereign-sdk/full-node/db/sov-db/Cargo.toml index 17cd71c1d..e6c4f8263 100644 --- a/crates/sovereign-sdk/full-node/db/sov-db/Cargo.toml +++ b/crates/sovereign-sdk/full-node/db/sov-db/Cargo.toml @@ -16,44 +16,39 @@ resolver = "2" [dependencies] # Maintained by sovereign labs jmt = { workspace = true } +sov-rollup-interface = { path = "../../../rollup-interface", features = ["native"] } sov-schema-db = { path = "../sov-schema-db" } -sov-rollup-interface = { path = "../../../rollup-interface", features = [ - "native", -] } + +citrea-primitives = { path = "../../../../primitives" } # External anyhow = { workspace = true, default-features = true } arbitrary = { workspace = true, optional = true } +bincode = { workspace = true } +borsh = { workspace = true, default-features = true, features = ["bytes", "rc"] } byteorder = { workspace = true, default-features = true } -borsh = { workspace = true, default-features = true, features = [ - "bytes", - "rc", -] } +hex = { workspace = true } proptest = { workspace = true, optional = true, default-features = true } proptest-derive = { workspace = true, optional = true } +rocksdb = { workspace = true } serde = { workspace = true, default-features = true, features = ["rc"] } tempfile = { workspace = true, optional = true } -rocksdb = { workspace = true } -bincode = { workspace = true } tokio = { workspace = true } tracing = { workspace = true } -hex = { workspace = true } - [dev-dependencies] -sov-mock-da = { path = "../../../adapters/mock-da", features = ["native"] } -tempfile = { workspace = true } criterion = "0.5.1" rand = { workspace = true } sha2 = { workspace = true } - +sov-mock-da = { path = "../../../adapters/mock-da", features = ["native"] } +tempfile = { workspace = true } [features] arbitrary = [ - "dep:arbitrary", - "dep:proptest", - "dep:proptest-derive", - "dep:tempfile", + "dep:arbitrary", + "dep:proptest", + "dep:proptest-derive", + "dep:tempfile", ] [[bench]] diff --git a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs index 46cf52bf5..f585499ad 100644 --- a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs +++ b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs @@ -1,10 +1,12 @@ use std::path::Path; use std::sync::{Arc, Mutex}; +use citrea_primitives::fork::ForkMigration; use serde::de::DeserializeOwned; use serde::Serialize; use sov_rollup_interface::da::{DaSpec, SequencerCommitment}; use sov_rollup_interface::services::da::SlotData; +use sov_rollup_interface::spec::SpecId; use sov_rollup_interface::stf::{BatchReceipt, Event, SoftBatchReceipt, StateDiff}; use sov_rollup_interface::zk::Proof; use sov_schema_db::{Schema, SchemaBatch, SeekKeyEncoder, DB}; @@ -13,8 +15,8 @@ use tracing::instrument; use crate::rocks_db_config::gen_rocksdb_options; use crate::schema::tables::{ - BatchByHash, BatchByNumber, CommitmentsByNumber, EventByKey, EventByNumber, L2GenesisStateRoot, - L2RangeByL1Height, L2Witness, LastSequencerCommitmentSent, LastStateDiff, + ActiveFork, BatchByHash, BatchByNumber, CommitmentsByNumber, EventByKey, EventByNumber, + L2GenesisStateRoot, L2RangeByL1Height, L2Witness, LastSequencerCommitmentSent, LastStateDiff, PendingSequencerCommitmentL2Range, ProofBySlotNumber, ProverLastScannedSlot, SlotByHash, SlotByNumber, SoftBatchByHash, SoftBatchByNumber, SoftConfirmationStatus, TxByHash, TxByNumber, VerifiedProofsBySlotNumber, LEDGER_TABLES, @@ -456,6 +458,14 @@ impl SharedLedgerOps for LedgerDB { ) -> Result, anyhow::Error> { self.db.get::(number) } + + /// Gets the currently active fork + #[instrument(level = "trace", skip(self), err, ret)] + fn get_active_fork(&self) -> Result { + self.db + .get::(&()) + .map(|fork| fork.unwrap_or_default()) + } } impl ProverLedgerOps for LedgerDB { @@ -794,3 +804,10 @@ impl NodeLedgerOps for LedgerDB { self.db.get::(&hash).map(|v| v.map(|a| a.0)) } } + +impl ForkMigration for LedgerDB { + fn spec_activated(&self, _spec_id: SpecId) -> anyhow::Result<()> { + // TODO: Implement later + Ok(()) + } +} diff --git a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs index db35a137f..cb69385d0 100644 --- a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs +++ b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs @@ -3,6 +3,7 @@ use serde::de::DeserializeOwned; use serde::Serialize; use sov_rollup_interface::da::{DaSpec, SequencerCommitment}; use sov_rollup_interface::services::da::SlotData; +use sov_rollup_interface::spec::SpecId; use sov_rollup_interface::stf::{Event, SoftBatchReceipt, StateDiff}; use sov_rollup_interface::zk::Proof; use sov_schema_db::SchemaBatch; @@ -118,6 +119,9 @@ pub trait SharedLedgerOps { /// Gets all soft confirmations by numbers fn get_soft_batch_by_number(&self, number: &BatchNumber) -> Result>; + + /// Gets the currently active fork + fn get_active_fork(&self) -> Result; } /// Node ledger operations diff --git a/crates/sovereign-sdk/full-node/db/sov-db/src/schema/tables.rs b/crates/sovereign-sdk/full-node/db/sov-db/src/schema/tables.rs index c37c20fac..02f05fe1b 100644 --- a/crates/sovereign-sdk/full-node/db/sov-db/src/schema/tables.rs +++ b/crates/sovereign-sdk/full-node/db/sov-db/src/schema/tables.rs @@ -30,6 +30,7 @@ use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; use jmt::storage::{NibblePath, Node, NodeKey}; use jmt::Version; use sov_rollup_interface::da::SequencerCommitment; +use sov_rollup_interface::spec::SpecId; use sov_rollup_interface::stf::{Event, EventKey, StateDiff}; use sov_schema_db::schema::{KeyDecoder, KeyEncoder, ValueCodec}; use sov_schema_db::{CodecError, SeekKeyEncoder}; @@ -51,6 +52,7 @@ pub const STATE_TABLES: &[&str] = &[ /// A list of all tables used by the LedgerDB. These tables store rollup "history" - meaning /// transaction, events, receipts, etc. pub const LEDGER_TABLES: &[&str] = &[ + ActiveFork::table_name(), SlotByNumber::table_name(), SlotByHash::table_name(), SoftBatchByNumber::table_name(), @@ -220,6 +222,11 @@ macro_rules! define_table_with_seek_key_codec { }; } +define_table_with_seek_key_codec!( + /// The currently active fork + (ActiveFork) () => SpecId +); + define_table_with_seek_key_codec!( /// The State diff storage (LastStateDiff) () => StateDiff diff --git a/crates/sovereign-sdk/full-node/sov-sequencer/src/batch_builder.rs b/crates/sovereign-sdk/full-node/sov-sequencer/src/batch_builder.rs index 2150c037b..0908f1096 100644 --- a/crates/sovereign-sdk/full-node/sov-sequencer/src/batch_builder.rs +++ b/crates/sovereign-sdk/full-node/sov-sequencer/src/batch_builder.rs @@ -7,6 +7,7 @@ use sov_modules_api::digest::Digest; use sov_modules_api::transaction::Transaction; use sov_modules_api::{Context, DispatchCall, PublicKey, Spec, WorkingSet}; use sov_rollup_interface::services::batch_builder::BatchBuilder; +use sov_rollup_interface::spec::SpecId; use tracing::{info, warn}; /// Transaction stored in the mempool. @@ -122,7 +123,7 @@ where /// Builds a new batch of valid transactions in order they were added to mempool /// Only transactions, which are dispatched successfully are included in the batch - fn get_next_blob(&mut self) -> anyhow::Result>> { + fn get_next_blob(&mut self, current_spec: SpecId) -> anyhow::Result>> { let mut working_set = WorkingSet::new(self.current_storage.clone()); let mut txs = Vec::new(); let mut current_batch_size = 0; @@ -144,7 +145,10 @@ where // FIXME! This should use the correct height let ctx = C::new(sender_address, self.sequencer.clone(), 0); - if let Err(error) = self.runtime.dispatch_call(msg, &mut working_set, &ctx) { + if let Err(error) = + self.runtime + .dispatch_call(msg, &mut working_set, current_spec, &ctx) + { warn!(%error, tx = hex::encode(&pooled.raw), "Error during transaction dispatch"); continue; } @@ -381,7 +385,7 @@ mod tests { let (mut batch_builder, storage) = create_batch_builder(10, &tmpdir); setup_runtime(storage, None); - let build_result = batch_builder.get_next_blob(); + let build_result = batch_builder.get_next_blob(SpecId::Genesis); assert!(build_result.is_err()); assert_eq!( "No valid transactions are available", @@ -409,7 +413,7 @@ mod tests { assert_eq!(txs.len(), batch_builder.mempool.len()); - let build_result = batch_builder.get_next_blob(); + let build_result = batch_builder.get_next_blob(SpecId::Genesis); assert!(build_result.is_err()); assert_eq!( "No valid transactions are available", @@ -442,7 +446,7 @@ mod tests { assert_eq!(txs.len(), batch_builder.mempool.len()); - let build_result = batch_builder.get_next_blob(); + let build_result = batch_builder.get_next_blob(SpecId::Genesis); assert!(build_result.is_ok()); let blob = build_result.unwrap(); assert_eq!(2, blob.len()); diff --git a/crates/sovereign-sdk/full-node/sov-sequencer/src/lib.rs b/crates/sovereign-sdk/full-node/sov-sequencer/src/lib.rs index 5b48233d9..b111d1aca 100644 --- a/crates/sovereign-sdk/full-node/sov-sequencer/src/lib.rs +++ b/crates/sovereign-sdk/full-node/sov-sequencer/src/lib.rs @@ -14,6 +14,7 @@ use jsonrpsee::RpcModule; use sov_modules_api::utils::to_jsonrpsee_error_object; use sov_rollup_interface::services::batch_builder::BatchBuilder; use sov_rollup_interface::services::da::DaService; +use sov_rollup_interface::spec::SpecId; const SEQUENCER_RPC_ERROR: &str = "SEQUENCER_RPC_ERROR"; @@ -43,7 +44,7 @@ impl Sequencer .batch_builder .lock() .map_err(|e| anyhow!("failed to lock mempool: {}", e.to_string()))?; - batch_builder.get_next_blob()? + batch_builder.get_next_blob(SpecId::Genesis)? }; let num_txs = blob.len(); let blob: Vec = borsh::to_vec(&blob)?; @@ -154,7 +155,7 @@ mod tests { Ok(()) } - fn get_next_blob(&mut self) -> anyhow::Result>> { + fn get_next_blob(&mut self, _current_spec: SpecId) -> anyhow::Result>> { if self.mempool.is_empty() { anyhow::bail!("Mock mempool is empty"); } diff --git a/crates/sovereign-sdk/full-node/sov-stf-runner/Cargo.toml b/crates/sovereign-sdk/full-node/sov-stf-runner/Cargo.toml index 894d05be8..88e31eab5 100644 --- a/crates/sovereign-sdk/full-node/sov-stf-runner/Cargo.toml +++ b/crates/sovereign-sdk/full-node/sov-stf-runner/Cargo.toml @@ -35,6 +35,7 @@ sov-modules-api = { path = "../../module-system/sov-modules-api", default-featur sov-rollup-interface = { path = "../../rollup-interface" } # Citrea-Deps +citrea-primitives = { path = "../../../primitives" } shared-backup-db = { path = "../../../shared-backup-db", optional = true } [dev-dependencies] diff --git a/crates/sovereign-sdk/full-node/sov-stf-runner/src/mock/mod.rs b/crates/sovereign-sdk/full-node/sov-stf-runner/src/mock/mod.rs index 5b2410af6..b9ec1bf86 100644 --- a/crates/sovereign-sdk/full-node/sov-stf-runner/src/mock/mod.rs +++ b/crates/sovereign-sdk/full-node/sov-stf-runner/src/mock/mod.rs @@ -1,6 +1,7 @@ use std::marker::PhantomData; use sov_rollup_interface::da::DaSpec; +use sov_rollup_interface::spec::SpecId; use sov_rollup_interface::stf::{BatchReceipt, SlotResult, StateTransitionFunction}; use sov_rollup_interface::zk::{CumulativeStateDiff, ValidityCondition, Zkvm}; @@ -33,6 +34,7 @@ impl StateTransitionFunction( &self, + _current_spec: SpecId, _pre_state_root: &[u8; 0], _base_state: Self::PreState, _witness: Self::Witness, @@ -65,6 +67,7 @@ impl StateTransitionFunction StateTransitionFunction, >, + _forks: Vec<(SpecId, u64)>, ) -> (Self::StateRoot, CumulativeStateDiff) { todo!() } diff --git a/crates/sovereign-sdk/module-system/sov-modules-api/src/hooks.rs b/crates/sovereign-sdk/module-system/sov-modules-api/src/hooks.rs index aa872ab31..40397ee2a 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-api/src/hooks.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-api/src/hooks.rs @@ -3,6 +3,7 @@ use serde::{Deserialize, Serialize}; use sov_modules_core::{AccessoryWorkingSet, Context, Spec, Storage, WorkingSet}; use sov_rollup_interface::da::{BlobReaderTrait, DaSpec}; use sov_rollup_interface::soft_confirmation::SignedSoftConfirmationBatch; +use sov_rollup_interface::spec::SpecId; use thiserror::Error; use crate::transaction::Transaction; @@ -123,6 +124,8 @@ pub struct HookSoftConfirmationInfo { pub da_slot_txs_commitment: [u8; 32], /// Previous batch's pre state root pub pre_state_root: Vec, + /// The current spec + pub current_spec: SpecId, /// Public key of signer pub pub_key: Vec, /// Deposit data from the L1 chain @@ -137,12 +140,14 @@ impl HookSoftConfirmationInfo { pub fn new( signed_soft_confirmation: SignedSoftConfirmationBatch, pre_state_root: Vec, + current_spec: SpecId, ) -> Self { HookSoftConfirmationInfo { da_slot_height: signed_soft_confirmation.da_slot_height(), da_slot_hash: signed_soft_confirmation.da_slot_hash(), da_slot_txs_commitment: signed_soft_confirmation.da_slot_txs_commitment(), pre_state_root: pre_state_root.to_vec(), + current_spec, pub_key: signed_soft_confirmation.sequencer_pub_key().to_vec(), deposit_data: signed_soft_confirmation.deposit_data(), l1_fee_rate: signed_soft_confirmation.l1_fee_rate(), diff --git a/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs b/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs index 6abfd8834..d0bb4b115 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs @@ -1,6 +1,7 @@ //! Runtime call message definitions. use borsh::io; +use sov_rollup_interface::spec::SpecId; use crate::common::ModuleError; use crate::module::{CallResponse, Context, Spec}; @@ -22,6 +23,7 @@ pub trait DispatchCall: Send + Sync { &self, message: Self::Decodable, working_set: &mut WorkingSet, + current_spec: SpecId, context: &Self::Context, ) -> Result; diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/Cargo.toml b/crates/sovereign-sdk/module-system/sov-modules-macros/Cargo.toml index 4f20e4ce0..13c556b3c 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/Cargo.toml +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/Cargo.toml @@ -1,16 +1,16 @@ [package] name = "sov-modules-macros" -description = "Macros for use with the Sovereign SDK module system" authors = { workspace = true } edition = { workspace = true } homepage = { workspace = true } license = { workspace = true } repository = { workspace = true } +description = "Macros for use with the Sovereign SDK module system" version = { workspace = true } +autotests = false readme = "README.md" resolver = "2" -autotests = false [lib] proc-macro = true @@ -25,8 +25,9 @@ jsonrpsee = { workspace = true, features = ["macros", "http-client", "server"] } serde = { workspace = true } trybuild = "1.0" -sov-modules-api = { path = "../sov-modules-api", features = [ "native" ] } +sov-modules-api = { path = "../sov-modules-api", features = ["native"] } sov-modules-core = { path = "../sov-modules-core" } +sov-rollup-interface = { path = "../../rollup-interface" } sov-state = { path = "../sov-state" } [dependencies] @@ -38,7 +39,6 @@ quote = "1.0" serde_json = { workspace = true } syn = { version = "1.0", features = ["full"] } - [build-dependencies] anyhow = { workspace = true } @@ -48,4 +48,4 @@ native = ["jsonrpsee"] [package.metadata.cargo-udeps.ignore] normal = ["borsh"] -development = ["clap", "sov-modules-core", "sov-modules-api", "sov-state"] +development = ["clap", "sov-modules-core", "sov-modules-api", "sov-state", "sov-rollup-interface"] diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/src/dispatch/dispatch_call.rs b/crates/sovereign-sdk/module-system/sov-modules-macros/src/dispatch/dispatch_call.rs index 3dc8ac75d..35c8a8042 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/src/dispatch/dispatch_call.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/src/dispatch/dispatch_call.rs @@ -67,6 +67,7 @@ impl<'a> StructDef<'a> { &self, decodable: Self::Decodable, working_set: &mut ::sov_modules_api::WorkingSet, + current_spec: ::sov_rollup_interface::spec::SpecId, context: &Self::Context, ) -> ::core::result::Result<::sov_modules_api::CallResponse, ::sov_modules_api::Error> { diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/dispatch/derive_dispatch.rs b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/dispatch/derive_dispatch.rs index 9d6107774..7a942bbfb 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/dispatch/derive_dispatch.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/dispatch/derive_dispatch.rs @@ -6,6 +6,7 @@ use sov_modules_api::macros::DefaultRuntime; use sov_modules_api::{ Address, Context, DispatchCall, EncodeCall, Genesis, MessageCodec, ModuleInfo, }; +use sov_rollup_interface::spec::SpecId; use sov_state::ZkStorage; #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] @@ -42,7 +43,7 @@ fn main() { assert_eq!(runtime.module_address(&module), runtime.first.address()); let _ = runtime - .dispatch_call(module, working_set, &context) + .dispatch_call(module, working_set, SpecId::Genesis, &context) .unwrap(); } @@ -62,7 +63,7 @@ fn main() { assert_eq!(runtime.module_address(&module), runtime.second.address()); let _ = runtime - .dispatch_call(module, working_set, &context) + .dispatch_call(module, working_set, SpecId::Genesis, &context) .unwrap(); } diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.rs b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.rs index a9a6adfee..811c20a9d 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.rs @@ -94,6 +94,7 @@ pub mod my_module { } use my_module::query::{QueryModuleRpcImpl, QueryModuleRpcServer}; +use sov_rollup_interface::spec::SpecId; #[expose_rpc] #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] @@ -126,6 +127,6 @@ fn main() { let context = C::new(sender, sequencer, 1); let _ = runtime - .dispatch_call(module, working_set, &context) + .dispatch_call(module, working_set, SpecId::Genesis, &context) .unwrap(); } diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.stderr b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.stderr index d19127ac9..afdea8814 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.stderr +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_type_not_static.stderr @@ -1,7 +1,7 @@ error[E0310]: the parameter type `S` may not live long enough - --> tests/rpc/expose_rpc_associated_type_not_static.rs:98:1 + --> tests/rpc/expose_rpc_associated_type_not_static.rs:99:1 | -98 | #[expose_rpc] +99 | #[expose_rpc] | ^^^^^^^^^^^^^ | | | the parameter type `S` must be valid for the static lifetime... @@ -10,5 +10,5 @@ error[E0310]: the parameter type `S` may not live long enough = note: this error originates in the attribute macro `expose_rpc` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider adding an explicit lifetime bound | -101| struct Runtime { +102| struct Runtime { | +++++++++ diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types.rs b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types.rs index 67b089c3a..72242687f 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types.rs @@ -94,6 +94,7 @@ pub mod my_module { } use my_module::query::{QueryModuleRpcImpl, QueryModuleRpcServer}; +use sov_rollup_interface::spec::SpecId; #[expose_rpc] #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] @@ -126,6 +127,6 @@ fn main() { let context = C::new(sender, sequencer, 1); let _ = runtime - .dispatch_call(module, working_set, &context) + .dispatch_call(module, working_set, SpecId::Genesis, &context) .unwrap(); } diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types_nested.rs b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types_nested.rs index cf44a4a25..a07f77338 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types_nested.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_associated_types_nested.rs @@ -99,6 +99,7 @@ pub mod my_module { } use my_module::query::{QueryModuleRpcImpl, QueryModuleRpcServer}; +use sov_rollup_interface::spec::SpecId; #[expose_rpc] #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] @@ -139,6 +140,6 @@ fn main() { let context = C::new(sender, sequencer, 1); let _ = runtime - .dispatch_call(module, working_set, &context) + .dispatch_call(module, working_set, SpecId::Genesis, &context) .unwrap(); } diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.rs b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.rs index 93d9b615e..4cacc47b7 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.rs @@ -92,6 +92,7 @@ pub mod my_module { } use my_module::query::{QueryModuleRpcImpl, QueryModuleRpcServer}; +use sov_rollup_interface::spec::SpecId; #[expose_rpc] #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] @@ -124,6 +125,6 @@ fn main() { let context = C::new(sender, sequencer, 1); let _ = runtime - .dispatch_call(module, working_set, &context) + .dispatch_call(module, working_set, SpecId::Genesis, &context) .unwrap(); } diff --git a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.stderr b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.stderr index cb99bf2ba..790a9dead 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.stderr +++ b/crates/sovereign-sdk/module-system/sov-modules-macros/tests/rpc/expose_rpc_first_generic_not_context.stderr @@ -1,128 +1,128 @@ error[E0220]: associated type `Storage` not found for `S` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:1 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:1 | -96 | #[expose_rpc] +97 | #[expose_rpc] | ^^^^^^^^^^^^^ associated type `Storage` not found | = note: this error originates in the attribute macro `expose_rpc` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:99:16 - | -99 | struct Runtime { - | ^ the trait `sov_modules_api::Context` is not implemented for `S` - | + --> tests/rpc/expose_rpc_first_generic_not_context.rs:100:16 + | +100 | struct Runtime { + | ^ the trait `sov_modules_api::Context` is not implemented for `S` + | note: required by a bound in `sov_modules_api::Genesis::Context` - --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/mod.rs - | - | type Context: Context; - | ^^^^^^^ required by this bound in `Genesis::Context` + --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/mod.rs + | + | type Context: Context; + | ^^^^^^^ required by this bound in `Genesis::Context` help: consider further restricting this bound - | -99 | struct Runtime { - | ++++++++++++++++++++++++++ + | +100 | struct Runtime { + | ++++++++++++++++++++++++++ error[E0277]: `::Data` cannot be shared between threads safely - --> tests/rpc/expose_rpc_first_generic_not_context.rs:99:8 - | -99 | struct Runtime { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `::Data` cannot be shared between threads safely - | - = help: within `Runtime`, the trait `std::marker::Sync` is not implemented for `::Data`, which is required by `Runtime: std::marker::Sync` + --> tests/rpc/expose_rpc_first_generic_not_context.rs:100:8 + | +100 | struct Runtime { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `::Data` cannot be shared between threads safely + | + = help: within `Runtime`, the trait `std::marker::Sync` is not implemented for `::Data`, which is required by `Runtime: std::marker::Sync` note: required because it appears within the type `PhantomData<::Data>` - --> $RUST/core/src/marker.rs - | - | pub struct PhantomData; - | ^^^^^^^^^^^ + --> $RUST/core/src/marker.rs + | + | pub struct PhantomData; + | ^^^^^^^^^^^ note: required because it appears within the type `sov_modules_api::StateValue<::Data>` - --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-api/src/containers/value.rs - | - | pub struct StateValue { - | ^^^^^^^^^^ + --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-api/src/containers/value.rs + | + | pub struct StateValue { + | ^^^^^^^^^^ note: required because it appears within the type `QueryModule::Data>` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:33:16 - | -33 | pub struct QueryModule { - | ^^^^^^^^^^^ + --> tests/rpc/expose_rpc_first_generic_not_context.rs:33:16 + | +33 | pub struct QueryModule { + | ^^^^^^^^^^^ note: required because it appears within the type `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:99:8 - | -99 | struct Runtime { - | ^^^^^^^ + --> tests/rpc/expose_rpc_first_generic_not_context.rs:100:8 + | +100 | struct Runtime { + | ^^^^^^^ note: required by a bound in `sov_modules_api::DispatchCall` - --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs - | - | pub trait DispatchCall: Send + Sync { - | ^^^^ required by this bound in `DispatchCall` + --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs + | + | pub trait DispatchCall: Send + Sync { + | ^^^^ required by this bound in `DispatchCall` help: consider further restricting the associated type - | -99 | struct Runtime where ::Data: std::marker::Sync { - | ++++++++++++++++++++++++++++++++++++++++++++++ + | +100 | struct Runtime where ::Data: std::marker::Sync { + | ++++++++++++++++++++++++++++++++++++++++++++++ error[E0277]: `::Data` cannot be sent between threads safely - --> tests/rpc/expose_rpc_first_generic_not_context.rs:99:8 - | -99 | struct Runtime { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `::Data` cannot be sent between threads safely - | - = help: within `Runtime`, the trait `Send` is not implemented for `::Data`, which is required by `Runtime: Send` + --> tests/rpc/expose_rpc_first_generic_not_context.rs:100:8 + | +100 | struct Runtime { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `::Data` cannot be sent between threads safely + | + = help: within `Runtime`, the trait `Send` is not implemented for `::Data`, which is required by `Runtime: Send` note: required because it appears within the type `PhantomData<::Data>` - --> $RUST/core/src/marker.rs - | - | pub struct PhantomData; - | ^^^^^^^^^^^ + --> $RUST/core/src/marker.rs + | + | pub struct PhantomData; + | ^^^^^^^^^^^ note: required because it appears within the type `sov_modules_api::StateValue<::Data>` - --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-api/src/containers/value.rs - | - | pub struct StateValue { - | ^^^^^^^^^^ + --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-api/src/containers/value.rs + | + | pub struct StateValue { + | ^^^^^^^^^^ note: required because it appears within the type `QueryModule::Data>` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:33:16 - | -33 | pub struct QueryModule { - | ^^^^^^^^^^^ + --> tests/rpc/expose_rpc_first_generic_not_context.rs:33:16 + | +33 | pub struct QueryModule { + | ^^^^^^^^^^^ note: required because it appears within the type `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:99:8 - | -99 | struct Runtime { - | ^^^^^^^ + --> tests/rpc/expose_rpc_first_generic_not_context.rs:100:8 + | +100 | struct Runtime { + | ^^^^^^^ note: required by a bound in `sov_modules_api::DispatchCall` - --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs - | - | pub trait DispatchCall: Send + Sync { - | ^^^^ required by this bound in `DispatchCall` + --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs + | + | pub trait DispatchCall: Send + Sync { + | ^^^^ required by this bound in `DispatchCall` help: consider further restricting the associated type - | -99 | struct Runtime where ::Data: Send { - | +++++++++++++++++++++++++++++++++ + | +100 | struct Runtime where ::Data: Send { + | +++++++++++++++++++++++++++++++++ error[E0277]: the trait bound `S: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:99:16 - | -99 | struct Runtime { - | ^ the trait `sov_modules_api::Context` is not implemented for `S` - | + --> tests/rpc/expose_rpc_first_generic_not_context.rs:100:16 + | +100 | struct Runtime { + | ^ the trait `sov_modules_api::Context` is not implemented for `S` + | note: required by a bound in `sov_modules_api::DispatchCall::Context` - --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs - | - | type Context: Context; - | ^^^^^^^ required by this bound in `DispatchCall::Context` + --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs + | + | type Context: Context; + | ^^^^^^^ required by this bound in `DispatchCall::Context` help: consider further restricting this bound - | -99 | struct Runtime { - | ++++++++++++++++++++++++++ + | +100 | struct Runtime { + | ++++++++++++++++++++++++++ error[E0277]: `::Data` cannot be shared between threads safely - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:98:19 | -97 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] +98 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] | ^^^^^^^^^^^^ `::Data` cannot be shared between threads safely | = help: within `RuntimeCall`, the trait `std::marker::Sync` is not implemented for `::Data`, which is required by `RuntimeCall: std::marker::Sync` note: required because it appears within the type `RuntimeCall` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:98:19 | -97 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] +98 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] | ^^^^^^^^^^^^ note: required by a bound in `sov_modules_api::DispatchCall::Decodable` --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs @@ -132,20 +132,20 @@ note: required by a bound in `sov_modules_api::DispatchCall::Decodable` = note: this error originates in the derive macro `DispatchCall` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting the associated type | -99 | struct Runtime where ::Data: std::marker::Sync { +100| struct Runtime where ::Data: std::marker::Sync { | ++++++++++++++++++++++++++++++++++++++++++++++ error[E0277]: `::Data` cannot be sent between threads safely - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:98:19 | -97 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] +98 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] | ^^^^^^^^^^^^ `::Data` cannot be sent between threads safely | = help: within `RuntimeCall`, the trait `Send` is not implemented for `::Data`, which is required by `RuntimeCall: Send` note: required because it appears within the type `RuntimeCall` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:98:19 | -97 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] +98 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] | ^^^^^^^^^^^^ note: required by a bound in `sov_modules_api::DispatchCall::Decodable` --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/dispatch.rs @@ -155,108 +155,108 @@ note: required by a bound in `sov_modules_api::DispatchCall::Decodable` = note: this error originates in the derive macro `DispatchCall` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting the associated type | -99 | struct Runtime where ::Data: Send { +100| struct Runtime where ::Data: Send { | +++++++++++++++++++++++++++++++++ error[E0277]: the trait bound `S: Spec` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:98:19 | -97 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] +98 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] | ^^^^^^^^^^^^ the trait `Spec` is not implemented for `S` | = note: this error originates in the derive macro `DispatchCall` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting this bound | -99 | struct Runtime { +100| struct Runtime { | +++++++++++++++++++++++ error[E0277]: the trait bound `S: Spec` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:1 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:1 | -96 | #[expose_rpc] +97 | #[expose_rpc] | ^^^^^^^^^^^^^ the trait `Spec` is not implemented for `S` | = note: this error originates in the attribute macro `expose_rpc` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting this bound | -99 | struct Runtime { +100| struct Runtime { | +++++++++++++++++++++++ error[E0053]: method `get_working_set` has an incompatible type for trait - --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:1 - | -96 | #[expose_rpc] - | ^^^^^^^^^^^^^ - | | - | expected type parameter `C`, found type parameter `S` - | help: change the output type to match the trait: `sov_modules_api::WorkingSet` + --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:1 + | +97 | #[expose_rpc] + | ^^^^^^^^^^^^^ + | | + | expected type parameter `C`, found type parameter `S` + | help: change the output type to match the trait: `sov_modules_api::WorkingSet` ... -99 | struct Runtime { - | - - expected type parameter - | | - | found type parameter - | +100 | struct Runtime { + | - - expected type parameter + | | + | found type parameter + | note: type in trait - --> tests/rpc/expose_rpc_first_generic_not_context.rs:86:57 - | -86 | pub fn query_value(&self, working_set: &mut WorkingSet) -> RpcResult { - | ^^^^^^^^^^^^^ - = note: expected signature `fn(&RpcStorage<_, _>) -> sov_modules_api::WorkingSet` - found signature `fn(&RpcStorage<_, _>) -> sov_modules_api::WorkingSet` - = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound - = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters - = note: this error originates in the attribute macro `expose_rpc` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/rpc/expose_rpc_first_generic_not_context.rs:86:57 + | +86 | pub fn query_value(&self, working_set: &mut WorkingSet) -> RpcResult { + | ^^^^^^^^^^^^^ + = note: expected signature `fn(&RpcStorage<_, _>) -> sov_modules_api::WorkingSet` + found signature `fn(&RpcStorage<_, _>) -> sov_modules_api::WorkingSet` + = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters + = note: this error originates in the attribute macro `expose_rpc` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:10 - | -97 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] - | ^^^^^^^ the trait `sov_modules_api::Context` is not implemented for `S` - | + --> tests/rpc/expose_rpc_first_generic_not_context.rs:98:10 + | +98 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] + | ^^^^^^^ the trait `sov_modules_api::Context` is not implemented for `S` + | note: required by a bound in `sov_modules_api::WorkingSet` - --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/storage/scratchpad.rs - | - | pub struct WorkingSet { - | ^^^^^^^ required by this bound in `WorkingSet` - = note: this error originates in the derive macro `Genesis` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/storage/scratchpad.rs + | + | pub struct WorkingSet { + | ^^^^^^^ required by this bound in `WorkingSet` + = note: this error originates in the derive macro `Genesis` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting this bound - | -99 | struct Runtime { - | ++++++++++++++++++++++++++ + | +100 | struct Runtime { + | ++++++++++++++++++++++++++ error[E0277]: the trait bound `S: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:19 - | -97 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] - | ^^^^^^^^^^^^ the trait `sov_modules_api::Context` is not implemented for `S` - | + --> tests/rpc/expose_rpc_first_generic_not_context.rs:98:19 + | +98 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] + | ^^^^^^^^^^^^ the trait `sov_modules_api::Context` is not implemented for `S` + | note: required by a bound in `sov_modules_api::WorkingSet` - --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/storage/scratchpad.rs - | - | pub struct WorkingSet { - | ^^^^^^^ required by this bound in `WorkingSet` - = note: this error originates in the derive macro `DispatchCall` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/storage/scratchpad.rs + | + | pub struct WorkingSet { + | ^^^^^^^ required by this bound in `WorkingSet` + = note: this error originates in the derive macro `DispatchCall` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting this bound - | -99 | struct Runtime { - | ++++++++++++++++++++++++++ + | +100 | struct Runtime { + | ++++++++++++++++++++++++++ error[E0277]: the trait bound `S: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:1 - | -96 | #[expose_rpc] - | ^^^^^^^^^^^^^ the trait `sov_modules_api::Context` is not implemented for `S` - | + --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:1 + | +97 | #[expose_rpc] + | ^^^^^^^^^^^^^ the trait `sov_modules_api::Context` is not implemented for `S` + | note: required by a bound in `sov_modules_api::WorkingSet` - --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/storage/scratchpad.rs - | - | pub struct WorkingSet { - | ^^^^^^^ required by this bound in `WorkingSet` - = note: this error originates in the attribute macro `expose_rpc` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/storage/scratchpad.rs + | + | pub struct WorkingSet { + | ^^^^^^^ required by this bound in `WorkingSet` + = note: this error originates in the attribute macro `expose_rpc` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting this bound - | -99 | struct Runtime { - | ++++++++++++++++++++++++++ + | +100 | struct Runtime { + | ++++++++++++++++++++++++++ error[E0599]: no method named `set` found for struct `sov_modules_api::StateValue` in the current scope --> tests/rpc/expose_rpc_first_generic_not_context.rs:55:23 @@ -325,127 +325,127 @@ help: trait `StateValueAccessor` which provides `get` is implemented but not in | error[E0271]: type mismatch resolving `::Data> as ModuleInfo>::Context == S` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:10 - | -97 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] - | ^^^^^^^ expected type parameter `S`, found type parameter `C` -98 | #[serialization(borsh::BorshDeserialize, borsh::BorshSerialize)] -99 | struct Runtime { - | - - found type parameter - | | - | expected type parameter - | - = note: expected type parameter `S` - found type parameter `C` - = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound - = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters - = note: required for the cast from `&QueryModule::Data>` to `&dyn sov_modules_api::ModuleInfo` - = note: this error originates in the derive macro `Genesis` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/rpc/expose_rpc_first_generic_not_context.rs:98:10 + | +98 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] + | ^^^^^^^ expected type parameter `S`, found type parameter `C` +99 | #[serialization(borsh::BorshDeserialize, borsh::BorshSerialize)] +100 | struct Runtime { + | - - found type parameter + | | + | expected type parameter + | + = note: expected type parameter `S` + found type parameter `C` + = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters + = note: required for the cast from `&QueryModule::Data>` to `&dyn sov_modules_api::ModuleInfo` + = note: this error originates in the derive macro `Genesis` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:10 - | -97 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] - | ^^^^^^^ the trait `sov_modules_api::Context` is not implemented for `S` - | + --> tests/rpc/expose_rpc_first_generic_not_context.rs:98:10 + | +98 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] + | ^^^^^^^ the trait `sov_modules_api::Context` is not implemented for `S` + | note: required by a bound in `sort_values_by_modules_dependencies` - --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-api/src/lib.rs - | - | pub fn sort_values_by_modules_dependencies( - | ^^^^^^^ required by this bound in `sort_values_by_modules_dependencies` - = note: this error originates in the derive macro `Genesis` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-api/src/lib.rs + | + | pub fn sort_values_by_modules_dependencies( + | ^^^^^^^ required by this bound in `sort_values_by_modules_dependencies` + = note: this error originates in the derive macro `Genesis` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting this bound - | -99 | struct Runtime { - | ++++++++++++++++++++++++++ + | +100 | struct Runtime { + | ++++++++++++++++++++++++++ error[E0308]: mismatched types - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:10 - | -97 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] - | ^^^^^^^ - | | - | expected `&mut WorkingSet`, found `&mut WorkingSet` - | arguments to this function are incorrect -98 | #[serialization(borsh::BorshDeserialize, borsh::BorshSerialize)] -99 | struct Runtime { - | - - expected type parameter - | | - | found type parameter - | - = note: expected mutable reference `&mut sov_modules_api::WorkingSet` - found mutable reference `&mut sov_modules_api::WorkingSet` - = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound - = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters + --> tests/rpc/expose_rpc_first_generic_not_context.rs:98:10 + | +98 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] + | ^^^^^^^ + | | + | expected `&mut WorkingSet`, found `&mut WorkingSet` + | arguments to this function are incorrect +99 | #[serialization(borsh::BorshDeserialize, borsh::BorshSerialize)] +100 | struct Runtime { + | - - expected type parameter + | | + | found type parameter + | + = note: expected mutable reference `&mut sov_modules_api::WorkingSet` + found mutable reference `&mut sov_modules_api::WorkingSet` + = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters note: method defined here - --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/mod.rs - | - | fn genesis( - | ^^^^^^^ - = note: this error originates in the derive macro `Genesis` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/mod.rs + | + | fn genesis( + | ^^^^^^^ + = note: this error originates in the derive macro `Genesis` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: arguments to this function are incorrect - --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:19 - | -97 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] - | ^^^^^^^^^^^^ - | | - | expected `&C`, found `&S` - | expected `&mut WorkingSet`, found `&mut WorkingSet` -98 | #[serialization(borsh::BorshDeserialize, borsh::BorshSerialize)] -99 | struct Runtime { - | - - - | | | - | | expected type parameter - | | expected type parameter - | found type parameter - | found type parameter - | - = note: expected reference `&C` - found reference `&S` - = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound - = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters - = note: expected mutable reference `&mut sov_modules_api::WorkingSet` - found mutable reference `&mut sov_modules_api::WorkingSet` - = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound - = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters + --> tests/rpc/expose_rpc_first_generic_not_context.rs:98:19 + | +98 | #[derive(Genesis, DispatchCall, MessageCodec, DefaultRuntime)] + | ^^^^^^^^^^^^ + | | + | expected `&C`, found `&S` + | expected `&mut WorkingSet`, found `&mut WorkingSet` +99 | #[serialization(borsh::BorshDeserialize, borsh::BorshSerialize)] +100 | struct Runtime { + | - - + | | | + | | expected type parameter + | | expected type parameter + | found type parameter + | found type parameter + | + = note: expected reference `&C` + found reference `&S` + = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters + = note: expected mutable reference `&mut sov_modules_api::WorkingSet` + found mutable reference `&mut sov_modules_api::WorkingSet` + = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters note: method defined here - --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/mod.rs - | - | fn call( - | ^^^^ - = note: this error originates in the derive macro `DispatchCall` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/module/mod.rs + | + | fn call( + | ^^^^ + = note: this error originates in the derive macro `DispatchCall` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:96:1 - | -96 | #[expose_rpc] - | ^^^^^^^^^^^^^ the trait `sov_modules_api::Context` is not implemented for `S` - | + --> tests/rpc/expose_rpc_first_generic_not_context.rs:97:1 + | +97 | #[expose_rpc] + | ^^^^^^^^^^^^^ the trait `sov_modules_api::Context` is not implemented for `S` + | note: required by a bound in `sov_modules_api::WorkingSet::::new` - --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/storage/scratchpad.rs - | - | impl WorkingSet { - | ^^^^^^^ required by this bound in `WorkingSet::::new` + --> $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-core/src/storage/scratchpad.rs + | + | impl WorkingSet { + | ^^^^^^^ required by this bound in `WorkingSet::::new` ... - | pub fn new(inner: ::Storage) -> Self { - | --- required by a bound in this associated function - = note: this error originates in the attribute macro `expose_rpc` (in Nightly builds, run with -Z macro-backtrace for more info) + | pub fn new(inner: ::Storage) -> Self { + | --- required by a bound in this associated function + = note: this error originates in the attribute macro `expose_rpc` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting this bound - | -99 | struct Runtime { - | ++++++++++++++++++++++++++ + | +100 | struct Runtime { + | ++++++++++++++++++++++++++ error[E0599]: the function or associated item `default` exists for struct `Runtime`, but its trait bounds were not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:114:50 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:115:50 | -99 | struct Runtime { +100 | struct Runtime { | --------------------------------------- function or associated item `default` not found for this struct because it doesn't satisfy `_: Default` ... -103 | struct ActualSpec; +104 | struct ActualSpec; | ----------------- doesn't satisfy `ActualSpec: sov_modules_api::Context` ... -114 | let runtime = &mut Runtime::::default(); +115 | let runtime = &mut Runtime::::default(); | ^^^^^^^ function or associated item cannot be called on `Runtime` due to unsatisfied trait bounds | ::: $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-api/src/default_context.rs @@ -466,79 +466,79 @@ note: the trait `sov_modules_api::Context` must be implemented candidate #1: `std::default::Default` error[E0277]: the trait bound `ZkDefaultContext: TestSpec` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:114:24 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:115:24 | -114 | let runtime = &mut Runtime::::default(); +115 | let runtime = &mut Runtime::::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TestSpec` is not implemented for `ZkDefaultContext` | = help: the trait `TestSpec` is implemented for `ActualSpec` note: required by a bound in `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:99:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:100:19 | -99 | struct Runtime { +100 | struct Runtime { | ^^^^^^^^ required by this bound in `Runtime` error[E0277]: the trait bound `ActualSpec: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:114:24 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:115:24 | -114 | let runtime = &mut Runtime::::default(); +115 | let runtime = &mut Runtime::::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `sov_modules_api::Context` is not implemented for `ActualSpec` | = help: the following other types implement trait `sov_modules_api::Context`: DefaultContext ZkDefaultContext note: required by a bound in `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:99:32 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:100:32 | -99 | struct Runtime { +100 | struct Runtime { | ^^^^^^^ required by this bound in `Runtime` error[E0277]: the trait bound `Runtime: EncodeCall>` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:120:10 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:121:10 | -120 | >>::encode_call(message); +121 | >>::encode_call(message); | ^^ the trait `EncodeCall>` is not implemented for `Runtime` | = help: the trait `EncodeCall::Data>>` is implemented for `Runtime` error[E0277]: the trait bound `ZkDefaultContext: TestSpec` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:120:10 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:121:10 | -120 | >>::encode_call(message); +121 | >>::encode_call(message); | ^^ the trait `TestSpec` is not implemented for `ZkDefaultContext` | = help: the trait `TestSpec` is implemented for `ActualSpec` note: required by a bound in `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:99:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:100:19 | -99 | struct Runtime { +100 | struct Runtime { | ^^^^^^^^ required by this bound in `Runtime` error[E0277]: the trait bound `ActualSpec: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:120:10 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:121:10 | -120 | >>::encode_call(message); +121 | >>::encode_call(message); | ^^ the trait `sov_modules_api::Context` is not implemented for `ActualSpec` | = help: the following other types implement trait `sov_modules_api::Context`: DefaultContext ZkDefaultContext note: required by a bound in `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:99:32 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:100:32 | -99 | struct Runtime { +100 | struct Runtime { | ^^^^^^^ required by this bound in `Runtime` error[E0599]: the function or associated item `decode_call` exists for struct `Runtime`, but its trait bounds were not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:121:22 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:122:22 | -99 | struct Runtime { +100 | struct Runtime { | --------------------------------------- function or associated item `decode_call` not found for this struct because it doesn't satisfy `_: DispatchCall` ... -103 | struct ActualSpec; +104 | struct ActualSpec; | ----------------- doesn't satisfy `ActualSpec: sov_modules_api::Context` ... -121 | let module = RT::decode_call(&serialized_message).unwrap(); +122 | let module = RT::decode_call(&serialized_message).unwrap(); | ^^^^^^^^^^^ function or associated item cannot be called on `Runtime` due to unsatisfied trait bounds | ::: $WORKSPACE/crates/sovereign-sdk/module-system/sov-modules-api/src/default_context.rs @@ -559,29 +559,29 @@ note: the trait `sov_modules_api::Context` must be implemented candidate #1: `sov_modules_api::DispatchCall` error[E0277]: the trait bound `ZkDefaultContext: TestSpec` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:121:18 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:122:18 | -121 | let module = RT::decode_call(&serialized_message).unwrap(); +122 | let module = RT::decode_call(&serialized_message).unwrap(); | ^^ the trait `TestSpec` is not implemented for `ZkDefaultContext` | = help: the trait `TestSpec` is implemented for `ActualSpec` note: required by a bound in `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:99:19 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:100:19 | -99 | struct Runtime { +100 | struct Runtime { | ^^^^^^^^ required by this bound in `Runtime` error[E0277]: the trait bound `ActualSpec: sov_modules_api::Context` is not satisfied - --> tests/rpc/expose_rpc_first_generic_not_context.rs:121:18 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:122:18 | -121 | let module = RT::decode_call(&serialized_message).unwrap(); +122 | let module = RT::decode_call(&serialized_message).unwrap(); | ^^ the trait `sov_modules_api::Context` is not implemented for `ActualSpec` | = help: the following other types implement trait `sov_modules_api::Context`: DefaultContext ZkDefaultContext note: required by a bound in `Runtime` - --> tests/rpc/expose_rpc_first_generic_not_context.rs:99:32 + --> tests/rpc/expose_rpc_first_generic_not_context.rs:100:32 | -99 | struct Runtime { +100 | struct Runtime { | ^^^^^^^ required by this bound in `Runtime` diff --git a/crates/sovereign-sdk/module-system/sov-modules-stf-blueprint/Cargo.toml b/crates/sovereign-sdk/module-system/sov-modules-stf-blueprint/Cargo.toml index 731a6c290..8f5be70af 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-stf-blueprint/Cargo.toml +++ b/crates/sovereign-sdk/module-system/sov-modules-stf-blueprint/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "sov-modules-stf-blueprint" -description = "Defines a generic state transition function for use with the Sovereign SDK module system" authors = { workspace = true } edition = { workspace = true } homepage = { workspace = true } license = { workspace = true } repository = { workspace = true } +description = "Defines a generic state transition function for use with the Sovereign SDK module system" version = { workspace = true } readme = "README.md" @@ -13,39 +13,44 @@ resolver = "2" [dependencies] anyhow = { workspace = true } -thiserror = { workspace = true } borsh = { workspace = true } -serde = { workspace = true, features = ["derive"] } -tracing = { workspace = true, optional = true } -jmt = { workspace = true } hex = { workspace = true } itertools = { workspace = true } +jmt = { workspace = true } +jsonrpsee = { workspace = true, features = ["server"], optional = true } +rs_merkle = { workspace = true } +serde = { workspace = true, features = ["derive"] } +thiserror = { workspace = true } +tracing = { workspace = true, optional = true } + +# Risc0 deps +risc0-zkvm = { workspace = true, default-features = false, features = ["std"], optional = true } +risc0-zkvm-platform = { workspace = true, optional = true } + +# Sovereign-SDK deps +sov-modules-api = { path = "../sov-modules-api", default-features = false } sov-rollup-interface = { path = "../../rollup-interface" } sov-state = { path = "../sov-state" } -sov-modules-api = { path = "../sov-modules-api", default-features = false } sov-zk-cycle-macros = { path = "../../utils/zk-cycle-macros", optional = true } sov-zk-cycle-utils = { path = "../../utils/zk-cycle-utils", optional = true } -risc0-zkvm = { workspace = true, default-features = false, features = [ - "std", -], optional = true } -risc0-zkvm-platform = { workspace = true, optional = true } -rs_merkle = { workspace = true } -jsonrpsee = { workspace = true, features = ["server"], optional = true } + +# Citrea Deps +citrea-primitives = { path = "../../../primitives" } [features] bench = ["sov-zk-cycle-macros", "risc0-zkvm", "risc0-zkvm-platform"] default = [] native = [ - "sov-state/native", - "sov-modules-api/native", - "dep:tracing", - "jsonrpsee", + "sov-state/native", + "sov-modules-api/native", + "dep:tracing", + "jsonrpsee", ] [package.metadata.cargo-udeps.ignore] normal = [ - "risc0-zkvm", - "risc0-zkvm-platform", - "sov-zk-cycle-macros", - "sov-zk-cycle-utils", + "risc0-zkvm", + "risc0-zkvm-platform", + "sov-zk-cycle-macros", + "sov-zk-cycle-utils", ] diff --git a/crates/sovereign-sdk/module-system/sov-modules-stf-blueprint/src/lib.rs b/crates/sovereign-sdk/module-system/sov-modules-stf-blueprint/src/lib.rs index a4044990a..3e16633b7 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-stf-blueprint/src/lib.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-stf-blueprint/src/lib.rs @@ -1,12 +1,8 @@ #![deny(missing_docs)] #![doc = include_str!("../README.md")] -mod batch; -mod stf_blueprint; -mod tx_verifier; - -pub use batch::Batch; use borsh::BorshDeserialize; +use citrea_primitives::fork::{fork_from_block_number, Fork, ForkManager}; use itertools::Itertools; use rs_merkle::algorithms::Sha256; use rs_merkle::MerkleTree; @@ -22,10 +18,17 @@ use sov_modules_api::{ use sov_rollup_interface::da::{DaData, SequencerCommitment}; use sov_rollup_interface::digest::Digest; use sov_rollup_interface::soft_confirmation::SignedSoftConfirmationBatch; +use sov_rollup_interface::spec::SpecId; pub use sov_rollup_interface::stf::{BatchReceipt, TransactionReceipt}; use sov_rollup_interface::stf::{SlotResult, StateTransitionFunction}; use sov_rollup_interface::zk::CumulativeStateDiff; use sov_state::Storage; + +mod batch; +mod stf_blueprint; +mod tx_verifier; + +pub use batch::Batch; pub use stf_blueprint::StfBlueprint; pub use tx_verifier::RawTx; @@ -35,6 +38,8 @@ pub struct RuntimeTxHook { pub height: u64, /// Sequencer public key pub sequencer: C::PublicKey, + /// Current spec + pub current_spec: SpecId, } /// This trait has to be implemented by a runtime in order to be used in `StfBlueprint`. @@ -127,8 +132,10 @@ pub trait StfBlueprintTrait: StateTransitionFunction { /// Begin a soft batch + #[allow(clippy::too_many_arguments)] fn begin_soft_batch( &self, + current_spec: SpecId, sequencer_public_key: &[u8], pre_state_root: &Self::StateRoot, pre_state: Self::PreState, @@ -140,6 +147,7 @@ pub trait StfBlueprintTrait: /// Apply soft batch transactions fn apply_soft_batch_txs( &self, + current_spec: SpecId, txs: Vec>, batch_workspace: WorkingSet, ) -> (WorkingSet, Vec>); @@ -147,6 +155,7 @@ pub trait StfBlueprintTrait: /// End a soft batch fn end_soft_batch( &self, + current_spec: SpecId, sequencer_public_key: &[u8], soft_batch: &mut SignedSoftConfirmationBatch, tx_receipts: Vec>, @@ -156,6 +165,7 @@ pub trait StfBlueprintTrait: /// Finalizes a soft batch fn finalize_soft_batch( &self, + current_spec: SpecId, batch_receipt: BatchReceipt<(), TxEffect>, checkpoint: StateCheckpoint, pre_state: Self::PreState, @@ -178,6 +188,7 @@ where { fn begin_soft_batch( &self, + current_spec: SpecId, sequencer_public_key: &[u8], pre_state_root: &Self::StateRoot, pre_state: ::Storage, @@ -210,19 +221,21 @@ where let checkpoint = StateCheckpoint::with_witness(pre_state, witness); - self.begin_soft_confirmation_inner(checkpoint, soft_batch, pre_state_root) + self.begin_soft_confirmation_inner(checkpoint, soft_batch, pre_state_root, current_spec) } fn apply_soft_batch_txs( &self, + current_spec: SpecId, txs: Vec>, batch_workspace: WorkingSet, ) -> (WorkingSet, Vec>) { - self.apply_sov_txs_inner(txs, batch_workspace) + self.apply_sov_txs_inner(txs, current_spec, batch_workspace) } fn end_soft_batch( &self, + _current_spec: SpecId, sequencer_public_key: &[u8], soft_batch: &mut SignedSoftConfirmationBatch, tx_receipts: Vec>, @@ -266,6 +279,7 @@ where fn finalize_soft_batch( &self, + _current_spec: SpecId, batch_receipt: BatchReceipt<(), TxEffect>, checkpoint: StateCheckpoint, pre_state: Self::PreState, @@ -386,6 +400,7 @@ where fn apply_slot<'a, I>( &self, + _current_spec: SpecId, _pre_state_root: &Self::StateRoot, _pre_state: Self::PreState, _witness: Self::Witness, @@ -407,6 +422,7 @@ where fn apply_soft_batch( &self, + current_spec: SpecId, sequencer_public_key: &[u8], pre_state_root: &Self::StateRoot, pre_state: Self::PreState, @@ -422,6 +438,7 @@ where Self::Witness, > { match self.begin_soft_batch( + current_spec, sequencer_public_key, pre_state_root, pre_state.clone(), @@ -431,16 +448,23 @@ where ) { (Ok(()), batch_workspace) => { let (batch_workspace, tx_receipts) = - self.apply_soft_batch_txs(soft_batch.txs(), batch_workspace); + self.apply_soft_batch_txs(current_spec, soft_batch.txs(), batch_workspace); let (batch_receipt, checkpoint) = self.end_soft_batch( + current_spec, sequencer_public_key, soft_batch, tx_receipts, batch_workspace, ); - self.finalize_soft_batch(batch_receipt, checkpoint, pre_state, soft_batch) + self.finalize_soft_batch( + current_spec, + batch_receipt, + checkpoint, + pre_state, + soft_batch, + ) } (Err(err), batch_workspace) => { native_warn!( @@ -472,6 +496,7 @@ where slot_headers: std::collections::VecDeque::BlockHeader>>, validity_condition: &::ValidityCondition, soft_confirmations: std::collections::VecDeque>, + forks: Vec<(SpecId, u64)>, ) -> (Self::StateRoot, CumulativeStateDiff) { let mut state_diff = CumulativeStateDiff::default(); @@ -638,6 +663,10 @@ where let mut da_block_headers_iter = da_block_headers.into_iter().peekable(); let mut da_block_header = da_block_headers_iter.next().unwrap(); + let mut l2_height = sequencer_commitment.l2_start_block_number; + let mut current_spec = fork_from_block_number(&forks, l2_height); + let mut fork_manager = ForkManager::new(l2_height, current_spec, forks.clone()); + // now that we verified the claimed root, we can apply the soft confirmations // should panic if the number of witnesses and soft confirmations don't match for (mut soft_confirmation, witness) in soft_confirmations.into_iter().zip_eq(witnesses) @@ -647,6 +676,7 @@ where } let result = self.apply_soft_batch( + current_spec, sequencer_public_key, ¤t_state_root, pre_state.clone(), @@ -658,7 +688,18 @@ where current_state_root = result.state_root; state_diff.extend(result.state_diff); + + // Notify fork manager about the block so that the next spec / fork + // is transitioned into if criteria is met. + if let Err(e) = fork_manager.register_block(l2_height) { + panic!("Fork transition failed {}", e); + } + l2_height += 1; + + // Update current spec for the next iteration + current_spec = fork_manager.active_fork(); } + assert_eq!(sequencer_commitment.l2_end_block_number, l2_height - 1); } (current_state_root, state_diff) diff --git a/crates/sovereign-sdk/module-system/sov-modules-stf-blueprint/src/stf_blueprint.rs b/crates/sovereign-sdk/module-system/sov-modules-stf-blueprint/src/stf_blueprint.rs index 0246ec2d7..7dd1199cd 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-stf-blueprint/src/stf_blueprint.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-stf-blueprint/src/stf_blueprint.rs @@ -5,6 +5,7 @@ use sov_modules_api::{ native_debug, native_error, Context, DaSpec, DispatchCall, StateCheckpoint, WorkingSet, }; use sov_rollup_interface::soft_confirmation::SignedSoftConfirmationBatch; +use sov_rollup_interface::spec::SpecId; use sov_rollup_interface::stf::{BatchReceipt, TransactionReceipt}; use sov_state::Storage; #[cfg(all(target_os = "zkvm", feature = "bench"))] @@ -61,6 +62,7 @@ where pub fn apply_sov_txs_inner( &self, txs: Vec>, + current_spec: SpecId, mut batch_workspace: WorkingSet, ) -> (WorkingSet, Vec>) { let txs = self.verify_txs_stateless_soft(&txs); @@ -85,6 +87,7 @@ where let hook = RuntimeTxHook { height: 1, sequencer: tx.pub_key().clone(), + current_spec, }; let ctx = match self .runtime @@ -109,7 +112,9 @@ where // Commit changes after pre_dispatch_tx_hook batch_workspace = batch_workspace.checkpoint().to_revertable(); - let tx_result = self.runtime.dispatch_call(msg, &mut batch_workspace, &ctx); + let tx_result = + self.runtime + .dispatch_call(msg, &mut batch_workspace, current_spec, &ctx); let events = batch_workspace.take_events(); let tx_effect = match tx_result { @@ -156,6 +161,7 @@ where checkpoint: StateCheckpoint, soft_batch: &mut SignedSoftConfirmationBatch, pre_state_root: &::Root, + current_spec: SpecId, ) -> (Result<(), ApplySoftConfirmationError>, WorkingSet) { native_debug!( "Beginning soft batch 0x{} from sequencer: 0x{}", @@ -170,6 +176,7 @@ where &mut HookSoftConfirmationInfo::new( soft_batch.clone(), pre_state_root.as_ref().to_vec(), + current_spec, ), &mut batch_workspace, ) { @@ -230,12 +237,18 @@ where checkpoint: StateCheckpoint, soft_batch: &mut SignedSoftConfirmationBatch, pre_state_root: &::Root, + current_spec: SpecId, ) -> (ApplySoftConfirmationResult, StateCheckpoint) { - match self.begin_soft_confirmation_inner(checkpoint, soft_batch, pre_state_root) { + match self.begin_soft_confirmation_inner( + checkpoint, + soft_batch, + pre_state_root, + current_spec, + ) { (Ok(()), batch_workspace) => { // TODO: wait for txs here, apply_sov_txs can be called multiple times let (batch_workspace, tx_receipts) = - self.apply_sov_txs_inner(soft_batch.txs(), batch_workspace); + self.apply_sov_txs_inner(soft_batch.txs(), current_spec, batch_workspace); self.end_soft_confirmation_inner(soft_batch, tx_receipts, batch_workspace) } diff --git a/crates/sovereign-sdk/rollup-interface/Cargo.toml b/crates/sovereign-sdk/rollup-interface/Cargo.toml index da5d0963a..476070f8e 100644 --- a/crates/sovereign-sdk/rollup-interface/Cargo.toml +++ b/crates/sovereign-sdk/rollup-interface/Cargo.toml @@ -43,6 +43,7 @@ proptest-derive = { workspace = true } default = ["std"] native = ["std", "tokio", "futures"] fuzzing = ["proptest", "proptest-derive", "sha2", "std"] +testing = ["native"] std = [ "anyhow/default", "borsh/default", diff --git a/crates/sovereign-sdk/rollup-interface/Makefile b/crates/sovereign-sdk/rollup-interface/Makefile index bc3018f1a..cce3522d5 100644 --- a/crates/sovereign-sdk/rollup-interface/Makefile +++ b/crates/sovereign-sdk/rollup-interface/Makefile @@ -6,5 +6,5 @@ help: ## Display this help message check-no-std: ## Checks that project compiles without std # check bare metal cargo hack check --feature-powerset \ - --exclude-features default,fuzzing,std,native \ + --exclude-features default,fuzzing,std,native,testing \ --target thumbv6m-none-eabi diff --git a/crates/sovereign-sdk/rollup-interface/src/lib.rs b/crates/sovereign-sdk/rollup-interface/src/lib.rs index f36ba6bc1..40c02a474 100644 --- a/crates/sovereign-sdk/rollup-interface/src/lib.rs +++ b/crates/sovereign-sdk/rollup-interface/src/lib.rs @@ -26,3 +26,6 @@ pub use alloc::sync::Arc as RefCount; pub use node::*; pub use {anyhow, digest}; + +/// Specs module +pub mod spec; diff --git a/crates/sovereign-sdk/rollup-interface/src/node/services/batch_builder.rs b/crates/sovereign-sdk/rollup-interface/src/node/services/batch_builder.rs index 3524dc207..ead46e34e 100644 --- a/crates/sovereign-sdk/rollup-interface/src/node/services/batch_builder.rs +++ b/crates/sovereign-sdk/rollup-interface/src/node/services/batch_builder.rs @@ -4,6 +4,8 @@ extern crate alloc; use alloc::vec::Vec; +use crate::spec::SpecId; + /// BlockBuilder trait is responsible for managing mempool and building batches. pub trait BatchBuilder { /// Accept a new transaction. @@ -12,5 +14,5 @@ pub trait BatchBuilder { /// Builds a new batch out of transactions in mempool. /// Logic of which transactions and how many of them is included in batch is up to implementation. - fn get_next_blob(&mut self) -> anyhow::Result>>; + fn get_next_blob(&mut self, current_spec: SpecId) -> anyhow::Result>>; } diff --git a/crates/sovereign-sdk/rollup-interface/src/spec.rs b/crates/sovereign-sdk/rollup-interface/src/spec.rs new file mode 100644 index 000000000..d48c63ed0 --- /dev/null +++ b/crates/sovereign-sdk/rollup-interface/src/spec.rs @@ -0,0 +1,56 @@ +#![allow(clippy::module_inception)] +use borsh::{BorshDeserialize, BorshSerialize}; +use serde::{Deserialize, Serialize}; +pub use spec::*; + +#[cfg(not(feature = "testing"))] +mod spec { + use super::*; + /// Fork specification + #[derive( + Debug, + Clone, + Copy, + Eq, + PartialEq, + Default, + BorshDeserialize, + BorshSerialize, + Serialize, + Deserialize, + )] + #[borsh(use_discriminant = true)] + pub enum SpecId { + /// Genesis spec + #[default] + Genesis = 0, + } +} + +#[cfg(feature = "testing")] +mod spec { + use super::*; + /// Fork specification + #[derive( + Debug, + Clone, + Copy, + Eq, + PartialEq, + Default, + BorshDeserialize, + BorshSerialize, + Serialize, + Deserialize, + )] + #[borsh(use_discriminant = true)] + pub enum SpecId { + /// Genesis spec + #[default] + Genesis = 0, + /// First fork + Fork1 = 1, + /// Second fork + Fork2 = 2, + } +} diff --git a/crates/sovereign-sdk/rollup-interface/src/state_machine/stf.rs b/crates/sovereign-sdk/rollup-interface/src/state_machine/stf.rs index 8d46784fd..e468c0d67 100644 --- a/crates/sovereign-sdk/rollup-interface/src/state_machine/stf.rs +++ b/crates/sovereign-sdk/rollup-interface/src/state_machine/stf.rs @@ -17,6 +17,7 @@ use serde::{Deserialize, Serialize}; use crate::da::DaSpec; use crate::soft_confirmation::SignedSoftConfirmationBatch; +use crate::spec::SpecId; use crate::zk::{CumulativeStateDiff, ValidityCondition, Zkvm}; #[cfg(any(all(test, feature = "sha2"), feature = "fuzzing"))] @@ -197,8 +198,10 @@ pub trait StateTransitionFunction { /// /// Commits state changes to the database #[allow(clippy::type_complexity)] + #[allow(clippy::too_many_arguments)] fn apply_slot<'a, I>( &self, + current_spec: SpecId, pre_state_root: &Self::StateRoot, pre_state: Self::PreState, witness: Self::Witness, @@ -230,6 +233,7 @@ pub trait StateTransitionFunction { #[allow(clippy::too_many_arguments)] fn apply_soft_batch( &self, + current_spec: SpecId, sequencer_public_key: &[u8], pre_state_root: &Self::StateRoot, pre_state: Self::PreState, @@ -263,6 +267,7 @@ pub trait StateTransitionFunction { slot_headers: VecDeque>, validity_condition: &Da::ValidityCondition, soft_confirmations: VecDeque>, + forks: Vec<(SpecId, u64)>, ) -> (Self::StateRoot, CumulativeStateDiff); } From 39a901d3e7b2ccd7452c7ff8b59ea3329cb6d59c Mon Sep 17 00:00:00 2001 From: Rakan Al-Huneiti Date: Mon, 12 Aug 2024 11:43:03 +0300 Subject: [PATCH 23/23] Remove postgres (#962) * Remove postgres * More cleanups * Remove db_config * Store mempool transactions * Wait for commitment alternative impl * Resolve mempool restoration test * Resolve all tests but one * Set last commitment l2 height in fullnode * Fix clippy check * Remove check_commitment_in_offchain_db test * Remove unused imports * Add comments --- .github/workflows/checks.yml | 28 -- Cargo.lock | 173 +------ Cargo.toml | 3 - Makefile | 3 +- bin/citrea/Cargo.toml | 1 - bin/citrea/src/lib.rs | 2 - bin/citrea/tests/e2e/mod.rs | 32 -- bin/citrea/tests/e2e/proving.rs | 135 +----- bin/citrea/tests/e2e/sequencer_behaviour.rs | 23 +- bin/citrea/tests/e2e/sequencer_replacement.rs | 91 ++-- bin/citrea/tests/e2e/syncing.rs | 2 - bin/citrea/tests/sequencer_commitments/mod.rs | 82 +--- bin/citrea/tests/test_helpers/mod.rs | 112 +++-- crates/fullnode/Cargo.toml | 1 - crates/fullnode/src/runner.rs | 2 + crates/prover/Cargo.toml | 1 - crates/prover/src/runner.rs | 36 +- crates/sequencer/Cargo.toml | 2 - crates/sequencer/src/commitment_controller.rs | 2 +- crates/sequencer/src/config.rs | 10 - crates/sequencer/src/rpc.rs | 34 +- crates/sequencer/src/sequencer.rs | 139 ++---- crates/shared-backup-db/Cargo.toml | 27 -- crates/shared-backup-db/README.md | 5 - crates/shared-backup-db/src/config.rs | 101 ---- crates/shared-backup-db/src/lib.rs | 7 - .../src/postgres_connector.rs | 440 ------------------ crates/shared-backup-db/src/tables.rs | 157 ------- .../full-node/db/sov-db/src/ledger_db/mod.rs | 78 +++- .../db/sov-db/src/ledger_db/traits.rs | 23 +- .../full-node/db/sov-db/src/schema/tables.rs | 6 + .../full-node/sov-stf-runner/Cargo.toml | 2 - .../full-node/sov-stf-runner/src/config.rs | 12 - docker-compose.postgres.yml | 11 - docs/run.md | 13 - .../bitcoin-regtest/sequencer_config.toml | 7 - .../mock-dockerized/sequencer_config.toml | 7 - resources/configs/mock/prover_config.toml | 7 - resources/configs/mock/sequencer_config.toml | 7 - resources/hive/.dockerignore | 1 - 40 files changed, 253 insertions(+), 1572 deletions(-) delete mode 100644 crates/shared-backup-db/Cargo.toml delete mode 100644 crates/shared-backup-db/README.md delete mode 100644 crates/shared-backup-db/src/config.rs delete mode 100644 crates/shared-backup-db/src/lib.rs delete mode 100644 crates/shared-backup-db/src/postgres_connector.rs delete mode 100644 crates/shared-backup-db/src/tables.rs delete mode 100644 docker-compose.postgres.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index e465201f2..5bd02f02e 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -148,20 +148,6 @@ jobs: coverage: runs-on: ubicloud-standard-16 if: github.event.pull_request.draft == false - services: - postgres: - image: postgres:latest - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: postgres - ports: - - 5432:5432 - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@1.78.0 @@ -342,20 +328,6 @@ jobs: runs-on: ubicloud-standard-16 timeout-minutes: 60 if: github.event.pull_request.draft == false - services: - postgres: - image: postgres:latest - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: postgres - ports: - - 5432:5432 - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 steps: - uses: actions/checkout@v4 - uses: rui314/setup-mold@v1 diff --git a/Cargo.lock b/Cargo.lock index 838de227b..80f8d7532 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,7 +20,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "cpp_demangle", - "fallible-iterator 0.3.0", + "fallible-iterator", "gimli", "memmap2 0.9.4", "object 0.35.0", @@ -1820,7 +1820,6 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "shared-backup-db", "soft-confirmation-rule-enforcer", "sov-db", "sov-ledger-rpc", @@ -1897,7 +1896,6 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "shared-backup-db", "sov-db", "sov-mock-da", "sov-mock-zkvm", @@ -1946,7 +1944,6 @@ dependencies = [ "sequencer-client", "serde", "sha2 0.10.8", - "shared-backup-db", "sov-db", "sov-mock-da", "sov-mock-zkvm", @@ -1995,7 +1992,6 @@ dependencies = [ "citrea-evm", "citrea-primitives", "citrea-stf", - "deadpool-postgres", "digest 0.10.7", "futures", "hex", @@ -2016,7 +2012,6 @@ dependencies = [ "schnellru", "serde", "serde_json", - "shared-backup-db", "soft-confirmation-rule-enforcer", "sov-accounts", "sov-db", @@ -2553,39 +2548,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "deadpool" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6541a3916932fe57768d4be0b1ffb5ec7cbf74ca8c903fdfd5c0fe8aa958f0ed" -dependencies = [ - "deadpool-runtime", - "num_cpus", - "tokio", -] - -[[package]] -name = "deadpool-postgres" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19be9da496d60d03ec3ab45d960d80a3afb285b787394b83614a79942f467e7f" -dependencies = [ - "deadpool", - "getrandom 0.2.15", - "tokio", - "tokio-postgres", - "tracing", -] - -[[package]] -name = "deadpool-runtime" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b" -dependencies = [ - "tokio", -] - [[package]] name = "delay_map" version = "0.3.0" @@ -3145,12 +3107,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - [[package]] name = "fallible-iterator" version = "0.3.0" @@ -3439,7 +3395,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" dependencies = [ - "fallible-iterator 0.3.0", + "fallible-iterator", "stable_deref_trait", ] @@ -5062,16 +5018,6 @@ dependencies = [ "rawpointer", ] -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest 0.10.7", -] - [[package]] name = "memchr" version = "2.7.4" @@ -5824,37 +5770,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" -[[package]] -name = "postgres-protocol" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" -dependencies = [ - "base64 0.21.7", - "byteorder", - "bytes", - "fallible-iterator 0.2.0", - "hmac 0.12.1", - "md-5", - "memchr", - "rand 0.8.5", - "sha2 0.10.8", - "stringprep", -] - -[[package]] -name = "postgres-types" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2234cdee9408b523530a9b6d2d6b373d1db34f6a8e51dc03ded1828d7fb67c" -dependencies = [ - "bytes", - "fallible-iterator 0.2.0", - "postgres-protocol", - "serde", - "serde_json", -] - [[package]] name = "powerfmt" version = "0.2.0" @@ -6195,15 +6110,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.5.2" @@ -7759,7 +7665,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b838eba278d213a8beaf485bd313fd580ca4505a00d5871caeb1457c55322cae" dependencies = [ "bitflags 2.5.0", - "fallible-iterator 0.3.0", + "fallible-iterator", "fallible-streaming-iterator", "hashlink 0.9.1", "libsqlite3-sys", @@ -8317,18 +8223,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "shared-backup-db" -version = "0.4.0-rc.3" -dependencies = [ - "deadpool-postgres", - "postgres-types", - "serde", - "sov-rollup-interface", - "tokio", - "tracing", -] - [[package]] name = "shell-escape" version = "0.1.5" @@ -8976,7 +8870,6 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "shared-backup-db", "sov-db", "sov-mock-da", "sov-modules-api", @@ -9089,17 +8982,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stringprep" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" -dependencies = [ - "unicode-bidi", - "unicode-normalization", - "unicode-properties", -] - [[package]] name = "strsim" version = "0.9.3" @@ -9438,32 +9320,6 @@ dependencies = [ "syn 2.0.66", ] -[[package]] -name = "tokio-postgres" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d340244b32d920260ae7448cb72b6e238bddc3d4f7603394e7dd46ed8e48f5b8" -dependencies = [ - "async-trait", - "byteorder", - "bytes", - "fallible-iterator 0.2.0", - "futures-channel", - "futures-util", - "log", - "parking_lot 0.12.3", - "percent-encoding", - "phf", - "pin-project-lite", - "postgres-protocol", - "postgres-types", - "rand 0.8.5", - "socket2 0.5.7", - "tokio", - "tokio-util", - "whoami", -] - [[package]] name = "tokio-rustls" version = "0.24.1" @@ -9969,12 +9825,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-properties" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" - [[package]] name = "unicode-segmentation" version = "1.11.0" @@ -10123,12 +9973,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wasite" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" - [[package]] name = "wasm-bindgen" version = "0.2.92" @@ -10232,17 +10076,6 @@ dependencies = [ "winsafe", ] -[[package]] -name = "whoami" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" -dependencies = [ - "redox_syscall 0.4.1", - "wasite", - "web-sys", -] - [[package]] name = "widestring" version = "1.1.0" diff --git a/Cargo.toml b/Cargo.toml index ddd892f3f..e6a304762 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,6 @@ members = [ "crates/sequencer", "crates/sequencer-client", "crates/soft-confirmation-rule-enforcer", - "crates/shared-backup-db", # Sovereign sdk "crates/sovereign-sdk/rollup-interface", "crates/sovereign-sdk/adapters/risc0", @@ -84,10 +83,8 @@ byteorder = { version = "1.5.0", default-features = false } bytes = { version = "1.2.1", default-features = false } chrono = { version = "0.4.37", default-features = false } digest = { version = "0.10.6", default-features = false, features = ["alloc"] } -deadpool-postgres = "0.13.1" itertools = { version = "0.13.0", default-features = false } lru = "0.12.3" -postgres-types = "0.2.6" rs_merkle = "1.4.2" futures = "0.3" pin-project = { version = "1.1.3" } diff --git a/Makefile b/Makefile index ac6cd13aa..50d7d0395 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,6 @@ clean: ## Cleans compiled @cargo clean clean-node: ## Cleans local dbs needed for sequencer and nodes - sudo rm -rf resources/dbs/postgres rm -rf resources/dbs/sequencer-db rm -rf resources/dbs/prover-db rm -rf resources/dbs/full-node-db @@ -115,4 +114,4 @@ genesis: # Set production genesis from system contract source files genesis-prod: - $(MAKE) -C crates/evm/src/evm/system_contracts genesis-prod \ No newline at end of file + $(MAKE) -C crates/evm/src/evm/system_contracts genesis-prod diff --git a/bin/citrea/Cargo.toml b/bin/citrea/Cargo.toml index c8c8167d4..4412f4d72 100644 --- a/bin/citrea/Cargo.toml +++ b/bin/citrea/Cargo.toml @@ -59,7 +59,6 @@ tracing-subscriber = { workspace = true } [dev-dependencies] citrea-evm = { path = "../../crates/evm", features = ["native"] } -shared-backup-db = { path = "../../crates/shared-backup-db", features = ["test-utils"] } sov-mock-da = { path = "../../crates/sovereign-sdk/adapters/mock-da", default-features = false } sov-prover-storage-manager = { path = "../../crates/sovereign-sdk/full-node/sov-prover-storage-manager", features = ["test-utils"] } sov-rollup-interface = { path = "../../crates/sovereign-sdk/rollup-interface", features = ["fuzzing"] } diff --git a/bin/citrea/src/lib.rs b/bin/citrea/src/lib.rs index b194a0796..95ed90893 100644 --- a/bin/citrea/src/lib.rs +++ b/bin/citrea/src/lib.rs @@ -29,8 +29,6 @@ pub fn initialize_logging(level: Level) { "jsonrpsee-server=info".to_owned(), "sov_schema_db=info".to_owned(), "sov_prover_storage_manager=info".to_owned(), - // Limit output as much as possible, use WARN. - "tokio_postgres=warn".to_owned(), ]; debug_components.join(",") })) diff --git a/bin/citrea/tests/e2e/mod.rs b/bin/citrea/tests/e2e/mod.rs index 8235dc96f..df4fe2a60 100644 --- a/bin/citrea/tests/e2e/mod.rs +++ b/bin/citrea/tests/e2e/mod.rs @@ -15,7 +15,6 @@ use std::time::Duration; use citrea_evm::smart_contracts::SimpleStorageContract; use citrea_stf::genesis_config::GenesisPaths; use reth_primitives::{Address, BlockNumberOrTag, U256}; -use shared_backup_db::{PostgresConnector, SharedBackupDbConfig}; use sov_mock_da::{MockAddress, MockDaService}; use sov_rollup_interface::rpc::{LastVerifiedProofResponse, SoftConfirmationStatus}; use sov_rollup_interface::services::da::DaService; @@ -63,11 +62,6 @@ async fn test_all_flow() { let prover_db_dir = storage_dir.path().join("prover").to_path_buf(); let fullnode_db_dir = storage_dir.path().join("full-node").to_path_buf(); - let psql_db_name = "test_all_flow".to_owned(); - let db_test_client = PostgresConnector::new_test_client(psql_db_name.clone()) - .await - .unwrap(); - let (seq_port_tx, seq_port_rx) = tokio::sync::oneshot::channel(); let da_db_dir_cloned = da_db_dir.clone(); @@ -103,7 +97,6 @@ async fn test_all_flow() { Some(ProverConfig { proving_mode: sov_stf_runner::ProverGuestRunConfig::Execute, proof_sampling_number: 0, - db_config: Some(SharedBackupDbConfig::default().set_db_name(psql_db_name)), }), NodeMode::Prover(seq_port), prover_db_dir, @@ -212,19 +205,6 @@ async fn test_all_flow() { .ledger_get_proof_by_slot_height(3) .await; - let db_proofs = db_test_client.get_all_proof_data().await.unwrap(); - - assert_eq!(db_proofs.len(), 1); - assert_eq!( - db_proofs[0].state_transition.0.sequencer_da_public_key, - prover_proof.state_transition.sequencer_da_public_key - ); - assert_eq!( - db_proofs[0].state_transition.0.sequencer_public_key, - prover_proof.state_transition.sequencer_public_key - ); - assert_eq!(db_proofs[0].l1_tx_id, prover_proof.l1_tx_id); - // the proof will be in l1 block #4 because prover publishes it after the commitment and in mock da submitting proof and commitments creates a new block // For full node to see the proof, we publish another l2 block and now it will check #4 l1 block // 6th soft batch @@ -327,18 +307,6 @@ async fn test_all_flow() { .ledger_get_proof_by_slot_height(5) .await; - let db_proofs = db_test_client.get_all_proof_data().await.unwrap(); - - assert_eq!(db_proofs.len(), 2); - assert_eq!( - db_proofs[1].state_transition.0.sequencer_da_public_key, - prover_proof_data.state_transition.sequencer_da_public_key - ); - assert_eq!( - db_proofs[1].state_transition.0.sequencer_public_key, - prover_proof_data.state_transition.sequencer_public_key - ); - wait_for_proof(&full_node_test_client, 6, Some(Duration::from_secs(120))).await; let full_node_proof_data = full_node_test_client .ledger_get_verified_proofs_by_slot_height(6) diff --git a/bin/citrea/tests/e2e/proving.rs b/bin/citrea/tests/e2e/proving.rs index 1551e621d..e6dce4965 100644 --- a/bin/citrea/tests/e2e/proving.rs +++ b/bin/citrea/tests/e2e/proving.rs @@ -2,148 +2,20 @@ use std::time::Duration; use citrea_stf::genesis_config::GenesisPaths; -use shared_backup_db::{PostgresConnector, ProofType, SharedBackupDbConfig}; use sov_mock_da::{MockAddress, MockDaService}; -use sov_rollup_interface::rpc::{ProofRpcResponse, SoftConfirmationStatus}; +use sov_rollup_interface::rpc::SoftConfirmationStatus; use sov_rollup_interface::services::da::DaService; use sov_stf_runner::ProverConfig; use crate::evm::make_test_client; use crate::test_helpers::{ - start_rollup, tempdir_with_children, wait_for_l1_block, wait_for_l2_block, - wait_for_postgres_proofs, wait_for_proof, wait_for_prover_l1_height, NodeMode, + start_rollup, tempdir_with_children, wait_for_l1_block, wait_for_l2_block, wait_for_proof, + wait_for_prover_l1_height, NodeMode, }; use crate::{ DEFAULT_DEPOSIT_MEMPOOL_FETCH_LIMIT, DEFAULT_PROOF_WAIT_DURATION, TEST_DATA_GENESIS_PATH, }; -/// Run the sequencer and the prover node. -/// Trigger proof production. -/// Check if the proof can be queried from the prover node and the database. -#[tokio::test(flavor = "multi_thread")] -async fn test_db_get_proof() { - // citrea::initialize_logging(tracing::Level::INFO); - - let storage_dir = tempdir_with_children(&["DA", "sequencer", "prover"]); - let sequencer_db_dir = storage_dir.path().join("sequencer").to_path_buf(); - let prover_db_dir = storage_dir.path().join("prover").to_path_buf(); - let da_db_dir = storage_dir.path().join("DA").to_path_buf(); - - let psql_db_name = "test_db_get_proof".to_string(); - let db_test_client = PostgresConnector::new_test_client(psql_db_name.clone()) - .await - .unwrap(); - - let (seq_port_tx, seq_port_rx) = tokio::sync::oneshot::channel(); - - let da_db_dir_cloned = da_db_dir.clone(); - let seq_task = tokio::spawn(async { - start_rollup( - seq_port_tx, - GenesisPaths::from_dir(TEST_DATA_GENESIS_PATH), - None, - NodeMode::SequencerNode, - sequencer_db_dir, - da_db_dir_cloned, - 4, - true, - None, - None, - Some(true), - DEFAULT_DEPOSIT_MEMPOOL_FETCH_LIMIT, - ) - .await; - }); - - let seq_port = seq_port_rx.await.unwrap(); - let test_client = make_test_client(seq_port).await; - let da_service = MockDaService::new(MockAddress::from([0; 32]), &da_db_dir); - - let (prover_node_port_tx, prover_node_port_rx) = tokio::sync::oneshot::channel(); - - let da_db_dir_cloned = da_db_dir.clone(); - let prover_node_task = tokio::spawn(async move { - start_rollup( - prover_node_port_tx, - GenesisPaths::from_dir(TEST_DATA_GENESIS_PATH), - Some(ProverConfig { - proving_mode: sov_stf_runner::ProverGuestRunConfig::Execute, - proof_sampling_number: 0, - db_config: Some(SharedBackupDbConfig::default().set_db_name(psql_db_name)), - }), - NodeMode::Prover(seq_port), - prover_db_dir, - da_db_dir_cloned, - 4, - true, - None, - None, - Some(true), - DEFAULT_DEPOSIT_MEMPOOL_FETCH_LIMIT, - ) - .await; - }); - - let prover_node_port = prover_node_port_rx.await.unwrap(); - - let prover_node_test_client = make_test_client(prover_node_port).await; - da_service.publish_test_block().await.unwrap(); - wait_for_l1_block(&da_service, 2, None).await; - - test_client.send_publish_batch_request().await; - test_client.send_publish_batch_request().await; - test_client.send_publish_batch_request().await; - test_client.send_publish_batch_request().await; - wait_for_l2_block(&test_client, 4, None).await; - - // Commitment - wait_for_l1_block(&da_service, 3, None).await; - - // wait here until we see from prover's rpc that it finished proving - wait_for_prover_l1_height( - &prover_node_test_client, - 4, - Some(Duration::from_secs(DEFAULT_PROOF_WAIT_DURATION)), - ) - .await; - - wait_for_postgres_proofs(&db_test_client, 1, Some(Duration::from_secs(60))).await; - - let ledger_proof = prover_node_test_client - .ledger_get_proof_by_slot_height(3) - .await; - - let db_proofs = db_test_client.get_all_proof_data().await.unwrap(); - - assert_eq!(db_proofs.len(), 1); - - let db_state_transition = &db_proofs[0].state_transition.0; - - assert_eq!( - db_state_transition.sequencer_da_public_key, - ledger_proof.state_transition.sequencer_da_public_key - ); - assert_eq!( - db_state_transition.sequencer_public_key, - ledger_proof.state_transition.sequencer_public_key - ); - assert_eq!(db_proofs[0].l1_tx_id, ledger_proof.l1_tx_id); - - match ledger_proof.proof { - ProofRpcResponse::Full(p) => { - assert_eq!(db_proofs[0].proof_type, ProofType::Full); - assert_eq!(db_proofs[0].proof_data, p) - } - ProofRpcResponse::PublicInput(p) => { - assert_eq!(db_proofs[0].proof_type, ProofType::PublicInput); - assert_eq!(db_proofs[0].proof_data, p) - } - }; - - seq_task.abort(); - prover_node_task.abort(); -} - /// Run the sequencer, prover and full node. /// Trigger proof production. /// Check if the verified proof can be queried from the full node. @@ -193,7 +65,6 @@ async fn full_node_verify_proof_and_store() { Some(ProverConfig { proving_mode: sov_stf_runner::ProverGuestRunConfig::Execute, proof_sampling_number: 0, - db_config: None, }), NodeMode::Prover(seq_port), prover_db_dir, diff --git a/bin/citrea/tests/e2e/sequencer_behaviour.rs b/bin/citrea/tests/e2e/sequencer_behaviour.rs index 5613a0e69..5db7e6b15 100644 --- a/bin/citrea/tests/e2e/sequencer_behaviour.rs +++ b/bin/citrea/tests/e2e/sequencer_behaviour.rs @@ -10,7 +10,6 @@ use citrea_primitives::TEST_PRIVATE_KEY; use citrea_sequencer::{SequencerConfig, SequencerMempoolConfig}; use citrea_stf::genesis_config::GenesisPaths; use reth_primitives::{Address, BlockNumberOrTag}; -use shared_backup_db::{PostgresConnector, SharedBackupDbConfig}; use sov_mock_da::{MockAddress, MockDaService, MockDaSpec}; use tokio::time::sleep; @@ -18,8 +17,8 @@ use crate::e2e::{initialize_test, TestConfig}; use crate::evm::{init_test_rollup, make_test_client}; use crate::test_client::TestClient; use crate::test_helpers::{ - create_default_sequencer_config, start_rollup, tempdir_with_children, wait_for_l1_block, - wait_for_l2_block, wait_for_postgres_commitment, NodeMode, + create_default_sequencer_config, start_rollup, tempdir_with_children, wait_for_commitment, + wait_for_l1_block, wait_for_l2_block, NodeMode, }; use crate::{ DEFAULT_DEPOSIT_MEMPOOL_FETCH_LIMIT, DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, @@ -58,7 +57,6 @@ async fn test_sequencer_fill_missing_da_blocks() -> Result<(), anyhow::Error> { test_mode: true, deposit_mempool_fetch_limit: 10, mempool_conf: Default::default(), - db_config: Default::default(), da_update_interval_ms: 500, block_production_interval_ms: 500, }), @@ -141,18 +139,13 @@ async fn test_sequencer_commitment_threshold() { let da_db_dir = storage_dir.path().join("DA").to_path_buf(); let sequencer_db_dir = storage_dir.path().join("sequencer").to_path_buf(); - let psql_db_name = "test_sequencer_commitment_threshold".to_owned(); - - let db_test_client = PostgresConnector::new_test_client(psql_db_name.clone()) - .await - .unwrap(); + let da_service = MockDaService::new(MockAddress::from([0; 32]), &da_db_dir); // Put a large number for commitment threshold let min_soft_confirmations_per_commitment = 1_000_000; let mut sequencer_config = create_default_sequencer_config(min_soft_confirmations_per_commitment, Some(true), 10); - sequencer_config.db_config = Some(SharedBackupDbConfig::default().set_db_name(psql_db_name)); sequencer_config.mempool_conf = SequencerMempoolConfig { max_account_slots: 1000, ..Default::default() @@ -199,8 +192,7 @@ async fn test_sequencer_commitment_threshold() { wait_for_l2_block(&seq_test_client, 11, Some(Duration::from_secs(60))).await; // At block 725, the state diff should be large enough to trigger a commitment. - wait_for_postgres_commitment(&db_test_client, 1, Some(Duration::from_secs(60))).await; - let commitments = db_test_client.get_all_commitments().await.unwrap(); + let commitments = wait_for_commitment(&da_service, 2, Some(Duration::from_secs(60))).await; assert_eq!(commitments.len(), 1); for _ in 0..10 { @@ -218,9 +210,8 @@ async fn test_sequencer_commitment_threshold() { // At block 1450, the state diff should be large enough to trigger a commitment. // But the 50 remaining blocks state diff should NOT trigger a third. - wait_for_postgres_commitment(&db_test_client, 2, Some(Duration::from_secs(60))).await; - let commitments = db_test_client.get_all_commitments().await.unwrap(); - assert_eq!(commitments.len(), 2); + let commitments = wait_for_commitment(&da_service, 3, Some(Duration::from_secs(60))).await; + assert_eq!(commitments.len(), 1); seq_task.abort(); } @@ -373,7 +364,6 @@ async fn test_gas_limit_too_high() { max_account_slots: tx_count * 2, ..Default::default() }, - db_config: Default::default(), da_update_interval_ms: 1000, block_production_interval_ms: 1000, }), @@ -515,7 +505,6 @@ async fn test_system_tx_effect_on_block_gas_limit() -> Result<(), anyhow::Error> max_account_slots: 100, ..Default::default() }, - db_config: Default::default(), da_update_interval_ms: 1000, block_production_interval_ms: 500, }), diff --git a/bin/citrea/tests/e2e/sequencer_replacement.rs b/bin/citrea/tests/e2e/sequencer_replacement.rs index 2822bdb52..9825af4fe 100644 --- a/bin/citrea/tests/e2e/sequencer_replacement.rs +++ b/bin/citrea/tests/e2e/sequencer_replacement.rs @@ -9,15 +9,15 @@ use alloy_rlp::Decodable; use citrea_sequencer::SequencerMempoolConfig; use citrea_stf::genesis_config::GenesisPaths; use reth_primitives::{Address, BlockNumberOrTag}; -use shared_backup_db::{PostgresConnector, SharedBackupDbConfig}; +use sov_db::ledger_db::{LedgerDB, SequencerLedgerOps}; use sov_mock_da::{MockAddress, MockDaService}; use tokio::time::sleep; use crate::e2e::{copy_dir_recursive, execute_blocks, TestConfig}; use crate::evm::{init_test_rollup, make_test_client}; use crate::test_helpers::{ - create_default_sequencer_config, start_rollup, tempdir_with_children, wait_for_l1_block, - wait_for_l2_block, wait_for_postgres_commitment, NodeMode, + create_default_sequencer_config, start_rollup, tempdir_with_children, wait_for_commitment, + wait_for_l1_block, wait_for_l2_block, NodeMode, }; use crate::{ DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT, DEFAULT_PROOF_WAIT_DURATION, @@ -30,22 +30,14 @@ use crate::{ /// Check if the full node can continue block production. #[tokio::test(flavor = "multi_thread")] async fn test_sequencer_crash_and_replace_full_node() -> Result<(), anyhow::Error> { - // citrea::initialize_logging(tracing::Level::DEBUG); + citrea::initialize_logging(tracing::Level::DEBUG); let storage_dir = tempdir_with_children(&["DA", "sequencer", "full-node"]); let da_db_dir = storage_dir.path().join("DA").to_path_buf(); let sequencer_db_dir = storage_dir.path().join("sequencer").to_path_buf(); let fullnode_db_dir = storage_dir.path().join("full-node").to_path_buf(); - let psql_db_name = "sequencer_crash_and_replace_full_node".to_owned(); - - let db_test_client = PostgresConnector::new_test_client(psql_db_name.clone()) - .await - .unwrap(); - - let mut sequencer_config = create_default_sequencer_config(4, Some(true), 10); - - sequencer_config.db_config = Some(SharedBackupDbConfig::default().set_db_name(psql_db_name)); + let sequencer_config = create_default_sequencer_config(4, Some(true), 10); let da_service = MockDaService::with_finality(MockAddress::from([0; 32]), 0, &da_db_dir); da_service.publish_test_block().await.unwrap(); @@ -128,9 +120,10 @@ async fn test_sequencer_crash_and_replace_full_node() -> Result<(), anyhow::Erro // assume sequencer craashed seq_task.abort(); - wait_for_postgres_commitment(&db_test_client, 1, Some(Duration::from_secs(60))).await; - let commitments = db_test_client.get_all_commitments().await.unwrap(); + let commitments = wait_for_commitment(&da_service, 2, Some(Duration::from_secs(60))).await; assert_eq!(commitments.len(), 1); + assert_eq!(commitments[0].l2_start_block_number, 1); + assert_eq!(commitments[0].l2_end_block_number, 4); full_node_task.abort(); @@ -175,19 +168,16 @@ async fn test_sequencer_crash_and_replace_full_node() -> Result<(), anyhow::Erro wait_for_l1_block(&da_service, 3, None).await; - wait_for_postgres_commitment( - &db_test_client, - 2, + let commitments = wait_for_commitment( + &da_service, + 3, Some(Duration::from_secs(DEFAULT_PROOF_WAIT_DURATION)), ) .await; - let commitments = db_test_client.get_all_commitments().await.unwrap(); - assert_eq!(commitments.len(), 2); - assert_eq!(commitments[0].l2_start_height, 1); - assert_eq!(commitments[0].l2_end_height, 4); - assert_eq!(commitments[1].l2_start_height, 5); - assert_eq!(commitments[1].l2_end_height, 8); + assert_eq!(commitments.len(), 1); + assert_eq!(commitments[0].l2_start_block_number, 5); + assert_eq!(commitments[0].l2_end_block_number, 8); seq_task.abort(); @@ -208,19 +198,11 @@ async fn test_sequencer_crash_restore_mempool() -> Result<(), anyhow::Error> { let sequencer_db_dir = storage_dir.path().join("sequencer").to_path_buf(); let da_db_dir = storage_dir.path().join("DA").to_path_buf(); - let db_test_client = - PostgresConnector::new_test_client("sequencer_crash_restore_mempool".to_owned()) - .await - .unwrap(); - let mut sequencer_config = create_default_sequencer_config(4, Some(true), 10); sequencer_config.mempool_conf = SequencerMempoolConfig { max_account_slots: 100, ..Default::default() }; - sequencer_config.db_config = Some( - SharedBackupDbConfig::default().set_db_name("sequencer_crash_restore_mempool".to_owned()), - ); let da_service = MockDaService::with_finality(MockAddress::from([0; 32]), 2, &da_db_dir.clone()); @@ -277,18 +259,31 @@ async fn test_sequencer_crash_restore_mempool() -> Result<(), anyhow::Error> { assert_eq!(tx_1.hash, *tx_hash); assert_eq!(tx_2.hash, *tx_hash2); - let txs = db_test_client.get_all_txs().await.unwrap(); + // crash and reopen and check if the txs are in the mempool + seq_task.abort(); + + // Copy data into a separate directory since the original sequencer + // directory is locked by a LOCK file. + // This would enable us to access ledger DB directly. + let _ = copy_dir_recursive( + &sequencer_db_dir, + &storage_dir.path().join("sequencer_unlocked"), + ); + let sequencer_db_dir = storage_dir.path().join("sequencer_unlocked").to_path_buf(); + let ledger_db = LedgerDB::with_path(sequencer_db_dir.clone()) + .expect("Should be able to open after stopping the sequencer"); + let txs = ledger_db.get_mempool_txs().unwrap(); assert_eq!(txs.len(), 2); - assert_eq!(txs[0].tx_hash, tx_hash.to_vec()); - assert_eq!(txs[1].tx_hash, tx_hash2.to_vec()); + assert_eq!(txs[1].0, tx_hash.to_vec()); + assert_eq!(txs[0].0, tx_hash2.to_vec()); let signed_tx = Signed::::try_from(tx_1.clone()).unwrap(); let envelope = TxEnvelope::Eip1559(signed_tx); - let decoded = TxEnvelope::decode(&mut txs[0].tx.as_ref()).unwrap(); + let decoded = TxEnvelope::decode(&mut txs[1].1.as_ref()).unwrap(); assert_eq!(envelope, decoded); - // crash and reopen and check if the txs are in the mempool - seq_task.abort(); + // Remove lock + drop(ledger_db); let _ = copy_dir_recursive( &sequencer_db_dir, @@ -300,13 +295,14 @@ async fn test_sequencer_crash_restore_mempool() -> Result<(), anyhow::Error> { let config1 = sequencer_config.clone(); let da_db_dir_cloned = da_db_dir.clone(); let sequencer_db_dir = storage_dir.path().join("sequencer_copy").to_path_buf(); + let sequencer_db_dir_cloned = sequencer_db_dir.clone(); let seq_task = tokio::spawn(async move { start_rollup( seq_port_tx, GenesisPaths::from_dir(TEST_DATA_GENESIS_PATH), None, NodeMode::SequencerNode, - sequencer_db_dir, + sequencer_db_dir_cloned, da_db_dir_cloned, 4, true, @@ -337,7 +333,7 @@ async fn test_sequencer_crash_restore_mempool() -> Result<(), anyhow::Error> { assert_eq!(tx_1_mempool, tx_1); assert_eq!(tx_2_mempool, tx_2); - // publish block and check if the txs are deleted from pg + // publish block and check if the txs are deleted from ledger seq_test_client.send_publish_batch_request().await; wait_for_l2_block(&seq_test_client, 1, None).await; @@ -355,11 +351,22 @@ async fn test_sequencer_crash_restore_mempool() -> Result<(), anyhow::Error> { .await .is_none()); - let txs = db_test_client.get_all_txs().await.unwrap(); + seq_task.abort(); + + // Copy data into a separate directory since the original sequencer + // directory is locked by a LOCK file. + // This would enable us to access ledger DB directly. + let _ = copy_dir_recursive( + &sequencer_db_dir, + &storage_dir.path().join("sequencer_unlocked"), + ); + let sequencer_db_dir = storage_dir.path().join("sequencer_unlocked").to_path_buf(); + let ledger_db = LedgerDB::with_path(sequencer_db_dir.clone()) + .expect("Should be able to open after stopping the sequencer"); + let txs = ledger_db.get_mempool_txs().unwrap(); // should be removed from db assert_eq!(txs.len(), 0); - seq_task.abort(); Ok(()) } diff --git a/bin/citrea/tests/e2e/syncing.rs b/bin/citrea/tests/e2e/syncing.rs index 88a03a989..f9d8b7fb1 100644 --- a/bin/citrea/tests/e2e/syncing.rs +++ b/bin/citrea/tests/e2e/syncing.rs @@ -5,7 +5,6 @@ use std::time::Duration; use citrea_stf::genesis_config::GenesisPaths; use ethereum_rpc::CitreaStatus; use reth_primitives::{Address, BlockNumberOrTag}; -use shared_backup_db::SharedBackupDbConfig; use sov_mock_da::{MockAddress, MockDaService, MockDaSpec, MockHash}; use sov_rollup_interface::da::{DaData, DaSpec}; use sov_rollup_interface::services::da::DaService; @@ -304,7 +303,6 @@ async fn test_prover_sync_with_commitments() -> Result<(), anyhow::Error> { GenesisPaths::from_dir(TEST_DATA_GENESIS_PATH), Some(ProverConfig { proving_mode: sov_stf_runner::ProverGuestRunConfig::Execute, - db_config: Some(SharedBackupDbConfig::default()), proof_sampling_number: 0, }), NodeMode::Prover(seq_port), diff --git a/bin/citrea/tests/sequencer_commitments/mod.rs b/bin/citrea/tests/sequencer_commitments/mod.rs index a595032d8..508c1ac26 100644 --- a/bin/citrea/tests/sequencer_commitments/mod.rs +++ b/bin/citrea/tests/sequencer_commitments/mod.rs @@ -4,7 +4,6 @@ use borsh::BorshDeserialize; use citrea_stf::genesis_config::GenesisPaths; use rs_merkle::algorithms::Sha256; use rs_merkle::MerkleTree; -use shared_backup_db::{PostgresConnector, SharedBackupDbConfig}; use sov_mock_da::{MockAddress, MockDaService, MockDaSpec}; use sov_modules_api::BlobReaderTrait; use sov_rollup_interface::da::DaData; @@ -14,8 +13,8 @@ use sov_stf_runner::ProverConfig; use crate::evm::make_test_client; use crate::test_client::TestClient; use crate::test_helpers::{ - create_default_sequencer_config, start_rollup, tempdir_with_children, wait_for_l1_block, - wait_for_l2_block, wait_for_postgres_commitment, wait_for_prover_l1_height, NodeMode, + start_rollup, tempdir_with_children, wait_for_l1_block, wait_for_l2_block, + wait_for_prover_l1_height, NodeMode, }; use crate::{ DEFAULT_DEPOSIT_MEMPOOL_FETCH_LIMIT, DEFAULT_PROOF_WAIT_DURATION, TEST_DATA_GENESIS_PATH, @@ -183,82 +182,6 @@ async fn check_sequencer_commitment( assert_eq!(commitment.merkle_root, merkle_tree.root().unwrap()); } -#[tokio::test(flavor = "multi_thread")] -async fn check_commitment_in_offchain_db() { - // citrea::initialize_logging(tracing::Level::INFO); - - let db_dir = tempdir_with_children(&["DA", "sequencer", "full-node"]); - let da_db_dir = db_dir.path().join("DA").to_path_buf(); - let sequencer_db_dir = db_dir.path().join("sequencer").to_path_buf(); - - let (seq_port_tx, seq_port_rx) = tokio::sync::oneshot::channel(); - let mut sequencer_config = create_default_sequencer_config(4, Some(true), 10); - - let db_name = "check_commitment_in_offchain_db".to_owned(); - sequencer_config.db_config = Some(SharedBackupDbConfig::default().set_db_name(db_name.clone())); - - // drops db if exists from previous test runs, recreates the db - let db_test_client = PostgresConnector::new_test_client(db_name).await.unwrap(); - - let da_db_dir_cloned = da_db_dir.clone(); - let seq_task = tokio::spawn(async move { - start_rollup( - seq_port_tx, - GenesisPaths::from_dir(TEST_DATA_GENESIS_PATH), - None, - NodeMode::SequencerNode, - sequencer_db_dir, - da_db_dir_cloned, - 4, - true, - None, - Some(sequencer_config), - Some(true), - 10, - ) - .await; - }); - - let seq_port = seq_port_rx.await.unwrap(); - let test_client = make_test_client(seq_port).await; - let da_service = MockDaService::new(MockAddress::from([0; 32]), &da_db_dir); - - da_service.publish_test_block().await.unwrap(); - wait_for_l1_block(&da_service, 2, None).await; - - // publish 3 soft confirmations, no commitment should be sent - for _ in 0..3 { - test_client.send_publish_batch_request().await; - } - wait_for_l2_block(&test_client, 3, None).await; - - da_service.publish_test_block().await.unwrap(); - wait_for_l1_block(&da_service, 3, None).await; - - // publish 4th block - test_client.send_publish_batch_request().await; - wait_for_l2_block(&test_client, 4, None).await; - - // commitment should be published with this call - da_service.publish_test_block().await.unwrap(); - wait_for_l1_block(&da_service, 4, None).await; - wait_for_l1_block(&da_service, 5, None).await; - - wait_for_postgres_commitment( - &db_test_client, - 1, - Some(Duration::from_secs(DEFAULT_PROOF_WAIT_DURATION)), - ) - .await; - - let commitments = db_test_client.get_all_commitments().await.unwrap(); - assert_eq!(commitments.len(), 1); - assert_eq!(commitments[0].l2_start_height, 1); - assert_eq!(commitments[0].l2_end_height, 4); - - seq_task.abort(); -} - #[tokio::test(flavor = "multi_thread")] async fn test_ledger_get_commitments_on_slot() { // citrea::initialize_logging(tracing::Level::INFO); @@ -398,7 +321,6 @@ async fn test_ledger_get_commitments_on_slot_prover() { Some(ProverConfig { proving_mode: sov_stf_runner::ProverGuestRunConfig::Execute, proof_sampling_number: 0, - db_config: None, }), NodeMode::Prover(seq_port), prover_db_dir, diff --git a/bin/citrea/tests/test_helpers/mod.rs b/bin/citrea/tests/test_helpers/mod.rs index f9225298e..7a0e0e30f 100644 --- a/bin/citrea/tests/test_helpers/mod.rs +++ b/bin/citrea/tests/test_helpers/mod.rs @@ -2,14 +2,17 @@ use std::net::SocketAddr; use std::path::{Path, PathBuf}; use std::time::{Duration, SystemTime}; +use borsh::BorshDeserialize; use citrea::{CitreaRollupBlueprint, MockDemoRollup}; use citrea_primitives::TEST_PRIVATE_KEY; use citrea_sequencer::SequencerConfig; use citrea_stf::genesis_config::GenesisPaths; -use shared_backup_db::PostgresConnector; -use sov_mock_da::{MockAddress, MockDaConfig, MockDaService}; +use sov_mock_da::{MockAddress, MockBlock, MockDaConfig, MockDaService}; use sov_modules_api::default_signature::private_key::DefaultPrivateKey; use sov_modules_api::PrivateKey; +use sov_rollup_interface::da::{BlobReaderTrait, DaData, SequencerCommitment}; +use sov_rollup_interface::services::da::{DaService, SlotData}; +use sov_rollup_interface::zk::Proof; use sov_stf_runner::{ FullNodeConfig, ProverConfig, RollupPublicKeys, RpcConfig, RunnerConfig, StorageConfig, }; @@ -173,8 +176,6 @@ pub fn create_default_sequencer_config( test_mode: test_mode.unwrap_or(false), deposit_mempool_fetch_limit, mempool_conf: Default::default(), - // Offchain db will be active only in some tests - db_config: None, da_update_interval_ms: 500, block_production_interval_ms: 500, // since running in test mode, we can set this to a lower value } @@ -263,75 +264,92 @@ pub async fn wait_for_l1_block(da_service: &MockDaService, num: u64, timeout: Op sleep(Duration::from_secs(2)).await; } -pub async fn wait_for_proof(test_client: &TestClient, slot_height: u64, timeout: Option) { +#[instrument(level = "debug", skip(da_service))] +pub async fn wait_for_commitment( + da_service: &MockDaService, + l1_height: u64, + timeout: Option, +) -> Vec { let start = SystemTime::now(); - let timeout = timeout.unwrap_or(Duration::from_secs(60)); // Default 60 seconds timeout + let timeout = timeout.unwrap_or(Duration::from_secs(30)); // Default 30 seconds timeout loop { debug!( - "Waiting for L1 block height containing zkproof {}", - slot_height + "Waiting for an L1 commitments to be published at L1 height {}", + l1_height ); - let proof = test_client - .ledger_get_verified_proofs_by_slot_height(slot_height) - .await; - if proof.is_some() { - break; - } - let now = SystemTime::now(); - if start + timeout <= now { - panic!("Timeout while waiting for proof at height {}", slot_height); - } + let Ok(l1_block) = da_service.get_block_at(l1_height).await else { + sleep(Duration::from_secs(1)).await; + continue; + }; - sleep(Duration::from_secs(1)).await; - } - // Let knowledge of the new DA block propagate - sleep(Duration::from_secs(2)).await; -} + let (sequencer_commitments, _) = extract_da_data(da_service, l1_block.clone()); -#[instrument(level = "debug", skip(db_test_client))] -pub async fn wait_for_postgres_commitment( - db_test_client: &PostgresConnector, - num: usize, - timeout: Option, -) { - let start = SystemTime::now(); - let timeout = timeout.unwrap_or(Duration::from_secs(30)); // Default 30 seconds timeout - loop { - debug!("Waiting for {} L1 commitments to be published", num); - let commitments = db_test_client.get_all_commitments().await.unwrap().len(); - if commitments >= num { - break; + if !sequencer_commitments.is_empty() { + return sequencer_commitments; } let now = SystemTime::now(); if start + timeout <= now { - panic!("Timeout. {} commitments exist at this point", commitments); + panic!( + "Timeout. {} commitments exist at this point", + sequencer_commitments.len() + ); } sleep(Duration::from_secs(1)).await; } } -pub async fn wait_for_postgres_proofs( - db_test_client: &PostgresConnector, - num: usize, - timeout: Option, -) { +pub async fn wait_for_proof(test_client: &TestClient, slot_height: u64, timeout: Option) { let start = SystemTime::now(); - let timeout = timeout.unwrap_or(Duration::from_secs(30)); // Default 30 seconds timeout + let timeout = timeout.unwrap_or(Duration::from_secs(60)); // Default 60 seconds timeout loop { - debug!("Waiting for {} L1 proofs to be published", num); - let commitments = db_test_client.get_all_proof_data().await.unwrap().len(); - if commitments >= num { + debug!( + "Waiting for L1 block height containing zkproof {}", + slot_height + ); + let proof = test_client + .ledger_get_verified_proofs_by_slot_height(slot_height) + .await; + if proof.is_some() { break; } let now = SystemTime::now(); if start + timeout <= now { - panic!("Timeout. {} proofs exist at this point", commitments); + panic!("Timeout while waiting for proof at height {}", slot_height); } sleep(Duration::from_secs(1)).await; } + // Let knowledge of the new DA block propagate + sleep(Duration::from_secs(2)).await; +} + +fn extract_da_data( + da_service: &MockDaService, + block: MockBlock, +) -> (Vec, Vec) { + let mut sequencer_commitments = Vec::::new(); + let mut zk_proofs = Vec::::new(); + + da_service + .extract_relevant_blobs(&block) + .into_iter() + .for_each(|mut tx| { + let data = DaData::try_from_slice(tx.full_data()); + if let Ok(DaData::SequencerCommitment(seq_com)) = data { + sequencer_commitments.push(seq_com); + } else if let Ok(DaData::ZKProof(proof)) = data { + zk_proofs.push(proof); + } else { + tracing::warn!( + "Found broken DA data in block 0x{}: {:?}", + hex::encode(block.hash()), + data + ); + } + }); + (sequencer_commitments, zk_proofs) } diff --git a/crates/fullnode/Cargo.toml b/crates/fullnode/Cargo.toml index a0a4ed808..438e26d68 100644 --- a/crates/fullnode/Cargo.toml +++ b/crates/fullnode/Cargo.toml @@ -12,7 +12,6 @@ repository.workspace = true # Citrea Deps citrea-primitives = { path = "../primitives", features = ["native"] } sequencer-client = { path = "../sequencer-client" } -shared-backup-db = { path = "../shared-backup-db" } # Sov SDK deps sov-db = { path = "../sovereign-sdk/full-node/db/sov-db" } diff --git a/crates/fullnode/src/runner.rs b/crates/fullnode/src/runner.rs index 0f66eaba3..ef785092d 100644 --- a/crates/fullnode/src/runner.rs +++ b/crates/fullnode/src/runner.rs @@ -404,6 +404,8 @@ where SoftConfirmationStatus::Finalized, )?; } + self.ledger_db + .set_last_commitment_l2_height(BatchNumber(end_l2_height))?; } Ok(()) } diff --git a/crates/prover/Cargo.toml b/crates/prover/Cargo.toml index 5a200305c..71ce4911c 100644 --- a/crates/prover/Cargo.toml +++ b/crates/prover/Cargo.toml @@ -13,7 +13,6 @@ repository.workspace = true citrea-primitives = { path = "../primitives", features = ["native"] } citrea-stf = { path = "../citrea-stf" } sequencer-client = { path = "../sequencer-client" } -shared-backup-db = { path = "../shared-backup-db" } # Sov SDK deps sov-db = { path = "../sovereign-sdk/full-node/db/sov-db" } diff --git a/crates/prover/src/runner.rs b/crates/prover/src/runner.rs index 669b5b493..7a5bc8317 100644 --- a/crates/prover/src/runner.rs +++ b/crates/prover/src/runner.rs @@ -17,7 +17,6 @@ use jsonrpsee::server::{BatchRequestConfig, ServerBuilder}; use jsonrpsee::RpcModule; use rand::Rng; use sequencer_client::{GetSoftBatchResponse, SequencerClient}; -use shared_backup_db::{DbPoolError, PostgresConnector, ProofType}; use sov_db::ledger_db::{ProverLedgerOps, SlotCommit}; use sov_db::schema::types::{BatchNumber, SlotNumber, StoredStateTransition}; use sov_modules_api::storage::HierarchicalStorageManager; @@ -243,14 +242,6 @@ where let prover_config = self.prover_config.clone().unwrap(); - let pg_client = match prover_config.clone().db_config { - Some(db_config) => { - info!("Connecting to postgres"); - Some(PostgresConnector::new(db_config.clone()).await) - } - None => None, - }; - // Create l1 sync worker task let (l1_tx, mut l1_rx) = mpsc::channel(1); @@ -295,7 +286,7 @@ where if let Err(e) = self.process_l1_block( pending_l1, skip_submission_until_l1, - &pg_client, &prover_config, + &prover_config, ).await { error!("Could not process L1 block and generate proof: {:?}", e); } @@ -413,7 +404,6 @@ where &mut self, pending_l1_blocks: &mut VecDeque<::FilteredBlock>, skip_submission_until_l1: u64, - pg_client: &Option>, prover_config: &ProverConfig, ) -> Result<(), anyhow::Error> { while !pending_l1_blocks.is_empty() { @@ -543,7 +533,7 @@ where // Skip submission until l1 height if l1_height >= skip_submission_until_l1 && should_prove { - self.generate_and_submit_proof(transition_data, pg_client, l1_height, hash) + self.generate_and_submit_proof(transition_data, l1_height, hash) .await?; } else { info!("Skipping proving for l1 height {}", l1_height); @@ -691,7 +681,6 @@ where async fn generate_and_submit_proof( &self, transition_data: StateTransitionData, - pg_client: &Option>, l1_height: u64, hash: <::Spec as DaSpec>::SlotHash, ) -> Result<(), anyhow::Error> { @@ -756,27 +745,6 @@ where validity_condition: borsh::to_vec(&transition_data.validity_condition).unwrap(), }; - match pg_client.as_ref() { - Some(Ok(pool)) => { - info!("Inserting proof data into postgres"); - let (proof_data, proof_type) = match proof.clone() { - Proof::Full(full_proof) => (full_proof, ProofType::Full), - Proof::PublicInput(public_input) => (public_input, ProofType::PublicInput), - }; - pool.insert_proof_data( - tx_id_u8.to_vec(), - proof_data, - stored_state_transition.clone().into(), - proof_type, - ) - .await - .unwrap(); - } - _ => { - warn!("No postgres client found"); - } - } - if let Err(e) = self.ledger_db .put_proof_data(l1_height, tx_id_u8, proof, stored_state_transition) diff --git a/crates/sequencer/Cargo.toml b/crates/sequencer/Cargo.toml index 6f8853db1..a89b41a21 100644 --- a/crates/sequencer/Cargo.toml +++ b/crates/sequencer/Cargo.toml @@ -19,7 +19,6 @@ anyhow = { workspace = true } bincode = { workspace = true } borsh = { workspace = true } chrono = { workspace = true } -deadpool-postgres = { workspace = true } digest = { workspace = true } futures = { workspace = true } hex = { workspace = true } @@ -61,7 +60,6 @@ sov-stf-runner = { path = "../sovereign-sdk/full-node/sov-stf-runner" } citrea-evm = { path = "../evm", features = ["native"] } citrea-primitives = { path = "../primitives" } citrea-stf = { path = "../citrea-stf", features = ["native"] } -shared-backup-db = { path = "../shared-backup-db" } [dev-dependencies] tempfile = { workspace = true } diff --git a/crates/sequencer/src/commitment_controller.rs b/crates/sequencer/src/commitment_controller.rs index bc675c292..5440164fb 100644 --- a/crates/sequencer/src/commitment_controller.rs +++ b/crates/sequencer/src/commitment_controller.rs @@ -31,7 +31,7 @@ pub fn get_commitment_info( // Get latest finalized and pending commitments and find the max height let last_finalized_l2_height = ledger_db - .get_last_sequencer_commitment_l2_height()? + .get_last_commitment_l2_height()? .unwrap_or(BatchNumber(0)); let last_pending_l2_height = ledger_db .get_pending_commitments_l2_range()? diff --git a/crates/sequencer/src/config.rs b/crates/sequencer/src/config.rs index 666f84547..a0039e7f6 100644 --- a/crates/sequencer/src/config.rs +++ b/crates/sequencer/src/config.rs @@ -1,5 +1,4 @@ use serde::Deserialize; -use shared_backup_db::SharedBackupDbConfig; /// Rollup Configuration #[derive(Debug, Clone, PartialEq, Deserialize)] @@ -14,8 +13,6 @@ pub struct SequencerConfig { pub deposit_mempool_fetch_limit: usize, /// Sequencer specific mempool config pub mempool_conf: SequencerMempoolConfig, - /// Offchain db config - pub db_config: Option, /// DA layer update loop interval in ms pub da_update_interval_ms: u64, /// Block production interval in ms @@ -88,12 +85,6 @@ mod tests { base_fee_tx_limit = 100000 base_fee_tx_size = 200 max_account_slots = 16 - [db_config] - db_host = "localhost" - db_port = 5432 - db_user = "postgres" - db_password = "postgres" - db_name = "postgres" "#; let config_file = create_config_from(config); @@ -115,7 +106,6 @@ mod tests { base_fee_tx_size: 200, max_account_slots: 16, }, - db_config: Some(SharedBackupDbConfig::default()), da_update_interval_ms: 1000, block_production_interval_ms: 1000, }; diff --git a/crates/sequencer/src/rpc.rs b/crates/sequencer/src/rpc.rs index c00cfadde..88a6c1127 100644 --- a/crates/sequencer/src/rpc.rs +++ b/crates/sequencer/src/rpc.rs @@ -9,7 +9,7 @@ use reth_primitives::{Bytes, FromRecoveredPooledTransaction, IntoRecoveredTransa use reth_rpc::eth::error::EthApiError; use reth_rpc_types_compat::transaction::from_recovered; use reth_transaction_pool::EthPooledTransaction; -use shared_backup_db::PostgresConnector; +use sov_db::ledger_db::SequencerLedgerOps; use sov_modules_api::WorkingSet; use tokio::sync::Mutex; use tracing::{debug, error}; @@ -18,18 +18,21 @@ use crate::deposit_data_mempool::DepositDataMempool; use crate::mempool::CitreaMempool; use crate::utils::recover_raw_transaction; -pub(crate) struct RpcContext { +pub(crate) struct RpcContext { pub mempool: Arc>, pub deposit_mempool: Arc>, pub l2_force_block_tx: UnboundedSender<()>, pub storage: C::Storage, + pub ledger: DB, pub test_mode: bool, - pub pg_pool: Option>, } -pub(crate) fn create_rpc_module( - rpc_context: RpcContext, -) -> Result>, jsonrpsee::core::RegisterMethodError> { +pub(crate) fn create_rpc_module< + C: sov_modules_api::Context, + DB: SequencerLedgerOps + Send + Sync + 'static, +>( + rpc_context: RpcContext, +) -> Result>, jsonrpsee::core::RegisterMethodError> { let test_mode = rpc_context.test_mode; let mut rpc = RpcModule::new(rpc_context); rpc.register_async_method("eth_sendRawTransaction", |parameters, ctx| async move { @@ -49,17 +52,14 @@ pub(crate) fn create_rpc_module( .await .map_err(EthApiError::from)?; - if let Some(pool) = &ctx.pg_pool { - let mut rlp_encoded_tx = Vec::new(); - pool_transaction - .to_recovered_transaction() - .into_signed() - .encode_enveloped(&mut rlp_encoded_tx); - // Do not return error here just log - match pool.insert_mempool_tx(hash.to_vec(), rlp_encoded_tx).await { - Ok(_) => (), - Err(e) => tracing::warn!("Failed to insert mempool tx into db: {:?}", e), - }; + let mut rlp_encoded_tx = Vec::new(); + pool_transaction + .to_recovered_transaction() + .into_signed() + .encode_enveloped(&mut rlp_encoded_tx); + // Do not return error here just log + if let Err(e) = ctx.ledger.insert_mempool_tx(hash.to_vec(), rlp_encoded_tx) { + tracing::warn!("Failed to insert mempool tx into db: {:?}", e); } Ok::(hash) diff --git a/crates/sequencer/src/sequencer.rs b/crates/sequencer/src/sequencer.rs index 7e56adfb2..734825713 100644 --- a/crates/sequencer/src/sequencer.rs +++ b/crates/sequencer/src/sequencer.rs @@ -24,7 +24,6 @@ use reth_transaction_pool::{ BestTransactions, BestTransactionsAttributes, ChangedAccount, EthPooledTransaction, ValidPoolTransaction, }; -use shared_backup_db::{CommitmentStatus, PostgresConnector}; use soft_confirmation_rule_enforcer::SoftConfirmationRuleEnforcer; use sov_accounts::Accounts; use sov_accounts::Response::{AccountEmpty, AccountExists}; @@ -115,7 +114,7 @@ where PreState = Sm::NativeStorage, ChangeSet = Sm::NativeChangeSet, > + StfBlueprintTrait, - DB: SequencerLedgerOps + Send + Clone + 'static, + DB: SequencerLedgerOps + Send + Sync + Clone + 'static, { #[allow(clippy::too_many_arguments)] pub fn new( @@ -361,7 +360,6 @@ where da_block: ::FilteredBlock, l1_fee_rate: u128, l2_block_mode: L2BlockMode, - pg_pool: &Option, last_used_l1_height: u64, ) -> anyhow::Result<(u64, bool)> { let da_height = da_block.header().height(); @@ -592,17 +590,12 @@ where .set_state_diff(self.last_state_diff.clone())?; } - if let Some(pg_pool) = pg_pool.clone() { - // TODO: Is this okay? I'm not sure because we have a loop in this and I can't do async in spawn_blocking - tokio::spawn(async move { - let txs = txs_to_remove - .iter() - .map(|tx_hash| tx_hash.to_vec()) - .collect::>>(); - if let Err(e) = pg_pool.delete_txs_by_tx_hashes(txs).await { - warn!("Failed to remove txs from mempool: {:?}", e); - } - }); + let txs = txs_to_remove + .iter() + .map(|tx_hash| tx_hash.to_vec()) + .collect::>>(); + if let Err(e) = self.ledger_db.remove_mempool_txs(txs) { + warn!("Failed to remove txs from mempool: {:?}", e); } Ok((da_block.header().height(), state_diff_threshold_reached)) @@ -674,11 +667,10 @@ where && commitment.l2_end_block_number == l2_end.0 }) { // Update last sequencer commitment l2 height - match self.ledger_db.get_last_sequencer_commitment_l2_height()? { + match self.ledger_db.get_last_commitment_l2_height()? { Some(last_commitment_l2_height) if last_commitment_l2_height >= l2_end => {} _ => { - self.ledger_db - .set_last_sequencer_commitment_l2_height(l2_end)?; + self.ledger_db.set_last_commitment_l2_height(l2_end)?; } }; @@ -739,42 +731,19 @@ where ); let ledger_db = self.ledger_db.clone(); - let db_config = self.config.db_config.clone(); let handle_da_response = async move { let result: anyhow::Result<()> = async move { - let tx_id = rx + let _tx_id = rx .await .map_err(|_| anyhow!("DA service is dead!"))? .map_err(|_| anyhow!("Send transaction cannot fail"))?; ledger_db - .set_last_sequencer_commitment_l2_height(l2_end) + .set_last_commitment_l2_height(l2_end) .map_err(|_| { anyhow!("Sequencer: Failed to set last sequencer commitment L2 height") })?; - if let Some(db_config) = db_config { - match PostgresConnector::new(db_config).await { - Ok(pg_connector) => { - pg_connector - .insert_sequencer_commitment( - Into::<[u8; 32]>::into(tx_id).to_vec(), - l2_start.0 as u32, - l2_end.0 as u32, - commitment.merkle_root.to_vec(), - CommitmentStatus::Mempool, - ) - .await - .map_err(|_| { - anyhow!("Sequencer: Failed to insert sequencer commitment") - })?; - } - Err(e) => { - warn!("Failed to connect to postgres: {:?}", e); - } - } - } - ledger_db.delete_pending_commitment_l2_range(&(l2_start, l2_end))?; info!("New commitment. L2 range: #{}-{}", l2_start.0, l2_end.0); @@ -871,30 +840,11 @@ where .await .map_err(|e| anyhow!(e))?; - // If connected to offchain db first check if the commitments are in sync - let mut pg_pool = None; - if let Some(db_config) = self.config.db_config.clone() { - pg_pool = match PostgresConnector::new(db_config).await { - Ok(pg_connector) => { - match self.sync_commitments_from_db(pg_connector.clone()).await { - Ok(()) => debug!("Sequencer: Commitments are in sync"), - Err(e) => { - warn!("Sequencer: Offchain db error: {:?}", e); - } - } - match self.restore_mempool(pg_connector.clone()).await { - Ok(()) => debug!("Sequencer: Mempool restored"), - Err(e) => { - warn!("Sequencer: Mempool restore error: {:?}", e); - } - } - Some(pg_connector) - } - Err(e) => { - warn!("Failed to connect to postgres: {:?}", e); - None - } - }; + match self.restore_mempool().await { + Ok(()) => debug!("Sequencer: Mempool restored"), + Err(e) => { + warn!("Sequencer: Mempool restore error: {:?}", e); + } } // Initialize our knowledge of the state of the DA-layer @@ -996,7 +946,7 @@ where .map_err(|e| anyhow!(e))?; debug!("Created an empty L2 for L1={}", needed_da_block_height); - if let Err(e) = self.produce_l2_block(da_block, l1_fee_rate, L2BlockMode::Empty, &pg_pool, last_used_l1_height).await { + if let Err(e) = self.produce_l2_block(da_block, l1_fee_rate, L2BlockMode::Empty, last_used_l1_height).await { error!("Sequencer error: {}", e); } } @@ -1012,7 +962,7 @@ where } }; let l1_fee_rate = l1_fee_rate.clamp(*l1_fee_rate_range.start(), *l1_fee_rate_range.end()); - match self.produce_l2_block(last_finalized_block.clone(), l1_fee_rate, L2BlockMode::NotEmpty, &pg_pool, last_used_l1_height).await { + match self.produce_l2_block(last_finalized_block.clone(), l1_fee_rate, L2BlockMode::NotEmpty, last_used_l1_height).await { Ok((l1_block_number, state_diff_threshold_reached)) => { last_used_l1_height = l1_block_number; @@ -1044,7 +994,7 @@ where .map_err(|e| anyhow!(e))?; debug!("Created an empty L2 for L1={}", needed_da_block_height); - if let Err(e) = self.produce_l2_block(da_block, l1_fee_rate, L2BlockMode::Empty, &pg_pool, last_used_l1_height).await { + if let Err(e) = self.produce_l2_block(da_block, l1_fee_rate, L2BlockMode::Empty, last_used_l1_height).await { error!("Sequencer error: {}", e); } } @@ -1062,7 +1012,7 @@ where let l1_fee_rate = l1_fee_rate.clamp(*l1_fee_rate_range.start(), *l1_fee_rate_range.end()); let instant = Instant::now(); - match self.produce_l2_block(da_block, l1_fee_rate, L2BlockMode::NotEmpty, &pg_pool, last_used_l1_height).await { + match self.produce_l2_block(da_block, l1_fee_rate, L2BlockMode::NotEmpty, last_used_l1_height).await { Ok((l1_block_number, state_diff_threshold_reached)) => { // Set the next iteration's wait time to produce a block based on the // previous block's execution time. @@ -1168,25 +1118,16 @@ where } /// Creates a shared RpcContext with all required data. - async fn create_rpc_context(&self) -> RpcContext { + async fn create_rpc_context(&self) -> RpcContext { let l2_force_block_tx = self.l2_force_block_tx.clone(); - let mut pg_pool = None; - if let Some(pg_config) = self.config.db_config.clone() { - pg_pool = match PostgresConnector::new(pg_config).await { - Ok(pg_connector) => Some(Arc::new(pg_connector)), - Err(e) => { - warn!("Failed to connect to postgres: {:?}", e); - None - } - }; - } + RpcContext { mempool: self.mempool.clone(), deposit_mempool: self.deposit_mempool.clone(), l2_force_block_tx, storage: self.storage.clone(), + ledger: self.ledger_db.clone(), test_mode: self.config.test_mode, - pg_pool, } } @@ -1201,14 +1142,11 @@ where Ok(rpc_methods) } - pub async fn restore_mempool( - &self, - pg_connector: PostgresConnector, - ) -> Result<(), anyhow::Error> { - let mempool_txs = pg_connector.get_all_txs().await?; - for tx in mempool_txs { + pub async fn restore_mempool(&self) -> Result<(), anyhow::Error> { + let mempool_txs = self.ledger_db.get_mempool_txs()?; + for (_, tx) in mempool_txs { let recovered = - recover_raw_transaction(reth_primitives::Bytes::from(tx.tx.as_slice().to_vec()))?; + recover_raw_transaction(reth_primitives::Bytes::from(tx.as_slice().to_vec()))?; let pooled_tx = EthPooledTransaction::from_recovered_pooled_transaction(recovered); let _ = self.mempool.add_external_transaction(pooled_tx).await?; @@ -1216,29 +1154,6 @@ where Ok(()) } - pub async fn sync_commitments_from_db( - &self, - pg_connector: PostgresConnector, - ) -> Result<(), anyhow::Error> { - let db_commitment = match pg_connector.get_last_commitment().await? { - Some(comm) => comm, - // ignore if postgres is out of sync - None => return Ok(()), - }; - let ledger_commitment_l2_height = self - .ledger_db - .get_last_sequencer_commitment_l2_height()? - .unwrap_or_default(); - if ledger_commitment_l2_height.0 >= db_commitment.l2_end_height { - return Ok(()); - } - - self.ledger_db - .set_last_sequencer_commitment_l2_height(BatchNumber(db_commitment.l2_end_height))?; - - Ok(()) - } - fn get_account_updates(&self) -> Result, anyhow::Error> { let head = self .db_provider diff --git a/crates/shared-backup-db/Cargo.toml b/crates/shared-backup-db/Cargo.toml deleted file mode 100644 index 36636d565..000000000 --- a/crates/shared-backup-db/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "shared-backup-db" -authors = { workspace = true } -edition = { workspace = true } -homepage = { workspace = true } -license = { workspace = true } -repository = { workspace = true } - -version = { workspace = true } -publish = false -readme = "README.md" -resolver = "2" - -[dependencies] -deadpool-postgres = { workspace = true } -postgres-types = { workspace = true, features = ["with-serde_json-1"] } -serde = { workspace = true } -tokio = { workspace = true } -tracing = { workspace = true } - -sov-rollup-interface = { path = "../sovereign-sdk/rollup-interface" } - -[dev-dependencies] - -[features] -default = [] -test-utils = [] diff --git a/crates/shared-backup-db/README.md b/crates/shared-backup-db/README.md deleted file mode 100644 index ba8f561e6..000000000 --- a/crates/shared-backup-db/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Description -This is an offchain db where we store sequencer commmitments details. - -## Why is this required for sequencer -This database serves as a backup to ensure data integrity in case of any issues, and it will also support an API that provides access to the data. \ No newline at end of file diff --git a/crates/shared-backup-db/src/config.rs b/crates/shared-backup-db/src/config.rs deleted file mode 100644 index c313d2068..000000000 --- a/crates/shared-backup-db/src/config.rs +++ /dev/null @@ -1,101 +0,0 @@ -use deadpool_postgres::tokio_postgres::Config; -use serde::Deserialize; - -/// Offchain DB Config -#[derive(Debug, Clone, PartialEq, Deserialize)] -pub struct SharedBackupDbConfig { - db_host: String, - db_port: usize, - db_user: String, - db_password: String, - db_name: String, - max_pool_size: Option, -} - -impl SharedBackupDbConfig { - pub fn new( - db_host: String, - db_port: usize, - db_user: String, - db_password: String, - db_name: String, - max_pool_size: Option, - ) -> Self { - Self { - db_host, - db_port, - db_user, - db_password, - db_name, - max_pool_size, - } - } - - pub fn db_host(&self) -> &String { - &self.db_host - } - - pub fn db_port(&self) -> usize { - self.db_port - } - - pub fn db_user(&self) -> &String { - &self.db_user - } - - pub fn db_password(&self) -> &String { - &self.db_password - } - - pub fn db_name(&self) -> &String { - &self.db_name - } - - pub fn max_pool_size(&self) -> Option { - self.max_pool_size - } - - pub fn set_db_name(mut self, db_name: String) -> Self { - self.db_name = db_name; - self - } - - pub fn parse_to_connection_string(&self) -> String { - format!( - "host={} port={} user={} password={} dbname={}", - self.db_host, self.db_port, self.db_user, self.db_password, self.db_name - ) - } - - pub fn parse_to_connection_string_with_db(&self, db_name: String) -> String { - format!( - "host={} port={} user={} password={} dbname={}", - self.db_host, self.db_port, self.db_user, self.db_password, db_name - ) - } -} - -impl Default for SharedBackupDbConfig { - fn default() -> Self { - Self { - db_host: "localhost".to_string(), - db_port: 5432, - db_user: "postgres".to_string(), - db_password: "postgres".to_string(), - db_name: "postgres".to_string(), - max_pool_size: None, - } - } -} - -impl From for Config { - fn from(val: SharedBackupDbConfig) -> Self { - let mut cfg = Config::new(); - cfg.host(val.db_host()) - .port(val.db_port() as u16) - .user(val.db_user()) - .password(val.db_password()) - .dbname(val.db_name()) - .clone() - } -} diff --git a/crates/shared-backup-db/src/lib.rs b/crates/shared-backup-db/src/lib.rs deleted file mode 100644 index f40c8d787..000000000 --- a/crates/shared-backup-db/src/lib.rs +++ /dev/null @@ -1,7 +0,0 @@ -pub mod config; -pub mod postgres_connector; -pub mod tables; - -pub use config::SharedBackupDbConfig; -pub use postgres_connector::{DbPoolError, PostgresConnector}; -pub use tables::{CommitmentStatus, DbProof, DbSequencerCommitment, ProofType, Tables}; diff --git a/crates/shared-backup-db/src/postgres_connector.rs b/crates/shared-backup-db/src/postgres_connector.rs deleted file mode 100644 index a0b8fbe37..000000000 --- a/crates/shared-backup-db/src/postgres_connector.rs +++ /dev/null @@ -1,440 +0,0 @@ -use std::str::FromStr; - -use deadpool_postgres::tokio_postgres::config::Config as PgConfig; -use deadpool_postgres::tokio_postgres::{NoTls, Row}; -use deadpool_postgres::{Manager, ManagerConfig, Object, Pool, PoolError, RecyclingMethod}; -use sov_rollup_interface::rpc::StateTransitionRpcResponse; -use tracing::{debug, instrument}; - -use crate::config::SharedBackupDbConfig; -use crate::tables::{ - CommitmentStatus, DbMempoolTx, DbProof, DbSequencerCommitment, ProofType, Tables, - INDEX_L2_END_HEIGHT, MEMPOOL_TXS_TABLE_CREATE_QUERY, PROOF_TABLE_CREATE_QUERY, - SEQUENCER_COMMITMENT_TABLE_CREATE_QUERY, -}; - -pub type DbPoolError = PoolError; - -#[derive(Clone)] -pub struct PostgresConnector { - client: Pool, -} - -impl PostgresConnector { - #[instrument(level = "trace", err)] - pub async fn new(pg_config: SharedBackupDbConfig) -> Result { - let mut cfg: PgConfig = pg_config.clone().into(); - - let mgr_config = ManagerConfig { - recycling_method: RecyclingMethod::Fast, - }; - let mgr = Manager::from_config(cfg.clone(), NoTls, mgr_config.clone()); - let mut pool = Pool::builder(mgr) - .max_size(pg_config.max_pool_size().unwrap_or(16)) - .build() - .unwrap(); - let mut client = pool.get().await?; - - debug!("Connecting PG client to DB: {}", pg_config.db_name()); - - // Create new db if running thread is not main or tokio-runtime-worker, meaning when running for tests - if cfg!(feature = "test-utils") { - // create new db - let _ = client - .batch_execute(&format!("CREATE DATABASE {};", pg_config.db_name())) - .await; - - //connect to new db - cfg.dbname(pg_config.db_name()); - let mgr = Manager::from_config(cfg, NoTls, mgr_config); - pool = Pool::builder(mgr) - .max_size(pg_config.max_pool_size().unwrap_or(16)) - .build() - .unwrap(); - // new client - client = pool.get().await?; - } - - // create tables - client - .batch_execute(SEQUENCER_COMMITMENT_TABLE_CREATE_QUERY) - .await?; - client.batch_execute(MEMPOOL_TXS_TABLE_CREATE_QUERY).await?; - client.batch_execute(PROOF_TABLE_CREATE_QUERY).await?; - let db_client = Self { client: pool }; - - let _ = db_client.create_indexes().await; - - Ok(db_client) - } - - #[instrument(level = "trace", skip(self), err)] - pub async fn client(&self) -> Result { - self.client.get().await - } - - #[instrument(level = "trace", skip(self), err, ret)] - pub async fn create_indexes(&self) -> Result<(), PoolError> { - let client = self.client().await?; - // client.batch_execute(INDEX_L1_END_HEIGHT).await?; - // client.batch_execute(INDEX_L1_END_HASH).await?; - client.batch_execute(INDEX_L2_END_HEIGHT).await?; - Ok(()) - } - - #[cfg(feature = "test-utils")] - pub async fn new_test_client(db_name: String) -> Result { - let mut cfg: PgConfig = SharedBackupDbConfig::default().into(); - - let mgr_config = ManagerConfig { - recycling_method: RecyclingMethod::Fast, - }; - let mgr = Manager::from_config(cfg.clone(), NoTls, mgr_config.clone()); - let pool = Pool::builder(mgr).max_size(16).build().unwrap(); - let client = pool.get().await.unwrap(); - - client - .batch_execute(&format!("DROP DATABASE IF EXISTS {};", db_name.clone())) - .await - .unwrap(); - - client - .batch_execute(&format!("CREATE DATABASE {};", db_name.clone())) - .await - .unwrap(); - - drop(pool); - - //connect to new db - cfg.dbname(&db_name); - - let mgr = Manager::from_config(cfg, NoTls, mgr_config); - let test_pool = Pool::builder(mgr).max_size(16).build().unwrap(); - let test_client = test_pool.get().await.unwrap(); - - test_client - .batch_execute(SEQUENCER_COMMITMENT_TABLE_CREATE_QUERY) - .await - .unwrap(); - - test_client - .batch_execute(MEMPOOL_TXS_TABLE_CREATE_QUERY) - .await - .unwrap(); - test_client - .batch_execute(PROOF_TABLE_CREATE_QUERY) - .await - .unwrap(); - - let test_client = Self { client: test_pool }; - - test_client.create_indexes().await.unwrap(); - Ok(test_client) - } - - #[allow(clippy::too_many_arguments)] - #[instrument(level = "trace", skip_all, fields(l1_start_height), err, ret)] - pub async fn insert_sequencer_commitment( - &self, - l1_tx_id: Vec, - l2_start_height: u32, - l2_end_height: u32, - merkle_root: Vec, - status: CommitmentStatus, - ) -> Result { - let client = self.client().await?; - Ok(client - .execute( - "INSERT INTO sequencer_commitments (l1_tx_id, l2_start_height, l2_end_height, merkle_root, status) VALUES ($1, $2, $3, $4, $5)", - &[ - &l1_tx_id, - &l2_start_height, - &l2_end_height, - &merkle_root, - &status.to_string(), - ], - ).await?) - } - - #[instrument(level = "trace", skip(self, tx), err, ret)] - pub async fn insert_mempool_tx(&self, tx_hash: Vec, tx: Vec) -> Result { - let client = self.client().await?; - Ok(client - .execute( - "INSERT INTO mempool_txs (tx_hash, tx) VALUES ($1, $2);", - &[&tx_hash, &tx], - ) - .await?) - } - - #[instrument(level = "trace", skip(self), err)] - pub async fn get_all_commitments(&self) -> Result, PoolError> { - let client = self.client().await?; - Ok(client - .query("SELECT * FROM sequencer_commitments", &[]) - .await? - .iter() - .map(PostgresConnector::row_to_sequencer_commitment) - .collect()) - } - - #[instrument(level = "trace", skip(self), err)] - pub async fn get_all_txs(&self) -> Result, PoolError> { - let client = self.client().await?; - Ok(client - .query("SELECT * FROM mempool_txs", &[]) - .await? - .iter() - .map(PostgresConnector::row_to_mempool_tx) - .collect()) - } - - #[instrument(level = "trace", skip(self), err)] - pub async fn get_last_commitment(&self) -> Result, PoolError> { - let client = self.client().await?; - let rows = client - .query( - "SELECT * FROM sequencer_commitments ORDER BY id DESC LIMIT 1", - &[], - ) - .await?; - if rows.is_empty() { - return Ok(None); - } - Ok(Some(PostgresConnector::row_to_sequencer_commitment( - &rows[0], - ))) - } - - #[instrument(level = "trace", skip_all, err, ret)] - pub async fn delete_txs_by_tx_hashes(&self, tx_hashes: Vec>) -> Result { - let client = self.client().await?; - Ok(client - .execute( - "DELETE FROM mempool_txs WHERE tx_hash = ANY($1);", - &[&tx_hashes], - ) - .await?) - } - - #[allow(clippy::too_many_arguments)] - #[instrument(level = "trace", skip_all, fields(l1_tx_id), err, ret)] - pub async fn insert_proof_data( - &self, - l1_tx_id: Vec, - proof_data: Vec, - state_transition_rpc_response: StateTransitionRpcResponse, - proof_type: ProofType, - ) -> Result { - let state_tranistion_rpc_response_json = - postgres_types::Json::(state_transition_rpc_response); - let client = self.client().await?; - Ok(client - .execute( - "INSERT INTO proof (l1_tx_id, proof_data, state_transition, proof_type) VALUES ($1, $2, $3, $4);", - &[&l1_tx_id, &proof_data, &state_tranistion_rpc_response_json, &proof_type.to_string()], - ) - .await?) - } - - #[instrument(level = "trace", skip(self), err)] - pub async fn get_all_proof_data(&self) -> Result, PoolError> { - let client = self.client().await?; - Ok(client - .query("SELECT * FROM proof", &[]) - .await? - .iter() - .map(PostgresConnector::row_to_proof) - .collect()) - } - - #[instrument(level = "trace", skip(self), fields(%table), err, ret)] - pub async fn drop_table(&self, table: Tables) -> Result { - let client = self.client().await?; - Ok(client - .execute(format!("DROP TABLE {};", table).as_str(), &[]) - .await?) - } - - #[cfg(test)] - #[instrument(level = "trace", skip(self), fields(%table), ret)] - pub async fn create_table(&self, table: Tables) { - let client = self.client().await.unwrap(); - let query = match table { - Tables::SequencerCommitment => SEQUENCER_COMMITMENT_TABLE_CREATE_QUERY, - Tables::MempoolTxs => MEMPOOL_TXS_TABLE_CREATE_QUERY, - Tables::Proof => PROOF_TABLE_CREATE_QUERY, - }; - client.execute(query, &[]).await.unwrap(); - } - - // Helper function to convert a Row to DbSequencerCommitment - fn row_to_sequencer_commitment(row: &Row) -> DbSequencerCommitment { - DbSequencerCommitment { - l1_tx_id: row.get("l1_tx_id"), - // postgres does not support u64 - l2_start_height: row.get::<&str, u32>("l2_start_height") as u64, - l2_end_height: row.get::<&str, u32>("l2_end_height") as u64, - merkle_root: row.get("merkle_root"), - status: CommitmentStatus::from_str(row.get("status")).unwrap(), - } - } - - fn row_to_mempool_tx(row: &Row) -> DbMempoolTx { - DbMempoolTx { - tx_hash: row.get("tx_hash"), - tx: row.get("tx"), - } - } - - fn row_to_proof(row: &Row) -> DbProof { - DbProof { - l1_tx_id: row.get("l1_tx_id"), - proof_data: row.get("proof_data"), - state_transition: row.get("state_transition"), - proof_type: ProofType::from_str(row.get("proof_type")).unwrap(), - } - } -} - -#[cfg(all(test, feature = "test-utils"))] -mod tests { - use super::*; - use crate::tables::Tables; - - #[tokio::test] - async fn test_insert_sequencer_commitment() { - let client = PostgresConnector::new_test_client("insert_sequencer_commitments".to_owned()) - .await - .unwrap(); - client.create_table(Tables::SequencerCommitment).await; - - let inserted = client - .insert_sequencer_commitment( - vec![0; 32], - 10, - 11, - vec![1; 32], - CommitmentStatus::Mempool, - ) - .await - .unwrap(); - - assert_eq!(inserted, 1); - - let rows = client.get_all_commitments().await.unwrap(); - assert_eq!(rows.len(), 1); - assert_eq!(rows[0].l1_tx_id, vec![0; 32]); - assert_eq!(rows[0].l2_start_height, 10); - assert_eq!(rows[0].l2_end_height, 11); - assert!(matches!(rows[0].status, CommitmentStatus::Mempool)); - - let _ = client.drop_table(Tables::SequencerCommitment).await; - } - - #[tokio::test] - async fn test_insert_rlp_tx() { - let client = PostgresConnector::new_test_client("insert_rlp_tx".to_owned()) - .await - .unwrap(); - client.create_table(Tables::MempoolTxs).await; - - client - .insert_mempool_tx(vec![1, 2, 3], vec![1, 2, 4]) - .await - .unwrap(); - - let txs = client.get_all_txs().await.unwrap(); - - assert_eq!(txs.len(), 1); - assert_eq!( - txs[0], - DbMempoolTx { - tx_hash: vec![1, 2, 3], - tx: vec![1, 2, 4] - } - ); - - client - .insert_mempool_tx(vec![3, 4, 5], vec![10, 20, 42]) - .await - .unwrap(); - - client - .insert_mempool_tx(vec![5, 6, 7], vec![12, 22, 42]) - .await - .unwrap(); - - client - .delete_txs_by_tx_hashes(vec![vec![1, 2, 3], vec![5, 6, 7]]) - .await - .unwrap(); - - let txs = client.get_all_txs().await.unwrap(); - - assert_eq!(txs.len(), 1); - assert_eq!( - txs[0], - DbMempoolTx { - tx_hash: vec![3, 4, 5], - tx: vec![10, 20, 42] - } - ); - } - - #[tokio::test] - async fn test_insert_proof_data() { - let client = PostgresConnector::new_test_client("test_insert_proof_data".to_string()) - .await - .unwrap(); - client.create_table(Tables::Proof).await; - - let inserted = client - .insert_proof_data( - vec![0; 32], - vec![1; 32], - StateTransitionRpcResponse { - initial_state_root: [0; 32].to_vec(), - final_state_root: [1; 32].to_vec(), - state_diff: vec![(vec![2u8; 32], Some(vec![3u8; 32])), (vec![5u8; 32], None)] - .into_iter() - .collect(), - da_slot_hash: [2; 32], - sequencer_commitments_range: (0, 5), - sequencer_public_key: [3; 32].to_vec(), - sequencer_da_public_key: [4; 32].to_vec(), - validity_condition: [5; 32].to_vec(), - }, - ProofType::Full, - ) - .await - .unwrap(); - - assert_eq!(inserted, 1); - - let proofs = client.get_all_proof_data().await.unwrap(); - assert_eq!(proofs.len(), 1); - assert_eq!( - proofs[0], - DbProof { - l1_tx_id: vec![0; 32], - proof_data: vec![1; 32], - state_transition: postgres_types::Json(StateTransitionRpcResponse { - initial_state_root: [0; 32].to_vec(), - final_state_root: [1; 32].to_vec(), - state_diff: vec![(vec![2; 32], Some(vec![3; 32])), (vec![5; 32], None)] - .into_iter() - .collect(), - da_slot_hash: [2; 32], - sequencer_commitments_range: (0, 5), - sequencer_public_key: [3; 32].to_vec(), - sequencer_da_public_key: [4; 32].to_vec(), - validity_condition: [5; 32].to_vec(), - }), - proof_type: ProofType::Full, - } - ); - - client.drop_table(Tables::Proof).await.unwrap(); - } -} diff --git a/crates/shared-backup-db/src/tables.rs b/crates/shared-backup-db/src/tables.rs deleted file mode 100644 index bf0cb90d9..000000000 --- a/crates/shared-backup-db/src/tables.rs +++ /dev/null @@ -1,157 +0,0 @@ -use std::fmt; - -use postgres_types::Json; -use sov_rollup_interface::rpc::StateTransitionRpcResponse; - -pub enum Tables { - /// string version is sequencer_commitment - #[allow(dead_code)] - SequencerCommitment, - MempoolTxs, - Proof, -} - -// impl to_string for tables -impl fmt::Display for Tables { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - Tables::SequencerCommitment => write!(f, "sequencer_commitments"), - Tables::MempoolTxs => write!(f, "mempool_txs"), - Tables::Proof => write!(f, "proof"), - } - } -} - -#[derive(Debug, Clone)] -pub enum CommitmentStatus { - Mempool, - Mined, - Finalized, -} - -impl fmt::Display for CommitmentStatus { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - CommitmentStatus::Mempool => write!(f, "mempool"), - CommitmentStatus::Mined => write!(f, "mined"), - CommitmentStatus::Finalized => write!(f, "finalized"), - } - } -} - -impl std::str::FromStr for CommitmentStatus { - type Err = (); - fn from_str(s: &str) -> Result { - match s { - "mempool" => Ok(CommitmentStatus::Mempool), - "mined" => Ok(CommitmentStatus::Mined), - "finalized" => Ok(CommitmentStatus::Finalized), - _ => Err(()), - } - } -} - -#[derive(Debug, Clone)] -pub struct DbSequencerCommitment { - /// Hex encoded L1 transaction ID - pub l1_tx_id: Vec, - // pub l1_start_height: u32, - // pub l1_end_height: u32, - // /// Hex encoded L1 start hash - // pub l1_start_hash: Vec, - // /// Hex encoded L1 end hash - // pub l1_end_hash: Vec, - pub l2_start_height: u64, - pub l2_end_height: u64, - /// Hex encoded merkle root of soft confirmation hashes - pub merkle_root: Vec, - pub status: CommitmentStatus, -} - -// Fields removed: -// -// l1_start_hash BYTEA NOT NULL, -// l1_end_hash BYTEA NOT NULL, -// l1_start_height OID NOT NULL, -// l1_end_height OID NOT NULL, -pub const SEQUENCER_COMMITMENT_TABLE_CREATE_QUERY: &str = " -CREATE TABLE IF NOT EXISTS sequencer_commitments ( - id SERIAL PRIMARY KEY, - l1_tx_id BYTEA NOT NULL, - l2_start_height OID NOT NULL, - l2_end_height OID NOT NULL, - merkle_root BYTEA NOT NULL, - status VARCHAR(15) NOT NULL, - created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), - - UNIQUE (l2_start_height, l2_end_height) -); -"; - -pub const INDEX_L2_END_HEIGHT: &str = - "CREATE INDEX IF NOT EXISTS idx_l2_end_height ON sequencer_commitments(l2_end_height);"; -pub const INDEX_L1_END_HEIGHT: &str = - "CREATE INDEX IF NOT EXISTS idx_l1_end_height ON sequencer_commitments(l1_end_height);"; -pub const INDEX_L1_END_HASH: &str = - "CREATE INDEX IF NOT EXISTS idx_l1_end_hash ON sequencer_commitments(l1_end_hash);"; - -// tx is rlp encoded -pub const MEMPOOL_TXS_TABLE_CREATE_QUERY: &str = " -CREATE TABLE IF NOT EXISTS mempool_txs ( - id SERIAL PRIMARY KEY, - tx_hash BYTEA NOT NULL UNIQUE, - tx BYTEA NOT NULL -);"; - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct DbMempoolTx { - /// Tx Hash - pub tx_hash: Vec, - /// RLP encoded transaction - pub tx: Vec, -} - -pub const PROOF_TABLE_CREATE_QUERY: &str = " -CREATE TABLE IF NOT EXISTS proof ( - id SERIAL PRIMARY KEY, - l1_tx_id BYTEA NOT NULL, - proof_data BYTEA NOT NULL, - state_transition JSON NOT NULL, - proof_type VARCHAR(20) NOT NULL, - created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() -); -"; - -#[derive(Debug, Clone, PartialEq)] -pub struct DbProof { - pub l1_tx_id: Vec, - pub proof_data: Vec, - pub state_transition: Json, - pub proof_type: ProofType, -} - -#[derive(Debug, Clone, PartialEq)] -pub enum ProofType { - Full, - PublicInput, -} - -impl fmt::Display for ProofType { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - ProofType::Full => write!(f, "Full"), - ProofType::PublicInput => write!(f, "Public Input"), - } - } -} - -impl std::str::FromStr for ProofType { - type Err = (); - fn from_str(s: &str) -> Result { - match s { - "Full" => Ok(ProofType::Full), - "Public Input" => Ok(ProofType::PublicInput), - _ => Err(()), - } - } -} diff --git a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs index f585499ad..1e40bce0c 100644 --- a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs +++ b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs @@ -17,9 +17,9 @@ use crate::rocks_db_config::gen_rocksdb_options; use crate::schema::tables::{ ActiveFork, BatchByHash, BatchByNumber, CommitmentsByNumber, EventByKey, EventByNumber, L2GenesisStateRoot, L2RangeByL1Height, L2Witness, LastSequencerCommitmentSent, LastStateDiff, - PendingSequencerCommitmentL2Range, ProofBySlotNumber, ProverLastScannedSlot, SlotByHash, - SlotByNumber, SoftBatchByHash, SoftBatchByNumber, SoftConfirmationStatus, TxByHash, TxByNumber, - VerifiedProofsBySlotNumber, LEDGER_TABLES, + MempoolTxs, PendingSequencerCommitmentL2Range, ProofBySlotNumber, ProverLastScannedSlot, + SlotByHash, SlotByNumber, SoftBatchByHash, SoftBatchByNumber, SoftConfirmationStatus, TxByHash, + TxByNumber, VerifiedProofsBySlotNumber, LEDGER_TABLES, }; use crate::schema::types::{ split_tx_for_storage, BatchNumber, EventNumber, L2HeightRange, SlotNumber, StoredBatch, @@ -466,6 +466,26 @@ impl SharedLedgerOps for LedgerDB { .get::(&()) .map(|fork| fork.unwrap_or_default()) } + + /// Get the most recent committed batch + /// Returns L2 height. + #[instrument(level = "trace", skip(self), err, ret)] + fn get_last_commitment_l2_height(&self) -> anyhow::Result> { + self.db.get::(&()) + } + + /// Used by the nodes to record that it has committed a soft confirmations on a given L2 height. + /// For a sequencer, the last commitment height is set when the block is produced. + /// For a full node the last commitment is set when a commitment is read from a finalized DA layer block. + #[instrument(level = "trace", skip(self), err, ret)] + fn set_last_commitment_l2_height(&self, l2_height: BatchNumber) -> Result<(), anyhow::Error> { + let mut schema_batch = SchemaBatch::new(); + + schema_batch.put::(&(), &l2_height)?; + self.db.write_schemas(schema_batch)?; + + Ok(()) + } } impl ProverLedgerOps for LedgerDB { @@ -653,20 +673,6 @@ impl SequencerLedgerOps for LedgerDB { Ok(()) } - /// Used by the sequencer to record that it has committed to soft confirmations on a given L2 height - #[instrument(level = "trace", skip(self), err, ret)] - fn set_last_sequencer_commitment_l2_height( - &self, - l2_height: BatchNumber, - ) -> Result<(), anyhow::Error> { - let mut schema_batch = SchemaBatch::new(); - - schema_batch.put::(&(), &l2_height)?; - self.db.write_schemas(schema_batch)?; - - Ok(()) - } - /// Gets all pending commitments' l2 ranges. /// Returns start-end L2 heights. #[instrument(level = "trace", skip(self), err)] @@ -708,17 +714,10 @@ impl SequencerLedgerOps for LedgerDB { Ok(()) } - /// Get the most recent committed batch - /// Returns L2 height. - #[instrument(level = "trace", skip(self), err, ret)] - fn get_last_sequencer_commitment_l2_height(&self) -> anyhow::Result> { - self.db.get::(&()) - } - /// Get the most recent commitment's l1 height #[instrument(level = "trace", skip(self), err, ret)] fn get_l1_height_of_last_commitment(&self) -> anyhow::Result> { - let l2_height = self.get_last_sequencer_commitment_l2_height()?; + let l2_height = self.get_last_commitment_l2_height()?; match l2_height { Some(l2_height) => { let soft_confirmation = self @@ -729,6 +728,35 @@ impl SequencerLedgerOps for LedgerDB { None => Ok(None), } } + + fn insert_mempool_tx(&self, tx_hash: Vec, tx: Vec) -> anyhow::Result<()> { + let mut schema_batch = SchemaBatch::new(); + schema_batch.put::(&tx_hash, &tx)?; + + self.db.write_schemas(schema_batch)?; + + Ok(()) + } + + fn get_mempool_txs(&self) -> anyhow::Result, Vec)>> { + let mut iter = self.db.iter::()?; + iter.seek_to_first(); + + let txs = iter + .map(|item| item.map(|item| (item.key, item.value))) + .collect::, Vec)>, _>>()?; + + Ok(txs) + } + + fn remove_mempool_txs(&self, tx_hashes: Vec>) -> anyhow::Result<()> { + let mut schema_batch = SchemaBatch::new(); + for tx_hash in tx_hashes { + schema_batch.delete::(&tx_hash)?; + } + self.db.write_schemas(schema_batch)?; + Ok(()) + } } impl NodeLedgerOps for LedgerDB { diff --git a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs index cb69385d0..072387f63 100644 --- a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs +++ b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/traits.rs @@ -122,6 +122,13 @@ pub trait SharedLedgerOps { /// Gets the currently active fork fn get_active_fork(&self) -> Result; + + /// Used by the sequencer to record that it has committed to soft confirmations on a given L2 height + fn set_last_commitment_l2_height(&self, l2_height: BatchNumber) -> Result<()>; + + /// Get the most recent committed batch + /// Returns L2 height. + fn get_last_commitment_l2_height(&self) -> anyhow::Result>; } /// Node ledger operations @@ -198,9 +205,6 @@ pub trait SequencerLedgerOps: SharedLedgerOps { data_to_commit: SlotCommit, ) -> Result<()>; - /// Used by the sequencer to record that it has committed to soft confirmations on a given L2 height - fn set_last_sequencer_commitment_l2_height(&self, l2_height: BatchNumber) -> Result<()>; - /// Gets all pending commitments' l2 ranges. /// Returns start-end L2 heights. fn get_pending_commitments_l2_range(&self) -> Result>; @@ -214,10 +218,15 @@ pub trait SequencerLedgerOps: SharedLedgerOps { /// Sets the latest state diff fn set_state_diff(&self, state_diff: StateDiff) -> Result<()>; - /// Get the most recent committed batch - /// Returns L2 height. - fn get_last_sequencer_commitment_l2_height(&self) -> anyhow::Result>; - /// Get the most recent commitment's l1 height fn get_l1_height_of_last_commitment(&self) -> anyhow::Result>; + + /// Insert mempool transaction + fn insert_mempool_tx(&self, tx_hash: Vec, tx: Vec) -> anyhow::Result<()>; + + /// Insert mempool transaction + fn remove_mempool_txs(&self, tx_hashes: Vec>) -> anyhow::Result<()>; + + /// Fetch mempool transactions + fn get_mempool_txs(&self) -> anyhow::Result, Vec)>>; } diff --git a/crates/sovereign-sdk/full-node/db/sov-db/src/schema/tables.rs b/crates/sovereign-sdk/full-node/db/sov-db/src/schema/tables.rs index 02f05fe1b..6c15ff47c 100644 --- a/crates/sovereign-sdk/full-node/db/sov-db/src/schema/tables.rs +++ b/crates/sovereign-sdk/full-node/db/sov-db/src/schema/tables.rs @@ -74,6 +74,7 @@ pub const LEDGER_TABLES: &[&str] = &[ CommitmentsByNumber::table_name(), ProofBySlotNumber::table_name(), VerifiedProofsBySlotNumber::table_name(), + MempoolTxs::table_name(), ]; /// A list of all tables used by the NativeDB. These tables store @@ -337,6 +338,11 @@ define_table_with_default_codec!( (VerifiedProofsBySlotNumber) SlotNumber => Vec ); +define_table_with_default_codec!( + /// Transactions in mempool (TxHash, TxData) + (MempoolTxs) Vec => Vec +); + impl KeyEncoder for NodeKey { fn encode_key(&self) -> sov_schema_db::schema::Result> { // 8 bytes for version, 4 each for the num_nibbles and bytes.len() fields, plus 1 byte per byte of nibllepath diff --git a/crates/sovereign-sdk/full-node/sov-stf-runner/Cargo.toml b/crates/sovereign-sdk/full-node/sov-stf-runner/Cargo.toml index 88e31eab5..8bdb6925a 100644 --- a/crates/sovereign-sdk/full-node/sov-stf-runner/Cargo.toml +++ b/crates/sovereign-sdk/full-node/sov-stf-runner/Cargo.toml @@ -36,7 +36,6 @@ sov-rollup-interface = { path = "../../rollup-interface" } # Citrea-Deps citrea-primitives = { path = "../../../primitives" } -shared-backup-db = { path = "../../../shared-backup-db", optional = true } [dev-dependencies] sha2 = { workspace = true } @@ -60,7 +59,6 @@ native = [ "futures", "async-trait", "thiserror", - "shared-backup-db", "rand", "tower", "hyper", diff --git a/crates/sovereign-sdk/full-node/sov-stf-runner/src/config.rs b/crates/sovereign-sdk/full-node/sov-stf-runner/src/config.rs index 87cda068d..668f21dae 100644 --- a/crates/sovereign-sdk/full-node/sov-stf-runner/src/config.rs +++ b/crates/sovereign-sdk/full-node/sov-stf-runner/src/config.rs @@ -4,7 +4,6 @@ use std::path::{Path, PathBuf}; use serde::de::DeserializeOwned; use serde::Deserialize; -use shared_backup_db::SharedBackupDbConfig; use crate::ProverGuestRunConfig; @@ -130,8 +129,6 @@ pub struct ProverConfig { pub proving_mode: ProverGuestRunConfig, /// Average number of commitments to prove pub proof_sampling_number: usize, - /// Offchain db config - pub db_config: Option, } impl Default for ProverConfig { @@ -139,7 +136,6 @@ impl Default for ProverConfig { Self { proving_mode: ProverGuestRunConfig::Execute, proof_sampling_number: 0, - db_config: None, } } } @@ -244,13 +240,6 @@ mod tests { let config = r#" proving_mode = "skip" proof_sampling_number = 500 - - [db_config] - db_host = "localhost" - db_port = 5432 - db_user = "postgres" - db_password = "postgres" - db_name = "postgres" "#; let config_file = create_config_from(config); @@ -259,7 +248,6 @@ mod tests { let expected = ProverConfig { proving_mode: ProverGuestRunConfig::Skip, proof_sampling_number: 500, - db_config: Some(SharedBackupDbConfig::default()), }; assert_eq!(config, expected); } diff --git a/docker-compose.postgres.yml b/docker-compose.postgres.yml deleted file mode 100644 index 9443d3240..000000000 --- a/docker-compose.postgres.yml +++ /dev/null @@ -1,11 +0,0 @@ -services: - postgres: - image: postgres:16-alpine - ports: - - 5432:5432 - volumes: - - ./resources/dbs/postgres:/var/lib/postgresql/data - environment: - - POSTGRES_PASSWORD=postgres - - POSTGRES_USER=postgres - - POSTGRES_DB=postgres diff --git a/docs/run.md b/docs/run.md index 7e51f959c..0ce8d4462 100644 --- a/docs/run.md +++ b/docs/run.md @@ -14,19 +14,6 @@ Build citrea: make build ``` -### Prequisites - -For production use cases, we leverage PostgreSQL for a few extra features in the sequencer. These features are optional, if you don't want to run them, make sure the `sequencer_config.toml` file does not contain the db_config altogether in order to skip using a storage DB backend such as postgres. - -If running Postgres is prefered, you can execute the following command: - -```sh -docker compose -f docker-compose.postgres.yml up -d - -``` - -this will run postgres in a dockerized daemon mode. - ### Run on Mock DA Run on a local da layer, sharable between nodes that run on your computer. diff --git a/resources/configs/bitcoin-regtest/sequencer_config.toml b/resources/configs/bitcoin-regtest/sequencer_config.toml index 34756184f..f4c639071 100644 --- a/resources/configs/bitcoin-regtest/sequencer_config.toml +++ b/resources/configs/bitcoin-regtest/sequencer_config.toml @@ -13,10 +13,3 @@ queue_tx_size = 200 base_fee_tx_limit = 100000 base_fee_tx_size = 200 max_account_slots = 16 - -[db_config] -db_host = "localhost" -db_port = 5432 -db_user = "postgres" -db_password = "postgres" -db_name = "postgres" diff --git a/resources/configs/mock-dockerized/sequencer_config.toml b/resources/configs/mock-dockerized/sequencer_config.toml index 6e0e00f2f..97795bf4d 100644 --- a/resources/configs/mock-dockerized/sequencer_config.toml +++ b/resources/configs/mock-dockerized/sequencer_config.toml @@ -13,10 +13,3 @@ queue_tx_size = 200 base_fee_tx_limit = 100000 base_fee_tx_size = 200 max_account_slots = 16 - -[db_config] -db_host = "localhost" -db_port = 5432 -db_user = "postgres" -db_password = "postgres" -db_name = "postgres" diff --git a/resources/configs/mock/prover_config.toml b/resources/configs/mock/prover_config.toml index 105b60c4e..f22d841e5 100644 --- a/resources/configs/mock/prover_config.toml +++ b/resources/configs/mock/prover_config.toml @@ -1,9 +1,2 @@ proving_mode = "execute" proof_sampling_number = 500 - -[db_config] -db_host = "localhost" -db_port = 5432 -db_user = "postgres" -db_password = "postgres" -db_name = "postgres" diff --git a/resources/configs/mock/sequencer_config.toml b/resources/configs/mock/sequencer_config.toml index 6e0e00f2f..97795bf4d 100644 --- a/resources/configs/mock/sequencer_config.toml +++ b/resources/configs/mock/sequencer_config.toml @@ -13,10 +13,3 @@ queue_tx_size = 200 base_fee_tx_limit = 100000 base_fee_tx_size = 200 max_account_slots = 16 - -[db_config] -db_host = "localhost" -db_port = 5432 -db_user = "postgres" -db_password = "postgres" -db_name = "postgres" diff --git a/resources/hive/.dockerignore b/resources/hive/.dockerignore index 44710fb34..e69de29bb 100644 --- a/resources/hive/.dockerignore +++ b/resources/hive/.dockerignore @@ -1 +0,0 @@ -*/data/postgres