From 3a27dda9fce8ab076fbd629ea9b4e327e9f39c2c Mon Sep 17 00:00:00 2001 From: Alysia Huggins Date: Tue, 3 Sep 2024 22:36:25 -0400 Subject: [PATCH] remove fields from light cilent state that are not needed and began the process of updating the related adapte and hotshot-state-prover code e.g. the MockGenesis action --- Cargo.lock | 52 ++-- .../artifacts/LightClientMock_bytecode.json | 2 +- .../artifacts/LightClient_bytecode.json | 2 +- contract-bindings/src/light_client.rs | 223 ++-------------- contract-bindings/src/light_client_mock.rs | 241 ++---------------- contract-bindings/src/shared_types.rs | 7 +- contracts/rust/adapter/src/light_client.rs | 89 +------ contracts/rust/diff-test/src/main.rs | 29 ++- contracts/script/LightClient.s.sol | 66 ++--- .../script/LightClientWithDefender.s.sol | 11 +- contracts/src/LightClient.sol | 39 +-- .../test/DeployLightClientTestScript.s.sol | 47 ++-- contracts/test/LightClient.t.sol | 144 ++++------- .../test/LightClientUpgradeSameContract.t.sol | 21 +- contracts/test/LightClientUpgradeToVx.t.sol | 57 +---- contracts/test/LightClientV2.sol | 12 - contracts/test/mocks/LightClientMock.sol | 4 - hotshot-state-prover/src/circuit.rs | 23 +- hotshot-state-prover/src/mock_ledger.rs | 63 +++-- hotshot-state-prover/src/service.rs | 46 +++- hotshot-state-prover/src/snark.rs | 6 +- sequencer/src/api.rs | 5 + sequencer/src/bin/deploy.rs | 5 +- sequencer/src/bin/espresso-dev-node.rs | 2 + sequencer/src/state_signature.rs | 2 - sequencer/src/state_signature/relay_server.rs | 2 +- utils/src/deployer.rs | 5 +- 27 files changed, 348 insertions(+), 857 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d6029af27..6cfabcbde 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4077,7 +4077,7 @@ dependencies = [ [[package]] name = "hotshot" version = "0.5.72" -source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#a24cb7d3f48b0b61899b12a6e4d6d8efd8235dce" +source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#fab485203813d8ae684f65cdd6b9241db2e46f54" dependencies = [ "anyhow", "async-broadcast", @@ -4124,7 +4124,7 @@ dependencies = [ [[package]] name = "hotshot-builder-api" version = "0.1.7" -source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#a24cb7d3f48b0b61899b12a6e4d6d8efd8235dce" +source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#fab485203813d8ae684f65cdd6b9241db2e46f54" dependencies = [ "async-trait", "clap", @@ -4222,7 +4222,7 @@ dependencies = [ [[package]] name = "hotshot-example-types" version = "0.5.72" -source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#a24cb7d3f48b0b61899b12a6e4d6d8efd8235dce" +source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#fab485203813d8ae684f65cdd6b9241db2e46f54" dependencies = [ "anyhow", "async-broadcast", @@ -4255,7 +4255,7 @@ dependencies = [ [[package]] name = "hotshot-fakeapi" version = "0.5.72" -source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#a24cb7d3f48b0b61899b12a6e4d6d8efd8235dce" +source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#fab485203813d8ae684f65cdd6b9241db2e46f54" dependencies = [ "anyhow", "async-lock 2.8.0", @@ -4274,7 +4274,7 @@ dependencies = [ [[package]] name = "hotshot-macros" version = "0.5.72" -source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#a24cb7d3f48b0b61899b12a6e4d6d8efd8235dce" +source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#fab485203813d8ae684f65cdd6b9241db2e46f54" dependencies = [ "derive_builder", "proc-macro2", @@ -4285,7 +4285,7 @@ dependencies = [ [[package]] name = "hotshot-orchestrator" version = "0.5.72" -source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#a24cb7d3f48b0b61899b12a6e4d6d8efd8235dce" +source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#fab485203813d8ae684f65cdd6b9241db2e46f54" dependencies = [ "anyhow", "async-compatibility-layer", @@ -4371,7 +4371,7 @@ dependencies = [ [[package]] name = "hotshot-stake-table" version = "0.5.72" -source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#a24cb7d3f48b0b61899b12a6e4d6d8efd8235dce" +source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#fab485203813d8ae684f65cdd6b9241db2e46f54" dependencies = [ "ark-bn254", "ark-ed-on-bn254", @@ -4433,7 +4433,7 @@ dependencies = [ [[package]] name = "hotshot-task" version = "0.5.72" -source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#a24cb7d3f48b0b61899b12a6e4d6d8efd8235dce" +source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#fab485203813d8ae684f65cdd6b9241db2e46f54" dependencies = [ "anyhow", "async-broadcast", @@ -4448,7 +4448,7 @@ dependencies = [ [[package]] name = "hotshot-task-impls" version = "0.5.72" -source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#a24cb7d3f48b0b61899b12a6e4d6d8efd8235dce" +source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#fab485203813d8ae684f65cdd6b9241db2e46f54" dependencies = [ "anyhow", "async-broadcast", @@ -4485,7 +4485,7 @@ dependencies = [ [[package]] name = "hotshot-testing" version = "0.5.72" -source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#a24cb7d3f48b0b61899b12a6e4d6d8efd8235dce" +source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#fab485203813d8ae684f65cdd6b9241db2e46f54" dependencies = [ "anyhow", "async-broadcast", @@ -4531,7 +4531,7 @@ dependencies = [ [[package]] name = "hotshot-types" version = "0.1.11" -source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#a24cb7d3f48b0b61899b12a6e4d6d8efd8235dce" +source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#fab485203813d8ae684f65cdd6b9241db2e46f54" dependencies = [ "anyhow", "ark-bn254", @@ -5788,7 +5788,7 @@ dependencies = [ [[package]] name = "libp2p-networking" version = "0.5.72" -source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#a24cb7d3f48b0b61899b12a6e4d6d8efd8235dce" +source = "git+https://github.com/EspressoSystems/hotshot?branch=lc-contract-updates#fab485203813d8ae684f65cdd6b9241db2e46f54" dependencies = [ "anyhow", "async-compatibility-layer", @@ -9165,9 +9165,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcfa89bea9500db4a0d038513d7a060566bfc51d46d1c014847049a45cce85e8" +checksum = "93334716a037193fac19df402f8571269c84a00852f6a7066b5d2616dcd64d3e" dependencies = [ "sqlx-core", "sqlx-macros", @@ -9178,9 +9178,9 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06e2f2bd861719b1f3f0c7dbe1d80c30bf59e76cf019f07d9014ed7eefb8e08" +checksum = "d4d8060b456358185f7d50c55d9b5066ad956956fddec42ee2e8567134a8936e" dependencies = [ "atoi", "byteorder", @@ -9218,9 +9218,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f998a9defdbd48ed005a89362bd40dd2117502f15294f61c8d47034107dbbdc" +checksum = "cac0692bcc9de3b073e8d747391827297e075c7710ff6276d9f7a1f3d58c6657" dependencies = [ "proc-macro2", "quote", @@ -9231,9 +9231,9 @@ dependencies = [ [[package]] name = "sqlx-macros-core" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d100558134176a2629d46cec0c8891ba0be8910f7896abfdb75ef4ab6f4e7ce" +checksum = "1804e8a7c7865599c9c79be146dc8a9fd8cc86935fa641d3ea58e5f0688abaa5" dependencies = [ "dotenvy", "either", @@ -9257,9 +9257,9 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cac0ab331b14cb3921c62156d913e4c15b74fb6ec0f3146bd4ef6e4fb3c12" +checksum = "64bb4714269afa44aef2755150a0fc19d756fb580a67db8885608cf02f47d06a" dependencies = [ "atoi", "base64 0.22.1", @@ -9300,9 +9300,9 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9734dbce698c67ecf67c442f768a5e90a49b2a4d61a9f1d59f73874bd4cf0710" +checksum = "6fa91a732d854c5d7726349bb4bb879bb9478993ceb764247660aee25f67c2f8" dependencies = [ "atoi", "base64 0.22.1", @@ -9339,9 +9339,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75b419c3c1b1697833dd927bdc4c6545a620bc1bbafabd44e1efbe9afcd337e" +checksum = "d5b2cf34a45953bfd3daaf3db0f7a7878ab9b7a6b91b422d24a7a9e4c857b680" dependencies = [ "atoi", "flume 0.11.0", diff --git a/contract-bindings/artifacts/LightClientMock_bytecode.json b/contract-bindings/artifacts/LightClientMock_bytecode.json index 01f2f73bc..c2f3e7b91 100644 --- a/contract-bindings/artifacts/LightClientMock_bytecode.json +++ b/contract-bindings/artifacts/LightClientMock_bytecode.json @@ -1 +1 @@ -"0x346200063857620036a2388190039060a0601f8301601f1916810191906001600160401b038311908310176200054957829160405260a0396101a08112620006385761010081126200063857604051906101008201906001600160401b0382118383101762000549576080916040526200007a60a06200063d565b83526200008860c06200063d565b602084015260e08051604085015261010051606085015260a0838101518486015261014051908501526101605160c0850152610180519084015260ff1901126200063857604051906001600160401b03608083019081119083111762000549576080820160409081526101a05183526101c05160208401526101e05190830152610200516060830152610220519163ffffffff831683036200063857306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c1662000626576002600160401b03196001600160401b03821601620005bc575b5081516001600160401b031615801590620005a5575b801562000598575b80156200058b575b80156200057e575b801562000571575b6200055f5760018060401b03825116809360095468010000000000000000600160801b03602086015160401b1692839160018060801b031916171760095560408401519283600a55606085015180600b5560808601519485600c5560a08701519485600d5560c08801519889600e55606060e08a01519586600f55805160055560208101516006556040810151600755015160085560018060801b03196010541617176010556011556012558360135582601455856015556016556017549063ffffffff60a81b9060a81b169063ffffffff60a81b1916179384601755604051916020830193845260408301526060820152606081526080810181811060018060401b0382111762000549576040525190209160009280845560e08301519081600155600255600355601954908115159182620004d2575b505062000443575b602081015160409182015182519290916001600160401b03908116918401908111848210176200041b5760405282526020820152604051906060820182811060018060401b038211176200042f5760409081526001600160401b034381168452421660208401908152908301918252601954909290680100000000000000008110156200041b578060016200037f920160195562000652565b94909462000407575051835492516001600160801b03199093166001600160401b0391821617604093841b6fffffffffffffffff000000000000000016178455905180516001850180546001600160401b03191691909316179091556020015160029290920191909155516130199081620006898239608051818181610dec0152610f440152f35b634e487b7160e01b81526004819052602490fd5b634e487b7160e01b85526041600452602485fd5b634e487b7160e01b84526041600452602484fd5b6018546200045a906001600160401b031662000652565b620004be57828155600181018390556002018290556018546001600160401b03808216908114620004aa576001600160401b03199091166001919091016001600160401b031617601855620002e6565b634e487b7160e01b84526011600452602484fd5b634e487b7160e01b83526004839052602483fd5b9091506000198101908111620004aa57620004ed9062000652565b50546018546001600160401b0360409290921c8216916200050f911662000652565b505460401c6001600160401b0390811690910391908211620004aa5760a81c63ffffffff166001600160401b0390911610153880620002de565b634e487b7160e01b600052604160045260246000fd5b6040516350dd03f760e11b8152600490fd5b5060e082015115620001a6565b5060c0820151156200019e565b5060a08201511562000196565b506080820151156200018e565b5060208201516001600160401b0316151562000186565b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13862000170565b60405163f92ee8a960e01b8152600490fd5b600080fd5b51906001600160401b03821682036200063857565b601954811015620006725760196000526003602060002091020190600090565b634e487b7160e01b600052603260045260246000fdfe6080604052600436101561001257600080fd5b60003560e01c8063013fa5fc1461025757806302b592f3146102525780630c693a221461024d5780630d8e6e2c14610248578063202a0adb146102435780632d52aad61461023e5780632f5f4600146102395780632f79889d14610234578063313df7b11461022f578063382b215a1461022a578063409939b7146102255780634847ae5d146102205780634f1ef2861461021b57806352d1902d14610216578063628277331461021157806369cc6a041461020c578063715018a61461020757806376b6b7cb146102025780637f17baad146101fd57806382d07ff3146101f85780638584d23f146101f35780638da5cb5b146101ee5780638ed3e045146101e957806396c1ca61146101e45780639fdb54a7146101df578063a9a9c9f5146101da578063aa922732146101d5578063ad3cb1cc146101d0578063bd32519a146101cb578063c23b9e9e146101c6578063c8e5e498146101c1578063ca6fe855146101bc578063d24d933d146101b7578063e0303301146101b2578063f2fde38b146101ad5763f9e50d19146101a857600080fd5b61165b565b611632565b611502565b6114ba565b61149c565b61147f565b611458565b611432565b6113b5565b611388565b611351565b611309565b611284565b61120b565b6111d5565b611198565b611167565b6110f7565b611084565b611019565b610fba565b610f9c565b610f31565b610d72565b610cd4565b610b1f565b6108d2565b6108a9565b610882565b610798565b61075b565b610687565b6105c4565b610544565b6104ce565b61028e565b600435906001600160a01b038216820361027257565b600080fd5b6101a435906001600160a01b038216820361027257565b34610272576020366003190112610272576102a761025c565b6102af611fad565b6001600160a01b0390811690811561033a5760175490811682146103285760ff60a01b19919091166001600160a81b03199190911617600160a01b1760178190556040516001600160a01b0390911681527f8017bb887fdf8fca4314a9d40f6e73b3b81002d67e5cfa85d88173af6aa4607290602090a1005b60405163a863aec960e01b8152600490fd5b60405163e6c4247b60e01b8152600490fd5b634e487b7160e01b600052603260045260246000fd5b60195481101561039d576003906019600052027f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c96950190600090565b61034c565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b038211176103d357604052565b6103a2565b608081019081106001600160401b038211176103d357604052565b61010081019081106001600160401b038211176103d357604052565b606081019081106001600160401b038211176103d357604052565b90601f801991011681019081106001600160401b038211176103d357604052565b604051906102e082018281106001600160401b038211176103d357604052565b60405190610478826103b8565b565b604051906104788261040f565b6040519061028082018281106001600160401b038211176103d357604052565b906040516104b4816103b8565b6020600182946001600160401b0381541684520154910152565b3461027257602036600319011261027257600435601954811015610272576104f7608091610362565b5061054281549161051260016001600160401b0392016104a7565b9060405193818116855260401c1660208401526040830190602080916001600160401b0381511684520151910152565bf35b34610272576000806003193601126105c15760809060409060608251610569816103d8565b828152826020820152828482015201528051610584816103d8565b6005549182825260065460208301908152600754908284019182526060600854940193845282519485525160208501525190830152516060820152f35b80fd5b34610272576000366003190112610272576060604051600181526000602082015260006040820152f35b602435906001600160401b038216820361027257565b35906001600160401b038216820361027257565b6101009060031901126102725760405190610632826103f3565b816004356001600160401b03811681036102725781526106506105ee565b602082015260443560408201526064356060820152608435608082015260a43560a082015260c43560c082015260e060e435910152565b34610272576101003660031901126102725761075960e06106a736610618565b6106d16001600160401b038251166001600160401b03166001600160401b03196010541617601055565b6107116106e860208301516001600160401b031690565b67ffffffffffffffff60401b6010549160401b169067ffffffffffffffff60401b191617601055565b61071e6040820151601155565b61072b6060820151601255565b6107386080820151601355565b61074560a0820151601455565b61075260c0820151601555565b0151601655565b005b3461027257602036600319011261027257601a805460ff19166001179055600435601b55005b6001600160401b0381116103d35760051b60200190565b346102725760208060031936011261027257600435906001600160401b0382116102725736602383011215610272578160040135916107d683610781565b916040936107e68551948561042a565b80845260248285019160071b8401019236841161027257602401905b8382106108125761075985611862565b81360360808112610272578680519161082a8361040f565b61083385610604565b8352610840868601610604565b83870152603f190112610272576080918491885161085d816103b8565b6108688a8701610604565b815260608601358482015289820152815201910190610802565b346102725760003660031901126102725760206001600160401b0360185416604051908152f35b34610272576000366003190112610272576017546040516001600160a01b039091168152602090f35b34610272576000366003190112610272576020600254604051908152f35b604090610103190112610272576040519061090a826103b8565b610104358252610124356020830152565b6040906101431901126102725760405190610935826103b8565b610144358252610164356020830152565b6040906101831901126102725760405190610960826103b8565b6101843582526101a4356020830152565b6040906101c3190112610272576040519061098b826103b8565b6101c43582526101e4356020830152565b60409061020319011261027257604051906109b6826103b8565b610204358252610224356020830152565b60409061024319011261027257604051906109e1826103b8565b610244358252610264356020830152565b6040906102831901126102725760405190610a0c826103b8565b6102843582526102a4356020830152565b6040906102c31901126102725760405190610a37826103b8565b6102c43582526102e4356020830152565b6040906103031901126102725760405190610a62826103b8565b610304358252610324356020830152565b6040906103431901126102725760405190610a8d826103b8565b610344358252610364356020830152565b6040906103831901126102725760405190610ab8826103b8565b6103843582526103a4356020830152565b6040906103c31901126102725760405190610ae3826103b8565b6103c43582526103e4356020830152565b6040906104031901126102725760405190610b0e826103b8565b610404358252610424356020830152565b346102725761058036600319011261027257610b3a36610618565b610480366101031901126102725761075990610b5461044b565b90610b5e366108f0565b8252610b693661091b565b6020830152610b7736610946565b6040830152610b8536610971565b6060830152610b933661099c565b6080830152610ba1366109c7565b60a0830152610baf366109f2565b60c0830152610bbd36610a1d565b60e0830152610bcb36610a48565b610100830152610bda36610a73565b610120830152610be936610a9e565b610140830152610bf836610ac9565b610160830152610c0736610af4565b610180830152610444356101a0830152610464356101c0830152610484356101e08301526104a4356102008301526104c4356102208301526104e4356102408301526105043561026083015261052435610280830152610544356102a0830152610564356102c083015261190c565b91909160e0806101008301946001600160401b03808251168552602082015116602085015260408101516040850152606081015160608501526080810151608085015260a081015160a085015260c081015160c08501520151910152565b3461027257600036600319011261027257610ced611a8f565b50610d53604051610cfd816103f3565b6009546001600160401b0390818116835260401c166020820152600a546040820152600b546060820152600c546080820152600d5460a0820152600e5460c0820152600f5460e082015260405191829182610c76565b0390f35b6001600160401b0381116103d357601f01601f191660200190565b60408060031936011261027257610d8761025c565b6024356001600160401b038111610272573660238201121561027257806004013590610db282610d57565b91610dbf8551938461042a565b80835260209136602483830101116102725781600092602485930183870137840101526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116308114908115610f15575b50610f04579080600492610e2a611fad565b7ff78721226efe9a1bb678189a16d1554928b9f2192e2cb93eeda83b79fa40007d82885192881692838152a186516352d1902d60e01b815293849182905afa918291600093610ed5575b5050610e9a578351634c9c8ce360e01b81526001600160a01b0384166004820152602490fd5b600080516020612fcd8339815191528193929303610ebc576107598383612e31565b8351632a87526960e21b81526004810191909152602490fd5b610ef5929350803d10610efd575b610eed818361042a565b81019061277c565b903880610e74565b503d610ee3565b845163703e46dd60e11b8152600490fd5b905081600080516020612fcd8339815191525416141538610e18565b34610272576000366003190112610272577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163003610f8a576020604051600080516020612fcd8339815191528152f35b60405163703e46dd60e11b8152600490fd5b34610272576000366003190112610272576020600154604051908152f35b34610272576000806003193601126105c157610fd4611fad565b60175460ff8160a01c16600014610328576001600160a81b0319166017557f9a5f57de856dd668c54dd95e5c55df93432171cbca49a8776d5620ea59c024508180a180f35b34610272576000806003193601126105c157611033611fad565b600080516020612fad83398151915280546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b34610272576000366003190112610272576020600054604051908152f35b6004359063ffffffff8216820361027257565b949198979693909260e0969361010087019a6001600160401b03809216885216602087015260408601526060850152608084015260a083015260c08201520152565b346102725760203660031901126102725763ffffffff6111156110a2565b1660005260046020526040600020805490610d536001600160401b039160018101549060028101546003820154600483015491600660058501549401549460405198888a998260401c169116896110b5565b3461027257600036600319011261027257611180611a8f565b50610d5361118c611acd565b60405191829182610c76565b346102725760203660031901126102725760406111b6600435611b70565b61054282518092602080916001600160401b0381511684520151910152565b3461027257600036600319011261027257600080516020612fad833981519152546040516001600160a01b039091168152602090f35b34610272576101c03660031901126102725761122636610618565b6080366101031901126102725760405190611240826103d8565b6101043582526101243560208301526101443560408301526101643560608301526101843563ffffffff81168103610272576107599261127e610277565b92611c33565b346102725760203660031901126102725761129d6110a2565b6112a5611fad565b63ffffffff808216610e1081109182156112f7575b50506112e5576017805463ffffffff60a81b191660a89290921b63ffffffff60a81b16919091179055005b6040516307a5077760e51b8152600490fd5b60175460a81c161015905038806112ba565b34610272576000366003190112610272576010546001600160401b03610d5360115460125460135460145490601554926016549460405198888a998260401c169116896110b5565b3461027257600036600319011261027257608060055460065460075460085491604051938452602084015260408301526060820152f35b34610272576101003660031901126102725760206113ad6113a836610618565b611f01565b604051908152f35b346102725760003660031901126102725760408051906113d4826103b8565b60058252602090640352e302e360dc1b6020840152604051916020835283519182602085015260005b83811061141f5784604081866000838284010152601f80199101168101030190f35b85810183015185820183015282016113fd565b3461027257600036600319011261027257602060ff60175460a01c166040519015158152f35b3461027257600036600319011261027257602063ffffffff60175460a81c16604051908152f35b3461027257600036600319011261027257601a805460ff19169055005b34610272576000366003190112610272576020600354604051908152f35b34610272576000366003190112610272576009546001600160401b03610d53600a54600b54600c54600d5490600e5492600f549460405198888a998260401c169116896110b5565b34610272576040366003190112610272576004356024359060ff601a541660009060001461155057509061153c610d5392601b5490611b63565b115b60405190151581529081906020820190565b91601954914381118015611628575b6115b55761156d8493611b54565b9261158f6115836018546001600160401b031690565b6001600160401b031690565b935b81156115c7575b5090919250156115b557610d53926115af91611b63565b1161153e565b60405163b0b4387760e01b8152600490fd5b826115e56115836115d784610362565b50546001600160401b031690565b111561160e575b6002811061160957848114611609576116049061278b565b611591565b611598565b94505060016116226115836115d787610362565b946115ec565b506003831061155f565b346102725760203660031901126102725761075961164e61025c565b611656611fad565b611f39565b34610272576000366003190112610272576020601954604051908152f35b634e487b7160e01b600052600060045260246000fd5b60e0906116e16001600160401b03808351166001600160401b0319601054161760105560208301511667ffffffffffffffff60401b6010549160401b169067ffffffffffffffff60401b191617601055565b60408101516011556060810151601255608081015160135560a081015160145560c08101516015550151601655565b634e487b7160e01b600052601160045260246000fd5b9061173d5760028160008093558260018201550155565b611679565b80511561039d5760200190565b80516001101561039d5760400190565b80516002101561039d5760600190565b80516003101561039d5760800190565b80516004101561039d5760a00190565b80516005101561039d5760c00190565b80516006101561039d5760e00190565b80516007101561039d576101000190565b805182101561039d5760209160051b010190565b601954600160401b8110156103d3578060016117f39201601955610362565b91909161173d57805182546020808401516fffffffffffffffffffffffffffffffff199092166001600160401b0393841617604092831b67ffffffffffffffff60401b16178555920151805160018501805467ffffffffffffffff191691909316179091556002910151910155565b9060195460006019558061189f575b5060005b825181101561189a578061189461188e600193866117c0565b516117d4565b01611875565b509050565b600390806003029060038204036119075760196000527f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c9695908101905b8181106118e9575050611871565b80611901849260026000918281558260018201550155565b016118db565b611710565b9060175460ff8160a01c169081611a7b575b50611a695781516001600160401b031661194961158361193c611b27565b516001600160401b031690565b6001600160401b0380921611801590611a32575b611a20577fa04a773924505a418564363725f56832f5772e6b8d0dbd6efce724dfe803dae6906119cf60408501936119958551611fe6565b6119a26060870151611fe6565b6119af6080870151611fe6565b6119bc60a0870151611fe6565b6119c960c0870151611fe6565b856124cb565b6119d88461168f565b6119e784824216834316612633565b611a0c60206119fd86516001600160401b031690565b9501516001600160401b031690565b9251604051908152928116931691602090a3565b60405163051c46ef60e01b8152600490fd5b5060208301516001600160401b031681611a606115836020611a52611b27565b01516001600160401b031690565b9116111561195d565b6040516301474c8f60e71b8152600490fd5b6001600160a01b031633141590503861191e565b60405190611a9c826103f3565b8160e06000918281528260208201528260408201528260608201528260808201528260a08201528260c08201520152565b60405190611ada826103f3565b816010546001600160401b0390818116835260401c16602082015260115460408201526012546060820152601354608082015260145460a082015260155460c082015260e0601654910152565b611b2f611a8f565b50611b38611acd565b90565b60405190611b48826103b8565b60006020838281520152565b60001981019190821161190757565b9190820391821161190757565b611b78611b3b565b5060195490611b8e611b8983611b54565b610362565b5090611ba86115836001809401546001600160401b031690565b811015611c2157611bc46115836018546001600160401b031690565b838110611be6575050506001611bdf611b89611b3893611b54565b50016104a7565b81611c0661158385611bf785610362565b5001546001600160401b031690565b11611c12578201611bc4565b611b389350611bdf9150610362565b604051631856a49960e21b8152600490fd5b929091600080516020612fed8339815191529283549460ff8660401c1615956001600160401b03811680159081611d34575b6001149081611d2a575b159081611d21575b50611d0f5767ffffffffffffffff1916600117909455611c9b9385611cea57611d3c565b611ca157565b600080516020612fed833981519152805460ff60401b19169055604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a1565b600080516020612fed833981519152805460ff60401b1916600160401b179055611d3c565b60405163f92ee8a960e01b8152600490fd5b90501538611c77565b303b159150611c6f565b889150611c65565b9192611d5290611d4a612ed8565b611656612ed8565b611d5a612ed8565b6001600160401b039081611d7584516001600160401b031690565b1615801590611ee2575b8015611ed6575b8015611eca575b8015611ebe575b8015611eb2575b611ea05761047893611e3b611e6992611e1d8660e0906001600160401b038151166009549067ffffffffffffffff60401b602084015160401b16916fffffffffffffffffffffffffffffffff191617176009556040810151600a556060810151600b556080810151600c5560a0810151600d5560c0810151600e550151600f55565b80516005556020810151600655604081015160075560600151600855565b611e448461168f565b6017805463ffffffff60a81b191660a89290921b63ffffffff60a81b16919091179055565b611e95611e7583611f01565b80600055611e9060e085015191611e8b83600155565b600255565b600355565b804216904316612633565b6040516350dd03f760e11b8152600490fd5b5060e083015115611d9b565b5060c083015115611d94565b5060a083015115611d8d565b50608083015115611d86565b50611efa61158360208501516001600160401b031690565b1515611d7f565b60808101519060c060a082015191015160405191602083019384526040830152606082015260608152611f33816103d8565b51902090565b6001600160a01b03908116908115611f9457600080516020612fad83398151915280546001600160a01b031981168417909155167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b604051631e4fbdf760e01b815260006004820152602490fd5b600080516020612fad833981519152546001600160a01b03163303611fce57565b60405163118cdaa760e01b8152336004820152602490fd5b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001111561200f57565b60405162461bcd60e51b815260206004820152601b60248201527f426e3235343a20696e76616c6964207363616c6172206669656c6400000000006044820152606490fd5b6040519061012082018281106001600160401b038211176103d35760405260088252610100366020840137565b90816020910312610272575180151581036102725790565b90815180825260208080930193019160005b8281106120b9575050505090565b8351855293810193928101926001016120ab565b610460906120e683825160208091805184520151910152565b60208181015180516040860152015160608401526040810151805160808501526020015160a08401526060810151805160c08501526020015160e0840152608081015190612144610100928386019060208091805184520151910152565b60a081015191612164610140938487019060208091805184520151910152565b60c082015192612184610180948588019060208091805184520151910152565b60e0830151916121a46101c0938489019060208091805184520151910152565b8301516121c1610200918289019060208091805184520151910152565b610120840151916121e261024093848a019060208091805184520151910152565b8401519261220061028094858a019060208091805184520151910152565b61223b610160860151966122246102c098898c019060208091805184520151910152565b86015180516103008b0152602001516103208a0152565b6101a08501516103408901528401516103608801526101e08401516103808801528301516103a08701526102208301516103c08701528201516103e08601526102608201516104008601528101516104208501526102a08101516104408501520151910152565b9392906124b7610478936104e0926124a86102606109609280518b52602081015160208c01526122e4604082015160408d019060208091805184520151910152565b6060810151805160808d01526020015160a08c01526080810151805160c08d01526020015160e08c01526124928b61233060a08401516101008093019060208091805184520151910152565b6124638d6103c060c0860151612356610140918285019060208091805184520151910152565b61243660e088015195612379610180978887019060208091805184520151910152565b8801516123966101c0918287019060208091805184520151910152565b6124076101208a0151936123ba610200958689019060208091805184520151910152565b8a0151976123d8610240998a89019060208091805184520151910152565b6101608b01518051610280890152602001516102a08801528a015180516102c0880152602001516102e0870152565b6101a0890151805161030087015260200151610320860152880151805161034086015260200151610360850152565b6101e08701518051610380850152602001516103a084015286015191019060208091805184520151910152565b61022083015180516104008f0152602001516104208e015282015180516104408e0152602001516104608d0152565b015180516104808b0152602001516104a08a0152565b806104c0890152870190612099565b9401906120cd565b6040513d6000823e3d90fd5b6020906124d66128a4565b60606124e0612054565b926001546124ed85611742565b5261250261158382516001600160401b031690565b61250b8561174f565b52612522611583868301516001600160401b031690565b61252b8561175f565b52604081015161253a8561176f565b5201516125468361177f565b526013546125538361178f565b526014546125608361179f565b5260155461256d836117af565b5261258c6040519485938493630c76545d60e21b8552600485016122a2565b038173__$5c5c07cf4f55be9472c2b47d897172e765$__5af49081156125fd576000916125ce575b50156125bc57565b6040516309bde33960e01b8152600490fd5b6125f0915060203d6020116125f6575b6125e8818361042a565b810190612081565b386125b4565b503d6125de565b6124bf565b6001600160401b03918216908216039190821161190757565b6001600160401b038091169081146119075760010190565b90916126a2610478936019548015159081612708575b506126ac575b604061266560208501516001600160401b031690565b93015161268261267361046b565b6001600160401b039095168552565b602084015261269261267361047a565b6001600160401b03166020840152565b60408201526117d4565b6126ca6126c4611b896018546001600160401b031690565b90611726565b6127036126e76126e26018546001600160401b031690565b61261b565b6001600160401b03166001600160401b03196018541617601855565b61264f565b61274b915061271c611b8961272d92611b54565b505460401c6001600160401b031690565b61274561271c611b896018546001600160401b031690565b90612602565b6001600160401b0361277261276960175463ffffffff9060a81c1690565b63ffffffff1690565b9116101538612649565b90816020910312610272575190565b8015611907576000190190565b6127a0610487565b9060008252600060208301526127b4611b3b565b60408301526127c1611b3b565b60608301526127ce611b3b565b60808301526127db611b3b565b60a08301526127e8611b3b565b60c08301526127f5611b3b565b60e0830152612802611b3b565b610100830152612810611b3b565b61012083015261281e611b3b565b61014083015261282c611b3b565b61016083015261283a611b3b565b610180830152612848611b3b565b6101a0830152612856611b3b565b6101c0830152612864611b3b565b6101e0830152612872611b3b565b610200830152612880611b3b565b61022083015261288e611b3b565b61024083015261289c611b3b565b610260830152565b6128ac612798565b906201000082527f08e80a5c8e4c9b9f26f3003cc59403a18d3136afd030868d25cc8b807e2ab37060206008818501527f16b88dc7439a6d841e1a1103f5a3d2d2440137f18d02763503bac7b45dcb983b81604086017f013d1d4b425179258b577860397955cbfa0816e32b1c25a1fd734c91b951ee818151525101527f169ba15107f2eff9b9341bf30742a838d27dbd69e88b2353dca8592f15f1111c81606086017f0c3c864f195f59119927f53857f1de8bf575941748b735351fd31373c7875c2d8151525101527f0326ff06391ed5d26ec1bc080b8d46014ee22c0c68ed022f1620c4d9d38437d381608086017f11d4ceb15961d10b6156ae3d09bb78b4df45fb8543060884e7d400755beb4ac88151525101527e1379342a4d77d4708743aff01ff27aa11917478fdc8e2b7d463081735772ea8160a086017f23610cb43e21033c368a93622dd405b905a0eb344c98b9d7cf08b0c5ebf7c8398151525101527f25280b124624911c7f87b4c2d87f59c6c07e3eeeb10d614da216f6219ffe50b68160c086017f194daf85d9eed9937b28e2a680fcc5a76922c15cd31dc4f600e14939b8200ce78151525101527f1bae9f36e6190738c711501be53f299bf61348e61e2ef9d577760e64f629368d8160e086017f04882ef39899ea38c9677a48b8f8cc6a67284e17ff940289faaa359eec9b33a68151525101527f0b25394da5a1d435daccc2eadd039e2c2709f5f42fabd9afba815ed62d6af36b8161010086017f2d810d30120cb93e1a254b89ed0ae86c761f49b4f129459cd534f9551851350f8151525101527f1a0255ec8c7c8769335bc9dc6b222ac6a04e766d08b45c8cc573592c05bc9c148161012086017f1c2ce7be570bea9e43f3d3d7cbca84bdb4fc89b53ae657531de72670a6105e088151525101527f272eb7d633cedb68ce0113f4420ab5610b81b8ba1ab9348db15761d40e8df5ba8161014086017f1c164159136b8f5b4773e133f483a8a192ab15d6d3ee012f171b3d02fd4506e78151525101527f033e195a9ea3a9ce40b72b673afb45444ca1b15f0543f44d10f5c640a780676f8161016086017f0e446639aa6caf25e93ef747084e39b8ea90abf23bb48c28fd5f9ba7ba6550228151525101527f0f4c69895451af15052aa81a03eba9752c9e7891dd08e264e0bd593d0357858e8161018086017f0e8db2b2893df23d3c55f0b3a3b54ab2e2ed775b31c4c90e472eb31582582df28151525101527f1f4dcf4dd484e3ab1ae487603d2245397ac78fe6ca7584645eba3926d383902b816101a086017f2bc091fefe2416ec83c6fba8fb82fb48cb9ca00182ec792c212bf5532958c8f78151525101527f19eb12a7827c0ddf6383fe806c3953bd06b08aae7bf2a01f55c986a84f50cc28816101c086017f2daf78c5a2829a9418081dd7e8743a683ed6817996f75f10009d99220793ec738151525101527f1ffd789b155b8acb13e0f6a48b50f7aa8092540888d009141057d45690915824816101e086017f015691308846e68ea856a2cb24c9903f0c8605dea190829180ff6bdd1c6508038151525101527f16b7f250842ecf4e3690706a1e152d7a57f70f556f92076da785fdd363c19fcf8161020086017f0545ac7aa66dcf3719988438c806fc624de57ab43f8580392f88c86c1378ce4a8151525101527f149f415744707468bdaa4e8545201ab40d1931a7d31f23768fa7c65574ee3eab8161022086017f20cb7ff35a83a7dc314036e470f14c30fb0e98d35d663b243b222caa6fc7db448151525101527f0a521ff30c8f3666798f847c5d4c379658fba10156e7a9499f2713fae9bf2be18161024086017f0a25c1b7573906dc4e193b4ea82fd1fe7ccebc4d925dad26f0ff09c84c9f1a7581515251015261026084017f03db6510c3f13629fded9a5a2d41654bbce4ef6d024cad53100051d4a3f3ebc9815152510152565b90813b15612eb757600080516020612fcd83398151915280546001600160a01b0319166001600160a01b0384169081179091557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2805115612e9c57612e9991612f07565b50565b505034612ea557565b60405163b398979f60e01b8152600490fd5b604051634c9c8ce360e01b81526001600160a01b0383166004820152602490fd5b60ff600080516020612fed8339815191525460401c1615612ef557565b604051631afcd79f60e31b8152600490fd5b600080611b3893602081519101845af43d15612f45573d91612f2883610d57565b92612f36604051948561042a565b83523d6000602085013e612f49565b6060915b90612f705750805115612f5e57805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580612fa3575b612f81575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b15612f7956fe9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a164736f6c6343000817000a" +"0x60a034620004be576001600160401b0390601f6200328c38819003918201601f191683019184831184841017620004115780849260409485528339810103916101008312620004be5760608312620004be578151936200005f85620004c3565b6200006a82620004df565b85526020906200007c828401620004df565b95828101968752848401519085810191825260808097605f190112620004be578551948786018681108582111762000411578752606081015186528781015198858701998a5260a08201519288880193845260e060c08401519360608a0194855201519363ffffffff918286168603620004be57308c527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054808d1c60ff16620004ad57808a80809316036200046d575b50825116158015915062000460575b801562000456575b80156200044c575b801562000442575b801562000438575b620004275787905116906009549568010000000000000000600160801b039d8e8d8751901b16808560018060801b0319809b16171760095589519182600a558d5160055551938460065551978860075551948560085589600b54161717600b55600c55600d549063ffffffff60a81b9060a81b169063ffffffff60a81b1916179182600d558b51958a87019283528c8701526060860152606085528b85019480861089871117620004115788958c52519020600099818b55519081600155600255600355600f54918215159283620003a2575b5050506200032a575b5116915186519287840184811086821117620003165788528352848301528551976200026589620004c3565b8343168952848901918442168352878a01938452600f54680100000000000000008110156200031657806001620002a09201600f55620004f4565b9790976200030257508460029798999a51169088549260018060401b03199483868616178b55518b1b169216171786556001860191519283511690825416179055015191015551612d6191826200052b833951818181610c600152610db80152f35b634e487b7160e01b81526004819052602490fd5b634e487b7160e01b88526041600452602488fd5b906200033a90600e5416620004f4565b6200038e57600281888093558260018201550155600e548481168581146200037a5760010185166001600160401b03199190911617600e55839062000239565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b87526004879052602487fd5b9193945091506000198101908111620003fd57620003c18791620004f4565b50548a1c1686620003d681600e5416620004f4565b50548b1c16900391868311620003fd5786939291849160a81c169116101538808062000230565b634e487b7160e01b89526011600452602489fd5b634e487b7160e01b600052604160045260246000fd5b8a516350dd03f760e11b8152600490fd5b508951156200015d565b5084511562000155565b508151156200014d565b508c511562000145565b508784511615156200013d565b6001600160401b0319161790558a518881527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2908a90a13888816200012e565b8c5163f92ee8a960e01b8152600490fd5b600080fd5b606081019081106001600160401b038211176200041157604052565b51906001600160401b0382168203620004be57565b600f548110156200051457600f6000526003602060002091020190600090565b634e487b7160e01b600052603260045260246000fdfe6080604052600436101561001257600080fd5b60003560e01c8063013fa5fc1461025757806302b592f3146102525780630c693a221461024d5780630d8e6e2c146102485780632063d4f7146102435780632d52aad61461023e5780632f5f4600146102395780632f79889d14610234578063313df7b11461022f578063382b215a1461022a5780634847ae5d146102255780634f1ef2861461022057806352d1902d1461021b578063628277331461021657806369cc6a04146102115780636f96bdae1461020c578063715018a61461020757806376b6b7cb146102025780637f17baad146101fd57806382d07ff3146101f85780638584d23f146101f35780638da5cb5b146101ee57806396c1ca61146101e95780639baa3cc9146101e45780639fdb54a7146101df578063a9a9c9f5146101da578063ad3cb1cc146101d5578063b5adea3c146101d0578063bd32519a146101cb578063c23b9e9e146101c6578063c8e5e498146101c1578063ca6fe855146101bc578063d24d933d146101b7578063e0303301146101b2578063f2fde38b146101ad5763f9e50d19146101a857600080fd5b61161d565b6115f4565b6114c4565b611489565b61146b565b61144e565b611427565b611401565b6113a8565b61132b565b6112f4565b6112b9565b61116c565b6110e7565b6110b1565b611074565b61101d565b610fbf565b610f7b565b610f10565b610ec5565b610e2e565b610e10565b610da5565b610be6565b610b4a565b610b2c565b610b03565b610adc565b6109f2565b6109b5565b61085d565b6105ad565b61052d565b6104b7565b61028e565b600435906001600160a01b038216820361027257565b600080fd5b61010435906001600160a01b038216820361027257565b34610272576020366003190112610272576102a761025c565b6102af611d2b565b6001600160a01b0390811690811561033f57600d54908116821461032d5760ff60a01b19919091166001600160a81b03199190911617600160a01b17600d8190556040516001600160a01b0390911681527f8017bb887fdf8fca4314a9d40f6e73b3b81002d67e5cfa85d88173af6aa460729080602081015b0390a1005b60405163a863aec960e01b8152600490fd5b60405163e6c4247b60e01b8152600490fd5b634e487b7160e01b600052603260045260246000fd5b600f548110156103a257600390600f600052027f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac8020190600090565b610351565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b038211176103d857604052565b6103a7565b608081019081106001600160401b038211176103d857604052565b606081019081106001600160401b038211176103d857604052565b90601f801991011681019081106001600160401b038211176103d857604052565b604051906102e082018281106001600160401b038211176103d857604052565b60405190610461826103bd565b565b60405190610461826103f8565b6040519061028082018281106001600160401b038211176103d857604052565b9060405161049d816103bd565b6020600182946001600160401b0381541684520154910152565b3461027257602036600319011261027257600435600f54811015610272576104e0608091610367565b5061052b8154916104fb60016001600160401b039201610490565b9060405193818116855260401c1660208401526040830190602080916001600160401b0381511684520151910152565bf35b34610272576000806003193601126105aa5760809060409060608251610552816103dd565b82815282602082015282848201520152805161056d816103dd565b6005549182825260065460208301908152600754908284019182526060600854940193845282519485525160208501525190830152516060820152f35b80fd5b34610272576000366003190112610272576060604051600181526000602082015260006040820152f35b35906001600160401b038216820361027257565b60609060031901126102725760405190610604826103f8565b816001600160401b03600435818116810361027257825260243590811681036102725760208201526040604435910152565b6040906063190112610272576040519061064f826103bd565b60643582526084356020830152565b60409060a31901126102725760405190610677826103bd565b60a435825260c4356020830152565b60409060e3190112610272576040519061069f826103bd565b60e4358252610104356020830152565b60409061012319011261027257604051906106c9826103bd565b610124358252610144356020830152565b60409061016319011261027257604051906106f4826103bd565b610164358252610184356020830152565b6040906101a3190112610272576040519061071f826103bd565b6101a43582526101c4356020830152565b6040906101e3190112610272576040519061074a826103bd565b6101e4358252610204356020830152565b6040906102231901126102725760405190610775826103bd565b610224358252610244356020830152565b60409061026319011261027257604051906107a0826103bd565b610264358252610284356020830152565b6040906102a319011261027257604051906107cb826103bd565b6102a43582526102c4356020830152565b6040906102e319011261027257604051906107f6826103bd565b6102e4358252610304356020830152565b6040906103231901126102725760405190610821826103bd565b610324358252610344356020830152565b604090610363190112610272576040519061084c826103bd565b610364358252610384356020830152565b34610272576104e036600319011261027257610878366105eb565b610480366063190112610272576109b390610891610434565b9061089b36610636565b82526108a63661065e565b60208301526108b436610686565b60408301526108c2366106af565b60608301526108d0366106da565b60808301526108de36610705565b60a08301526108ec36610730565b60c08301526108fa3661075b565b60e083015261090836610786565b610100830152610917366107b1565b610120830152610926366107dc565b61014083015261093536610807565b61016083015261094436610832565b6101808301526103a4356101a08301526103c4356101c08301526103e4356101e083015261040435610200830152610424356102208301526104443561024083015261046435610260830152610484356102808301526104a4356102a08301526104c4356102c083015261168e565b005b34610272576020366003190112610272576010805460ff19166001179055600435601155005b6001600160401b0381116103d85760051b60200190565b346102725760208060031936011261027257600435906001600160401b038211610272573660238301121561027257816004013591610a30836109db565b91604093610a4085519485610413565b80845260248285019160071b8401019236841161027257602401905b838210610a6c576109b3856118ee565b813603608081126102725786805191610a84836103f8565b610a8d856105d7565b8352610a9a8686016105d7565b83870152603f1901126102725760809184918851610ab7816103bd565b610ac28a87016105d7565b815260608601358482015289820152815201910190610a5c565b346102725760003660031901126102725760206001600160401b03600e5416604051908152f35b3461027257600036600319011261027257600d546040516001600160a01b039091168152602090f35b34610272576000366003190112610272576020600254604051908152f35b3461027257600036600319011261027257610b63611998565b50610bc7604051610b73816103f8565b6009546001600160401b0390818116835260401c166020820152600a5460408201526040519182918291909160408060608301946001600160401b0380825116855260208201511660208501520151910152565b0390f35b6001600160401b0381116103d857601f01601f191660200190565b60408060031936011261027257610bfb61025c565b6024356001600160401b038111610272573660238201121561027257806004013590610c2682610bcb565b91610c3385519384610413565b80835260209136602483830101116102725781600092602485930183870137840101526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116308114908115610d89575b50610d78579080600492610c9e611d2b565b7ff78721226efe9a1bb678189a16d1554928b9f2192e2cb93eeda83b79fa40007d82885192881692838152a186516352d1902d60e01b815293849182905afa918291600093610d49575b5050610d0e578351634c9c8ce360e01b81526001600160a01b0384166004820152602490fd5b600080516020612d158339815191528193929303610d30576109b38383612b79565b8351632a87526960e21b81526004810191909152602490fd5b610d69929350803d10610d71575b610d618183610413565b8101906124c4565b903880610ce8565b503d610d57565b845163703e46dd60e11b8152600490fd5b905081600080516020612d158339815191525416141538610c8c565b34610272576000366003190112610272577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163003610dfe576020604051600080516020612d158339815191528152f35b60405163703e46dd60e11b8152600490fd5b34610272576000366003190112610272576020600154604051908152f35b34610272576000806003193601126105aa57610e48611d2b565b600d5460ff8160a01c1660001461032d576001600160a81b031916600d557f9a5f57de856dd668c54dd95e5c55df93432171cbca49a8776d5620ea59c024508180a180f35b60809060631901126102725760405190610ea6826103dd565b6064358252608435602083015260a435604083015260c4356060830152565b34610272576080366003190112610272576020610f08604051610ee7816103dd565b600435815260243583820152604435604082015260643560608201526119e9565b604051908152f35b34610272576000806003193601126105aa57610f2a611d2b565b600080516020612cf583398151915280546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b34610272576000366003190112610272576020600054604051908152f35b6004359063ffffffff8216820361027257565b60e4359063ffffffff8216820361027257565b346102725760203660031901126102725763ffffffff610fdd610f99565b16600090815260046020908152604091829020805460019091015483516001600160401b03808416825292851c9092169282019290925291820152606090f35b3461027257600036600319011261027257611036611998565b50610bc76110426119b7565b6040519182918291909160408060608301946001600160401b0380825116855260208201511660208501520151910152565b34610272576020366003190112610272576040611092600435611a6a565b61052b82518092602080916001600160401b0381511684520151910152565b3461027257600036600319011261027257600080516020612cf5833981519152546040516001600160a01b039091168152602090f35b3461027257602036600319011261027257611100610f99565b611108611d2b565b63ffffffff808216610e10811091821561115a575b505061114857600d805463ffffffff60a81b191660a89290921b63ffffffff60a81b16919091179055005b6040516307a5077760e51b8152600490fd5b600d5460a81c1610159050388061111d565b346102725761012036600319011261027257611187366105eb565b61119036610e8d565b90611199610fac565b6111a1610277565b90600080516020612d3583398151915254936001600160401b0360ff8660401c16159516801590816112b1575b60011490816112a7575b15908161129e575b5061128c57600080516020612d35833981519152805467ffffffffffffffff19166001179055611214938561126757611b2d565b61121a57005b600080516020612d35833981519152805460ff60401b19169055604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2908060208101610328565b600080516020612d35833981519152805460ff60401b1916600160401b179055611b2d565b60405163f92ee8a960e01b8152600490fd5b905015386111e0565b303b1591506111d8565b8691506111ce565b3461027257600036600319011261027257600b54600c54604080516001600160401b03808516825293821c9093166020840152820152606090f35b3461027257600036600319011261027257608060055460065460075460085491604051938452602084015260408301526060820152f35b3461027257600036600319011261027257604080519061134a826103bd565b60058252602090640352e302e360dc1b6020840152604051916020835283519182602085015260005b8381106113955784604081866000838284010152601f80199101168101030190f35b8581018301518582018301528201611373565b346102725760603660031901126102725760406113c4366105eb565b6001600160401b03815116600b549067ffffffffffffffff60401b6020840151851b16916001600160801b0319161717600b550151600c55600080f35b3461027257600036600319011261027257602060ff600d5460a01c166040519015158152f35b3461027257600036600319011261027257602063ffffffff600d5460a81c16604051908152f35b34610272576000366003190112610272576010805460ff19169055005b34610272576000366003190112610272576020600354604051908152f35b3461027257600036600319011261027257600954600a54604080516001600160401b03808516825293821c9093166020840152820152606090f35b34610272576040366003190112610272576004356024359060ff601054166000906000146115125750906114fe610bc79260115490611a5d565b115b60405190151581529081906020820190565b91600f549143811180156115ea575b6115775761152f8493611a4e565b92611551611545600e546001600160401b031690565b6001600160401b031690565b935b8115611589575b50909192501561157757610bc79261157191611a5d565b11611500565b60405163b0b4387760e01b8152600490fd5b826115a761154561159984610367565b50546001600160401b031690565b11156115d0575b600281106115cb578481146115cb576115c6906124d3565b611553565b61155a565b94505060016115e461154561159987610367565b946115ae565b5060038310611521565b34610272576020366003190112610272576109b361161061025c565b611618611d2b565b611cb7565b34610272576000366003190112610272576020600f54604051908152f35b634e487b7160e01b600052600060045260246000fd5b6040906001600160401b03815116600b549067ffffffffffffffff60401b6020840151851b16916001600160801b0319161717600b550151600c55565b90600d5460ff8160a01c1690816117c9575b506117b75781516001600160401b03166116cb6115456116be611a21565b516001600160401b031690565b6001600160401b0380921611801590611780575b61176e577fa04a773924505a418564363725f56832f5772e6b8d0dbd6efce724dfe803dae69061171d60408501936117178551611d64565b85612249565b61172684611651565b6117358482421683431661237b565b61175a602061174b86516001600160401b031690565b9501516001600160401b031690565b9251604051908152928116931691602090a3565b60405163051c46ef60e01b8152600490fd5b5060208301516001600160401b0316816117ae61154560206117a0611a21565b01516001600160401b031690565b911611156116df565b6040516301474c8f60e71b8152600490fd5b6001600160a01b03163314159050386116a0565b634e487b7160e01b600052601160045260246000fd5b9061180a5760028160008093558260018201550155565b61163b565b8051156103a25760200190565b8051600110156103a25760400190565b8051600210156103a25760600190565b8051600310156103a25760800190565b80518210156103a25760209160051b010190565b600f54600160401b8110156103d85780600161187f9201600f55610367565b91909161180a57805182546020808401516fffffffffffffffffffffffffffffffff199092166001600160401b0393841617604092831b67ffffffffffffffff60401b16178555920151805160018501805467ffffffffffffffff191691909316179091556002910151910155565b90600f546000600f558061192b575b5060005b8251811015611926578061192061191a6001938661184c565b51611860565b01611901565b509050565b6003908060030290600382040361199357600f6000527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802908101905b8181106119755750506118fd565b8061198d849260026000918281558260018201550155565b01611967565b6117dd565b604051906119a5826103f8565b60006040838281528260208201520152565b604051906119c4826103f8565b81600b546001600160401b0390818116835260401c1660208201526040600c54910152565b6020810151906060604082015191015160405191602083019384526040830152606082015260608152611a1b816103dd565b51902090565b611a29611998565b50611a326119b7565b90565b60405190611a42826103bd565b60006020838281520152565b60001981019190821161199357565b9190820391821161199357565b611a72611a35565b50600f5490611a88611a8383611a4e565b610367565b5090611aa26115456001809401546001600160401b031690565b811015611b1b57611abe611545600e546001600160401b031690565b838110611ae0575050506001611ad9611a83611a3293611a4e565b5001610490565b81611b0061154585611af185610367565b5001546001600160401b031690565b11611b0c578201611abe565b611a329350611ad99150610367565b604051631856a49960e21b8152600490fd5b919092611b4490611b3c612c20565b611618612c20565b611b4c612c20565b6001600160401b039081611b6784516001600160401b031690565b1615801590611c98575b8015611c8c575b8015611c80575b8015611c74575b8015611c6b575b611c595761046193611c28611c4e92611bdd866040906001600160401b038151166009549067ffffffffffffffff60401b6020840151851b16916001600160801b03191617176009550151600a55565b8251600555602083015160065560408301516007556060830151600855611c0386611651565b600d805463ffffffff60a81b191660a89290921b63ffffffff60a81b16919091179055565b611c49611c34826119e9565b91826000555191611c4483600155565b600255565b600355565b80421690431661237b565b6040516350dd03f760e11b8152600490fd5b50835115611b8d565b50606084015115611b86565b50604084015115611b7f565b50602084015115611b78565b50611cb061154560208501516001600160401b031690565b1515611b71565b6001600160a01b03908116908115611d1257600080516020612cf583398151915280546001600160a01b031981168417909155167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b604051631e4fbdf760e01b815260006004820152602490fd5b600080516020612cf5833981519152546001600160a01b03163303611d4c57565b60405163118cdaa760e01b8152336004820152602490fd5b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000011115611d8d57565b60405162461bcd60e51b815260206004820152601b60248201527f426e3235343a20696e76616c6964207363616c6172206669656c6400000000006044820152606490fd5b6040519061012082018281106001600160401b038211176103d85760405260088252610100366020840137565b90816020910312610272575180151581036102725790565b90815180825260208080930193019160005b828110611e37575050505090565b835185529381019392810192600101611e29565b61046090611e6483825160208091805184520151910152565b60208181015180516040860152015160608401526040810151805160808501526020015160a08401526060810151805160c08501526020015160e0840152608081015190611ec2610100928386019060208091805184520151910152565b60a081015191611ee2610140938487019060208091805184520151910152565b60c082015192611f02610180948588019060208091805184520151910152565b60e083015191611f226101c0938489019060208091805184520151910152565b830151611f3f610200918289019060208091805184520151910152565b61012084015191611f6061024093848a019060208091805184520151910152565b84015192611f7e61028094858a019060208091805184520151910152565b611fb961016086015196611fa26102c098898c019060208091805184520151910152565b86015180516103008b0152602001516103208a0152565b6101a08501516103408901528401516103608801526101e08401516103808801528301516103a08701526102208301516103c08701528201516103e08601526102608201516104008601528101516104208501526102a08101516104408501520151910152565b939290612235610461936104e0926122266102606109609280518b52602081015160208c0152612062604082015160408d019060208091805184520151910152565b6060810151805160808d01526020015160a08c01526080810151805160c08d01526020015160e08c01526122108b6120ae60a08401516101008093019060208091805184520151910152565b6121e18d6103c060c08601516120d4610140918285019060208091805184520151910152565b6121b460e0880151956120f7610180978887019060208091805184520151910152565b8801516121146101c0918287019060208091805184520151910152565b6121856101208a015193612138610200958689019060208091805184520151910152565b8a015197612156610240998a89019060208091805184520151910152565b6101608b01518051610280890152602001516102a08801528a015180516102c0880152602001516102e0870152565b6101a0890151805161030087015260200151610320860152880151805161034086015260200151610360850152565b6101e08701518051610380850152602001516103a084015286015191019060208091805184520151910152565b61022083015180516104008f0152602001516104208e015282015180516104408e0152602001516104608d0152565b015180516104808b0152602001516104a08a0152565b806104c0890152870190611e17565b940190611e4b565b6040513d6000823e3d90fd5b6020906122546125ec565b604061225e611dd2565b9260015461226b8561180f565b5261228061154582516001600160401b031690565b6122898561181c565b526122a0611545868301516001600160401b031690565b6122a98561182c565b5201516122b58361183c565b526122d46040519485938493630c76545d60e21b855260048501612020565b038173__$5c5c07cf4f55be9472c2b47d897172e765$__5af490811561234557600091612316575b501561230457565b6040516309bde33960e01b8152600490fd5b612338915060203d60201161233e575b6123308183610413565b810190611dff565b386122fc565b503d612326565b61223d565b6001600160401b03918216908216039190821161199357565b6001600160401b038091169081146119935760010190565b90916123ea61046193600f548015159081612450575b506123f4575b60406123ad60208501516001600160401b031690565b9301516123ca6123bb610454565b6001600160401b039095168552565b60208401526123da6123bb610463565b6001600160401b03166020840152565b6040820152611860565b61241261240c611a83600e546001600160401b031690565b906117f3565b61244b61242f61242a600e546001600160401b031690565b612363565b6001600160401b03166001600160401b0319600e541617600e55565b612397565b6124939150612464611a8361247592611a4e565b505460401c6001600160401b031690565b61248d612464611a83600e546001600160401b031690565b9061234a565b6001600160401b036124ba6124b1600d5463ffffffff9060a81c1690565b63ffffffff1690565b9116101538612391565b90816020910312610272575190565b8015611993576000190190565b6124e8610470565b9060008252600060208301526124fc611a35565b6040830152612509611a35565b6060830152612516611a35565b6080830152612523611a35565b60a0830152612530611a35565b60c083015261253d611a35565b60e083015261254a611a35565b610100830152612558611a35565b610120830152612566611a35565b610140830152612574611a35565b610160830152612582611a35565b610180830152612590611a35565b6101a083015261259e611a35565b6101c08301526125ac611a35565b6101e08301526125ba611a35565b6102008301526125c8611a35565b6102208301526125d6611a35565b6102408301526125e4611a35565b610260830152565b6125f46124e0565b906201000082527f08e80a5c8e4c9b9f26f3003cc59403a18d3136afd030868d25cc8b807e2ab37060206008818501527f16b88dc7439a6d841e1a1103f5a3d2d2440137f18d02763503bac7b45dcb983b81604086017f013d1d4b425179258b577860397955cbfa0816e32b1c25a1fd734c91b951ee818151525101527f169ba15107f2eff9b9341bf30742a838d27dbd69e88b2353dca8592f15f1111c81606086017f0c3c864f195f59119927f53857f1de8bf575941748b735351fd31373c7875c2d8151525101527f0326ff06391ed5d26ec1bc080b8d46014ee22c0c68ed022f1620c4d9d38437d381608086017f11d4ceb15961d10b6156ae3d09bb78b4df45fb8543060884e7d400755beb4ac88151525101527e1379342a4d77d4708743aff01ff27aa11917478fdc8e2b7d463081735772ea8160a086017f23610cb43e21033c368a93622dd405b905a0eb344c98b9d7cf08b0c5ebf7c8398151525101527f25280b124624911c7f87b4c2d87f59c6c07e3eeeb10d614da216f6219ffe50b68160c086017f194daf85d9eed9937b28e2a680fcc5a76922c15cd31dc4f600e14939b8200ce78151525101527f1bae9f36e6190738c711501be53f299bf61348e61e2ef9d577760e64f629368d8160e086017f04882ef39899ea38c9677a48b8f8cc6a67284e17ff940289faaa359eec9b33a68151525101527f0b25394da5a1d435daccc2eadd039e2c2709f5f42fabd9afba815ed62d6af36b8161010086017f2d810d30120cb93e1a254b89ed0ae86c761f49b4f129459cd534f9551851350f8151525101527f1a0255ec8c7c8769335bc9dc6b222ac6a04e766d08b45c8cc573592c05bc9c148161012086017f1c2ce7be570bea9e43f3d3d7cbca84bdb4fc89b53ae657531de72670a6105e088151525101527f272eb7d633cedb68ce0113f4420ab5610b81b8ba1ab9348db15761d40e8df5ba8161014086017f1c164159136b8f5b4773e133f483a8a192ab15d6d3ee012f171b3d02fd4506e78151525101527f033e195a9ea3a9ce40b72b673afb45444ca1b15f0543f44d10f5c640a780676f8161016086017f0e446639aa6caf25e93ef747084e39b8ea90abf23bb48c28fd5f9ba7ba6550228151525101527f0f4c69895451af15052aa81a03eba9752c9e7891dd08e264e0bd593d0357858e8161018086017f0e8db2b2893df23d3c55f0b3a3b54ab2e2ed775b31c4c90e472eb31582582df28151525101527f1f4dcf4dd484e3ab1ae487603d2245397ac78fe6ca7584645eba3926d383902b816101a086017f2bc091fefe2416ec83c6fba8fb82fb48cb9ca00182ec792c212bf5532958c8f78151525101527f19eb12a7827c0ddf6383fe806c3953bd06b08aae7bf2a01f55c986a84f50cc28816101c086017f2daf78c5a2829a9418081dd7e8743a683ed6817996f75f10009d99220793ec738151525101527f1ffd789b155b8acb13e0f6a48b50f7aa8092540888d009141057d45690915824816101e086017f015691308846e68ea856a2cb24c9903f0c8605dea190829180ff6bdd1c6508038151525101527f16b7f250842ecf4e3690706a1e152d7a57f70f556f92076da785fdd363c19fcf8161020086017f0545ac7aa66dcf3719988438c806fc624de57ab43f8580392f88c86c1378ce4a8151525101527f149f415744707468bdaa4e8545201ab40d1931a7d31f23768fa7c65574ee3eab8161022086017f20cb7ff35a83a7dc314036e470f14c30fb0e98d35d663b243b222caa6fc7db448151525101527f0a521ff30c8f3666798f847c5d4c379658fba10156e7a9499f2713fae9bf2be18161024086017f0a25c1b7573906dc4e193b4ea82fd1fe7ccebc4d925dad26f0ff09c84c9f1a7581515251015261026084017f03db6510c3f13629fded9a5a2d41654bbce4ef6d024cad53100051d4a3f3ebc9815152510152565b90813b15612bff57600080516020612d1583398151915280546001600160a01b0319166001600160a01b0384169081179091557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2805115612be457612be191612c4f565b50565b505034612bed57565b60405163b398979f60e01b8152600490fd5b604051634c9c8ce360e01b81526001600160a01b0383166004820152602490fd5b60ff600080516020612d358339815191525460401c1615612c3d57565b604051631afcd79f60e31b8152600490fd5b600080611a3293602081519101845af43d15612c8d573d91612c7083610bcb565b92612c7e6040519485610413565b83523d6000602085013e612c91565b6060915b90612cb85750805115612ca657805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580612ceb575b612cc9575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b15612cc156fe9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a164736f6c6343000817000a" diff --git a/contract-bindings/artifacts/LightClient_bytecode.json b/contract-bindings/artifacts/LightClient_bytecode.json index 5c16e2b88..c3f5f758a 100644 --- a/contract-bindings/artifacts/LightClient_bytecode.json +++ b/contract-bindings/artifacts/LightClient_bytecode.json @@ -1 +1 @@ -"0x60a080604052346100cd57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a009081549060ff8260401c166100be57506001600160401b036002600160401b031982821601610079575b604051612d1f9081620000d38239608051818181610b960152610cee0152f35b6001600160401b031990911681179091556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a1388080610059565b63f92ee8a960e01b8152600490fd5b600080fdfe6080604052600436101561001257600080fd5b60003560e01c8063013fa5fc1461021757806302b592f3146102125780630c693a221461020d5780630d8e6e2c146102085780632f79889d14610203578063313df7b1146101fe578063382b215a146101f9578063409939b7146101f45780634847ae5d146101ef5780634f1ef286146101ea57806352d1902d146101e557806362827733146101e057806369cc6a04146101db578063715018a6146101d657806376b6b7cb146101d15780637f17baad146101cc57806382d07ff3146101c75780638584d23f146101c25780638da5cb5b146101bd5780638ed3e045146101b857806396c1ca61146101b35780639fdb54a7146101ae578063a9a9c9f5146101a9578063aa922732146101a4578063ad3cb1cc1461019f578063bd32519a1461019a578063c23b9e9e14610195578063ca6fe85514610190578063d24d933d1461018b578063e030330114610186578063f2fde38b146101815763f9e50d191461017c57600080fd5b6113bd565b611394565b61128f565b611247565b611229565b611202565b6111dc565b61115f565b611132565b6110fb565b6110b3565b61102e565b610fb5565b610f7f565b610f42565b610f11565b610ea1565b610e2e565b610dc3565b610d64565b610d46565b610cdb565b610b1c565b610a7e565b6108c7565b6105f5565b6105cc565b6105a5565b61057b565b6104fb565b610485565b61024e565b600435906001600160a01b038216820361023257565b600080fd5b6101a435906001600160a01b038216820361023257565b346102325760203660031901126102325761026761021c565b61026f611b01565b6001600160a01b039081169081156102fa5760175490811682146102e85760ff60a01b19919091166001600160a81b03199190911617600160a01b1760178190556040516001600160a01b0390911681527f8017bb887fdf8fca4314a9d40f6e73b3b81002d67e5cfa85d88173af6aa4607290602090a1005b60405163a863aec960e01b8152600490fd5b60405163e6c4247b60e01b8152600490fd5b634e487b7160e01b600052603260045260246000fd5b60195481101561035d576003906019600052027f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c96950190600090565b61030c565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b0382111761039357604052565b610362565b608081019081106001600160401b0382111761039357604052565b61010081019081106001600160401b0382111761039357604052565b90601f801991011681019081106001600160401b0382111761039357604052565b604051906102e082018281106001600160401b0382111761039357604052565b6040519061041d82610378565b565b60405190606082018281106001600160401b0382111761039357604052565b6040519061028082018281106001600160401b0382111761039357604052565b9060405161046b81610378565b6020600182946001600160401b0381541684520154910152565b3461023257602036600319011261023257600435601954811015610232576104ae608091610322565b506104f98154916104c960016001600160401b03920161045e565b9060405193818116855260401c1660208401526040830190602080916001600160401b0381511684520151910152565bf35b3461023257600080600319360112610578576080906040906060825161052081610398565b82815282602082015282848201520152805161053b81610398565b6005549182825260065460208301908152600754908284019182526060600854940193845282519485525160208501525190830152516060820152f35b80fd5b34610232576000366003190112610232576060604051600181526000602082015260006040820152f35b346102325760003660031901126102325760206001600160401b0360185416604051908152f35b34610232576000366003190112610232576017546040516001600160a01b039091168152602090f35b34610232576000366003190112610232576020600254604051908152f35b602435906001600160401b038216820361023257565b6101009060031901126102325760405190610643826103b3565b816004356001600160401b0381168103610232578152610661610613565b602082015260443560408201526064356060820152608435608082015260a43560a082015260c43560c082015260e060e435910152565b60409061010319011261023257604051906106b282610378565b610104358252610124356020830152565b60409061014319011261023257604051906106dd82610378565b610144358252610164356020830152565b604090610183190112610232576040519061070882610378565b6101843582526101a4356020830152565b6040906101c3190112610232576040519061073382610378565b6101c43582526101e4356020830152565b604090610203190112610232576040519061075e82610378565b610204358252610224356020830152565b604090610243190112610232576040519061078982610378565b610244358252610264356020830152565b60409061028319011261023257604051906107b482610378565b6102843582526102a4356020830152565b6040906102c319011261023257604051906107df82610378565b6102c43582526102e4356020830152565b604090610303190112610232576040519061080a82610378565b610304358252610324356020830152565b604090610343190112610232576040519061083582610378565b610344358252610364356020830152565b604090610383190112610232576040519061086082610378565b6103843582526103a4356020830152565b6040906103c3190112610232576040519061088b82610378565b6103c43582526103e4356020830152565b60409061040319011261023257604051906108b682610378565b610404358252610424356020830152565b3461023257610580366003190112610232576108e236610629565b6104803661010319011261023257610a1e906108fc6103f0565b9061090636610698565b8252610911366106c3565b602083015261091f366106ee565b604083015261092d36610719565b606083015261093b36610744565b60808301526109493661076f565b60a08301526109573661079a565b60c0830152610965366107c5565b60e0830152610973366107f0565b6101008301526109823661081b565b61012083015261099136610846565b6101408301526109a036610871565b6101608301526109af3661089c565b610180830152610444356101a0830152610464356101c0830152610484356101e08301526104a4356102008301526104c4356102208301526104e4356102408301526105043561026083015261052435610280830152610544356102a0830152610564356102c0830152611441565b005b91909160e0806101008301946001600160401b03808251168552602082015116602085015260408101516040850152606081015160608501526080810151608085015260a081015160a085015260c081015160c08501520151910152565b3461023257600036600319011261023257610a976115c4565b50610afd604051610aa7816103b3565b6009546001600160401b0390818116835260401c166020820152600a546040820152600b546060820152600c546080820152600d5460a0820152600e5460c0820152600f5460e082015260405191829182610a20565b0390f35b6001600160401b03811161039357601f01601f191660200190565b60408060031936011261023257610b3161021c565b6024356001600160401b038111610232573660238201121561023257806004013590610b5c82610b01565b91610b69855193846103cf565b80835260209136602483830101116102325781600092602485930183870137840101526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116308114908115610cbf575b50610cae579080600492610bd4611b01565b7ff78721226efe9a1bb678189a16d1554928b9f2192e2cb93eeda83b79fa40007d82885192881692838152a186516352d1902d60e01b815293849182905afa918291600093610c7f575b5050610c44578351634c9c8ce360e01b81526001600160a01b0384166004820152602490fd5b600080516020612cd38339815191528193929303610c6657610a1e8383612b37565b8351632a87526960e21b81526004810191909152602490fd5b610c9f929350803d10610ca7575b610c9781836103cf565b81019061248e565b903880610c1e565b503d610c8d565b845163703e46dd60e11b8152600490fd5b905081600080516020612cd38339815191525416141538610bc2565b34610232576000366003190112610232577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163003610d34576020604051600080516020612cd38339815191528152f35b60405163703e46dd60e11b8152600490fd5b34610232576000366003190112610232576020600154604051908152f35b346102325760008060031936011261057857610d7e611b01565b60175460ff8160a01c166000146102e8576001600160a81b0319166017557f9a5f57de856dd668c54dd95e5c55df93432171cbca49a8776d5620ea59c024508180a180f35b346102325760008060031936011261057857610ddd611b01565b600080516020612cb383398151915280546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b34610232576000366003190112610232576020600054604051908152f35b6004359063ffffffff8216820361023257565b949198979693909260e0969361010087019a6001600160401b03809216885216602087015260408601526060850152608084015260a083015260c08201520152565b346102325760203660031901126102325763ffffffff610ebf610e4c565b1660005260046020526040600020805490610afd6001600160401b039160018101549060028101546003820154600483015491600660058501549401549460405198888a998260401c16911689610e5f565b3461023257600036600319011261023257610f2a6115c4565b50610afd610f36611602565b60405191829182610a20565b34610232576020366003190112610232576040610f606004356116c0565b6104f982518092602080916001600160401b0381511684520151910152565b3461023257600036600319011261023257600080516020612cb3833981519152546040516001600160a01b039091168152602090f35b34610232576101c036600319011261023257610fd036610629565b6080366101031901126102325760405190610fea82610398565b6101043582526101243560208301526101443560408301526101643560608301526101843563ffffffff8116810361023257610a1e92611028610237565b92611783565b3461023257602036600319011261023257611047610e4c565b61104f611b01565b63ffffffff808216610e1081109182156110a1575b505061108f576017805463ffffffff60a81b191660a89290921b63ffffffff60a81b16919091179055005b6040516307a5077760e51b8152600490fd5b60175460a81c16101590503880611064565b34610232576000366003190112610232576010546001600160401b03610afd60115460125460135460145490601554926016549460405198888a998260401c16911689610e5f565b3461023257600036600319011261023257608060055460065460075460085491604051938452602084015260408301526060820152f35b346102325761010036600319011261023257602061115761115236610629565b611a48565b604051908152f35b3461023257600036600319011261023257604080519061117e82610378565b60058252602090640352e302e360dc1b6020840152604051916020835283519182602085015260005b8381106111c95784604081866000838284010152601f80199101168101030190f35b85810183015185820183015282016111a7565b3461023257600036600319011261023257602060ff60175460a01c166040519015158152f35b3461023257600036600319011261023257602063ffffffff60175460a81c16604051908152f35b34610232576000366003190112610232576020600354604051908152f35b34610232576000366003190112610232576009546001600160401b03610afd600a54600b54600c54600d5490600e5492600f549460405198888a998260401c16911689610e5f565b3461023257604036600319011261023257600435601954438211801561138a575b611317576000916112c260009261169f565b916112e46112d86018546001600160401b031690565b6001600160401b031690565b925b8115611329575b509091501561131757611306610afd92602435926116b3565b604051911081529081906020820190565b60405163b0b4387760e01b8152600490fd5b826113476112d861133984610322565b50546001600160401b031690565b1115611370575b6002811061136b5783811461136b5761136690611a80565b6112e6565b6112ed565b93505060016113846112d861133986610322565b9361134e565b50600381106112b0565b3461023257602036600319011261023257610a1e6113b061021c565b6113b8611b01565b611a8d565b34610232576000366003190112610232576020601954604051908152f35b60e0906001600160401b038151166010549067ffffffffffffffff60401b602084015160401b16916001600160801b031916171760105560408101516011556060810151601255608081015160135560a081015160145560c08101516015550151601655565b9060175460ff8160a01c1690816115b0575b5061159e5781516001600160401b031661147e6112d861147161165c565b516001600160401b031690565b6001600160401b0380921611801590611567575b611555577fa04a773924505a418564363725f56832f5772e6b8d0dbd6efce724dfe803dae69061150460408501936114ca8551611b3a565b6114d76060870151611b3a565b6114e46080870151611b3a565b6114f160a0870151611b3a565b6114fe60c0870151611b3a565b8561209d565b61150d846113db565b61151c84824216834316612345565b611541602061153286516001600160401b031690565b9501516001600160401b031690565b9251604051908152928116931691602090a3565b60405163051c46ef60e01b8152600490fd5b5060208301516001600160401b0316816115956112d8602061158761165c565b01516001600160401b031690565b91161115611492565b6040516301474c8f60e71b8152600490fd5b6001600160a01b0316331415905038611453565b604051906115d1826103b3565b8160e06000918281528260208201528260408201528260608201528260808201528260a08201528260c08201520152565b6040519061160f826103b3565b816010546001600160401b0390818116835260401c16602082015260115460408201526012546060820152601354608082015260145460a082015260155460c082015260e0601654910152565b6116646115c4565b5061166d611602565b90565b6040519061167d82610378565b60006020838281520152565b634e487b7160e01b600052601160045260246000fd5b6000198101919082116116ae57565b611689565b919082039182116116ae57565b6116c8611670565b50601954906116de6116d98361169f565b610322565b50906116f86112d86001809401546001600160401b031690565b811015611771576117146112d86018546001600160401b031690565b83811061173657505050600161172f6116d961166d9361169f565b500161045e565b816117566112d88561174785610322565b5001546001600160401b031690565b11611762578201611714565b61166d935061172f9150610322565b604051631856a49960e21b8152600490fd5b929091600080516020612cf38339815191529283549460ff8660401c1615956001600160401b03811680159081611884575b600114908161187a575b159081611871575b5061185f5767ffffffffffffffff19166001179094556117eb938561183a5761188c565b6117f157565b600080516020612cf3833981519152805460ff60401b19169055604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a1565b600080516020612cf3833981519152805460ff60401b1916600160401b17905561188c565b60405163f92ee8a960e01b8152600490fd5b905015386117c7565b303b1591506117bf565b8891506117b5565b91926118a29061189a612bde565b6113b8612bde565b6118aa612bde565b6001600160401b0390816118c584516001600160401b031690565b1615801590611a29575b8015611a1d575b8015611a11575b8015611a05575b80156119f9575b6119e75761041d936119826119b0926119648660e0906001600160401b038151166009549067ffffffffffffffff60401b602084015160401b16916001600160801b03191617176009556040810151600a556060810151600b556080810151600c5560a0810151600d5560c0810151600e550151600f55565b80516005556020810151600655604081015160075560600151600855565b61198b846113db565b6017805463ffffffff60a81b191660a89290921b63ffffffff60a81b16919091179055565b6119dc6119bc83611a48565b806000556119d760e0850151916119d283600155565b600255565b600355565b804216904316612345565b6040516350dd03f760e11b8152600490fd5b5060e0830151156118eb565b5060c0830151156118e4565b5060a0830151156118dd565b506080830151156118d6565b50611a416112d860208501516001600160401b031690565b15156118cf565b60808101519060c060a082015191015160405191602083019384526040830152606082015260608152611a7a81610398565b51902090565b80156116ae576000190190565b6001600160a01b03908116908115611ae857600080516020612cb383398151915280546001600160a01b031981168417909155167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b604051631e4fbdf760e01b815260006004820152602490fd5b600080516020612cb3833981519152546001600160a01b03163303611b2257565b60405163118cdaa760e01b8152336004820152602490fd5b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000011115611b6357565b60405162461bcd60e51b815260206004820152601b60248201527f426e3235343a20696e76616c6964207363616c6172206669656c6400000000006044820152606490fd5b6040519061012082018281106001600160401b038211176103935760405260088252610100366020840137565b80511561035d5760200190565b80516001101561035d5760400190565b80516002101561035d5760600190565b80516003101561035d5760800190565b80516004101561035d5760a00190565b80516005101561035d5760c00190565b80516006101561035d5760e00190565b80516007101561035d576101000190565b90816020910312610232575180151581036102325790565b90815180825260208080930193019160005b828110611c8b575050505090565b835185529381019392810192600101611c7d565b61046090611cb883825160208091805184520151910152565b60208181015180516040860152015160608401526040810151805160808501526020015160a08401526060810151805160c08501526020015160e0840152608081015190611d16610100928386019060208091805184520151910152565b60a081015191611d36610140938487019060208091805184520151910152565b60c082015192611d56610180948588019060208091805184520151910152565b60e083015191611d766101c0938489019060208091805184520151910152565b830151611d93610200918289019060208091805184520151910152565b61012084015191611db461024093848a019060208091805184520151910152565b84015192611dd261028094858a019060208091805184520151910152565b611e0d61016086015196611df66102c098898c019060208091805184520151910152565b86015180516103008b0152602001516103208a0152565b6101a08501516103408901528401516103608801526101e08401516103808801528301516103a08701526102208301516103c08701528201516103e08601526102608201516104008601528101516104208501526102a08101516104408501520151910152565b93929061208961041d936104e09261207a6102606109609280518b52602081015160208c0152611eb6604082015160408d019060208091805184520151910152565b6060810151805160808d01526020015160a08c01526080810151805160c08d01526020015160e08c01526120648b611f0260a08401516101008093019060208091805184520151910152565b6120358d6103c060c0860151611f28610140918285019060208091805184520151910152565b61200860e088015195611f4b610180978887019060208091805184520151910152565b880151611f686101c0918287019060208091805184520151910152565b611fd96101208a015193611f8c610200958689019060208091805184520151910152565b8a015197611faa610240998a89019060208091805184520151910152565b6101608b01518051610280890152602001516102a08801528a015180516102c0880152602001516102e0870152565b6101a0890151805161030087015260200151610320860152880151805161034086015260200151610360850152565b6101e08701518051610380850152602001516103a084015286015191019060208091805184520151910152565b61022083015180516104008f0152602001516104208e015282015180516104408e0152602001516104608d0152565b015180516104808b0152602001516104a08a0152565b806104c0890152870190611c6b565b940190611c9f565b6040513d6000823e3d90fd5b6020906120a86125a9565b60606120b2611ba8565b926001546120bf85611bd5565b526120d46112d882516001600160401b031690565b6120dd85611be2565b526120f46112d8868301516001600160401b031690565b6120fd85611bf2565b52604081015161210c85611c02565b52015161211883611c12565b5260135461212583611c22565b5260145461213283611c32565b5260155461213f83611c42565b5261215e6040519485938493630c76545d60e21b855260048501611e74565b038173__$5c5c07cf4f55be9472c2b47d897172e765$__5af49081156121cf576000916121a0575b501561218e57565b6040516309bde33960e01b8152600490fd5b6121c2915060203d6020116121c8575b6121ba81836103cf565b810190611c53565b38612186565b503d6121b0565b612091565b6001600160401b0391821690821603919082116116ae57565b906122045760028160008093558260018201550155565b634e487b7160e01b600052600060045260246000fd5b6001600160401b038091169081146116ae5760010190565b601954600160401b81101561039357600181018060195581101561035d57602060037f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c9697926019600052029261233e6040857f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c969501926001600160401b03936122d28583511682906001600160401b03166001600160401b0319825416179055565b8582015167ffffffffffffffff60401b825491851b169067ffffffffffffffff60401b19161790550151918251167f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c96968601906001600160401b03166001600160401b0319825416179055565b0151910155565b90916123b461041d93601954801515908161241a575b506123be575b604061237760208501516001600160401b031690565b930151612394612385610410565b6001600160401b039095168552565b60208401526123a461238561041f565b6001600160401b03166020840152565b6040820152612232565b6123dc6123d66116d96018546001600160401b031690565b906121ed565b6124156123f96123f46018546001600160401b031690565b61221a565b6001600160401b03166001600160401b03196018541617601855565b612361565b61245d915061242e6116d961243f9261169f565b505460401c6001600160401b031690565b61245761242e6116d96018546001600160401b031690565b906121d4565b6001600160401b0361248461247b60175463ffffffff9060a81c1690565b63ffffffff1690565b911610153861235b565b90816020910312610232575190565b6124a561043e565b9060008252600060208301526124b9611670565b60408301526124c6611670565b60608301526124d3611670565b60808301526124e0611670565b60a08301526124ed611670565b60c08301526124fa611670565b60e0830152612507611670565b610100830152612515611670565b610120830152612523611670565b610140830152612531611670565b61016083015261253f611670565b61018083015261254d611670565b6101a083015261255b611670565b6101c0830152612569611670565b6101e0830152612577611670565b610200830152612585611670565b610220830152612593611670565b6102408301526125a1611670565b610260830152565b6125b161249d565b906210000082527f2ce6cc664a32147bfe6a0c94a95bf0496679405ccae01648cd4ec021145120d560206008818501527f03a0a9acc3e3815a7ed6cb1379f7d157e6343164729376392a693acbd3ec283c81604086017f20c9403133dfde9a9d382df76fb0523571648725abc0a7c12830bb690ec83b338151525101527f21be232a42246a5663ebf483470cca666ffe9d4f0e63b929c596a7658714e97081606086017f2866c18ad1df10ef13542cce6250ce02cb2a6b72ae00a9852e271187e9e4e0db8151525101527f0be0f448839080132d47de17de0099b4cd74ae1e6b71cdda06cdebb868a50c6d81608086017f07d77873b9860074118e75808c79468b83c8ed64ba14db5cb5afa8e534de7b998151525101527f18f95cdda42ce11d9d10a3b335acc214e3807c578c5359405d810c208df600938160a086017f13bd45a023491eadea44cc3f24cfbd1796eade9c0e39ee81d9f63ea0a58066258151525101527f28c2217f7bacf6f8b2b8ee4a90fcf8b5bca04205ea84e8e1eb54b85dd41bde288160c086017f0970d978763461f09e9ec63454073497386e4d282fedc2ac5b967cb9fd3fa8a98151525101527f202c3e390cee7c5c8525da2329a19f4936f6f71ca97dde6c6fa32b382d5acc038160e086017f02fe3d02988db718380052970aba46a3296df5f29b736ba1f2c4ccffc8b596938151525101527f1c8c2b856cdade256ba3237f39afd5e170a9532012f7aecae49d459b29f6f6ad8161010086017f23ac10ae6ca5cacee8744bb939aaa835390954b91ae668a2c8d0edda558a89e78151525101527f29392152723097e07113c3d7786d245ec40c30928015cd50b5668a4f4ea170318161012086017f16ec03d260bd7ac1c50ffa63565d5274b4582ceea52ff40b81cdfe8f444f01e48151525101527f07fea127dae943b8dc148f1408d40cff465c9c4721943669b1e4fd5a39db70368161014086017f2cdbfb3a4053c8489b0c94e74338ac19118df7a06bc56b1eb4d0e0dc4eae72488151525101527f118623e6bc136ee6d3f9907cd4ad04a9418ea03ba99ad753227cdfee598e84158161016086017f031455a79a2e0ce78a6cb53526ec04ac19716a86b08a93df48d178f8b77e56198151525101527f0805e392bcbc12e40a722778632d73fe981e4bc6fa6d1178b70af7be1cb9a3a38161018086017f0861d1997761a852226aac7ba9717bf6ae56451099be774cdf02ef352a58cbc88151525101527f089eb9c727e6cb07082bc3e6f40cf04f439fe48000602b584774dad7efc6607c816101a086017f101d1e3978cb9f1e303d413144ebe67682c9eb0cfe11242959aa6029d78cdbbc8151525101527f18e45d627aadd4df2794ecd9909fac1a753f0c6fa8a9c6654a7a58b0912fffd5816101c086017f2d489f2493263aa873bcd94f21efb45bf257a61d81c0c95c3297916506653b408151525101527f0eaba9f429c5f6fc3103d4cc4056c500ff42425d8e6465c5b8e145219f9c5cd3816101e086017f0e43e3a4b13cb438e2ad924614261ad0240214fa1c83fcda6a0bf779eb39ffc58151525101527f2b7bc74608d7ec7dadd0597d6a4010d8bfc2b31900281901cedc42bdbb0fb8fc8161020086017f29ae351d09dcf41c0a80ab05393738358baab37e6fbc464b3bb13258994a1fa48151525101527f27ec80e811e636f3348267923c8e641bd98a7e37c5216670cbff14ae323f9e0e8161022086017f066802c7ceb9e913d4f65433a20661e097acac1affecbb534a54f76a297822268151525101527f1588579e6c3378ea32cb641205ef762a63cd353a0bd670394528ad2081ee8dd48161024086017f12604d1f87c583f6c9710c73eaf590af9d07aa743d1381d0e9dff0eab261423981515251015261026084017f247d65261d3a4ab042ba937331f6d0c0c5eb9ea78753a92084db1a6939e19e82815152510152565b90813b15612bbd57600080516020612cd383398151915280546001600160a01b0319166001600160a01b0384169081179091557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2805115612ba257612b9f91612c0d565b50565b505034612bab57565b60405163b398979f60e01b8152600490fd5b604051634c9c8ce360e01b81526001600160a01b0383166004820152602490fd5b60ff600080516020612cf38339815191525460401c1615612bfb57565b604051631afcd79f60e31b8152600490fd5b60008061166d93602081519101845af43d15612c4b573d91612c2e83610b01565b92612c3c60405194856103cf565b83523d6000602085013e612c4f565b6060915b90612c765750805115612c6457805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580612ca9575b612c87575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b15612c7f56fe9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a164736f6c6343000817000a" +"0x60a080604052346100cd57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a009081549060ff8260401c166100be57506001600160401b036002600160401b031982821601610079575b604051612b0d9081620000d38239608051818181610ae50152610c3d0152f35b6001600160401b031990911681179091556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a1388080610059565b63f92ee8a960e01b8152600490fd5b600080fdfe6080604052600436101561001257600080fd5b60003560e01c8063013fa5fc1461021757806302b592f3146102125780630c693a221461020d5780630d8e6e2c146102085780632063d4f7146102035780632f79889d146101fe578063313df7b1146101f9578063382b215a146101f45780634847ae5d146101ef5780634f1ef286146101ea57806352d1902d146101e557806362827733146101e057806369cc6a04146101db5780636f96bdae146101d6578063715018a6146101d157806376b6b7cb146101cc5780637f17baad146101c757806382d07ff3146101c25780638584d23f146101bd5780638da5cb5b146101b857806396c1ca61146101b35780639baa3cc9146101ae5780639fdb54a7146101a9578063a9a9c9f5146101a4578063ad3cb1cc1461019f578063bd32519a1461019a578063c23b9e9e14610195578063ca6fe85514610190578063d24d933d1461018b578063e030330114610186578063f2fde38b146101815763f9e50d191461017c57600080fd5b611401565b6113d8565b6112d3565b611298565b61127a565b611253565b61122d565b6111b0565b611179565b61113e565b610ff1565b610f6c565b610f36565b610ef9565b610ea2565b610e44565b610e00565b610d95565b610d4a565b610cb3565b610c95565b610c2a565b610a6b565b6109cf565b6109b1565b610988565b610961565b610809565b61056d565b6104ed565b610477565b61024e565b600435906001600160a01b038216820361023257565b600080fd5b61010435906001600160a01b038216820361023257565b346102325760203660031901126102325761026761021c565b61026f611966565b6001600160a01b039081169081156102ff57600d5490811682146102ed5760ff60a01b19919091166001600160a81b03199190911617600160a01b17600d8190556040516001600160a01b0390911681527f8017bb887fdf8fca4314a9d40f6e73b3b81002d67e5cfa85d88173af6aa460729080602081015b0390a1005b60405163a863aec960e01b8152600490fd5b60405163e6c4247b60e01b8152600490fd5b634e487b7160e01b600052603260045260246000fd5b600f5481101561036257600390600f600052027f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac8020190600090565b610311565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b0382111761039857604052565b610367565b608081019081106001600160401b0382111761039857604052565b606081019081106001600160401b0382111761039857604052565b90601f801991011681019081106001600160401b0382111761039857604052565b604051906102e082018281106001600160401b0382111761039857604052565b604051906104218261037d565b565b60405190610421826103b8565b6040519061028082018281106001600160401b0382111761039857604052565b9060405161045d8161037d565b6020600182946001600160401b0381541684520154910152565b3461023257602036600319011261023257600435600f54811015610232576104a0608091610327565b506104eb8154916104bb60016001600160401b039201610450565b9060405193818116855260401c1660208401526040830190602080916001600160401b0381511684520151910152565bf35b346102325760008060031936011261056a57608090604090606082516105128161039d565b82815282602082015282848201520152805161052d8161039d565b6005549182825260065460208301908152600754908284019182526060600854940193845282519485525160208501525190830152516060820152f35b80fd5b34610232576000366003190112610232576060604051600181526000602082015260006040820152f35b606090600319011261023257604051906105b0826103b8565b816001600160401b03600435818116810361023257825260243590811681036102325760208201526040604435910152565b604090606319011261023257604051906105fb8261037d565b60643582526084356020830152565b60409060a319011261023257604051906106238261037d565b60a435825260c4356020830152565b60409060e3190112610232576040519061064b8261037d565b60e4358252610104356020830152565b60409061012319011261023257604051906106758261037d565b610124358252610144356020830152565b60409061016319011261023257604051906106a08261037d565b610164358252610184356020830152565b6040906101a319011261023257604051906106cb8261037d565b6101a43582526101c4356020830152565b6040906101e319011261023257604051906106f68261037d565b6101e4358252610204356020830152565b60409061022319011261023257604051906107218261037d565b610224358252610244356020830152565b604090610263190112610232576040519061074c8261037d565b610264358252610284356020830152565b6040906102a319011261023257604051906107778261037d565b6102a43582526102c4356020830152565b6040906102e319011261023257604051906107a28261037d565b6102e4358252610304356020830152565b60409061032319011261023257604051906107cd8261037d565b610324358252610344356020830152565b60409061036319011261023257604051906107f88261037d565b610364358252610384356020830152565b34610232576104e03660031901126102325761082436610597565b6104803660631901126102325761095f9061083d6103f4565b90610847366105e2565b82526108523661060a565b602083015261086036610632565b604083015261086e3661065b565b606083015261087c36610686565b608083015261088a366106b1565b60a0830152610898366106dc565b60c08301526108a636610707565b60e08301526108b436610732565b6101008301526108c33661075d565b6101208301526108d236610788565b6101408301526108e1366107b3565b6101608301526108f0366107de565b6101808301526103a4356101a08301526103c4356101c08301526103e4356101e083015261040435610200830152610424356102208301526104443561024083015261046435610260830152610484356102808301526104a4356102a08301526104c4356102c083015261145c565b005b346102325760003660031901126102325760206001600160401b03600e5416604051908152f35b3461023257600036600319011261023257600d546040516001600160a01b039091168152602090f35b34610232576000366003190112610232576020600254604051908152f35b34610232576000366003190112610232576109e86115ab565b50610a4c6040516109f8816103b8565b6009546001600160401b0390818116835260401c166020820152600a5460408201526040519182918291909160408060608301946001600160401b0380825116855260208201511660208501520151910152565b0390f35b6001600160401b03811161039857601f01601f191660200190565b60408060031936011261023257610a8061021c565b6024356001600160401b038111610232573660238201121561023257806004013590610aab82610a50565b91610ab8855193846103d3565b80835260209136602483830101116102325781600092602485930183870137840101526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116308114908115610c0e575b50610bfd579080600492610b23611966565b7ff78721226efe9a1bb678189a16d1554928b9f2192e2cb93eeda83b79fa40007d82885192881692838152a186516352d1902d60e01b815293849182905afa918291600093610bce575b5050610b93578351634c9c8ce360e01b81526001600160a01b0384166004820152602490fd5b600080516020612ac18339815191528193929303610bb55761095f8383612925565b8351632a87526960e21b81526004810191909152602490fd5b610bee929350803d10610bf6575b610be681836103d3565b81019061227c565b903880610b6d565b503d610bdc565b845163703e46dd60e11b8152600490fd5b905081600080516020612ac18339815191525416141538610b11565b34610232576000366003190112610232577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163003610c83576020604051600080516020612ac18339815191528152f35b60405163703e46dd60e11b8152600490fd5b34610232576000366003190112610232576020600154604051908152f35b346102325760008060031936011261056a57610ccd611966565b600d5460ff8160a01c166000146102ed576001600160a81b031916600d557f9a5f57de856dd668c54dd95e5c55df93432171cbca49a8776d5620ea59c024508180a180f35b60809060631901126102325760405190610d2b8261039d565b6064358252608435602083015260a435604083015260c4356060830152565b34610232576080366003190112610232576020610d8d604051610d6c8161039d565b600435815260243583820152604435604082015260643560608201526115fc565b604051908152f35b346102325760008060031936011261056a57610daf611966565b600080516020612aa183398151915280546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b34610232576000366003190112610232576020600054604051908152f35b6004359063ffffffff8216820361023257565b60e4359063ffffffff8216820361023257565b346102325760203660031901126102325763ffffffff610e62610e1e565b16600090815260046020908152604091829020805460019091015483516001600160401b03808416825292851c9092169282019290925291820152606090f35b3461023257600036600319011261023257610ebb6115ab565b50610a4c610ec76115ca565b6040519182918291909160408060608301946001600160401b0380825116855260208201511660208501520151910152565b34610232576020366003190112610232576040610f17600435611698565b6104eb82518092602080916001600160401b0381511684520151910152565b3461023257600036600319011261023257600080516020612aa1833981519152546040516001600160a01b039091168152602090f35b3461023257602036600319011261023257610f85610e1e565b610f8d611966565b63ffffffff808216610e108110918215610fdf575b5050610fcd57600d805463ffffffff60a81b191660a89290921b63ffffffff60a81b16919091179055005b6040516307a5077760e51b8152600490fd5b600d5460a81c16101590503880610fa2565b34610232576101203660031901126102325761100c36610597565b61101536610d12565b9061101e610e31565b611026610237565b90600080516020612ae183398151915254936001600160401b0360ff8660401c1615951680159081611136575b600114908161112c575b159081611123575b5061111157600080516020612ae1833981519152805467ffffffffffffffff1916600117905561109993856110ec5761175b565b61109f57005b600080516020612ae1833981519152805460ff60401b19169055604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29080602081016102e8565b600080516020612ae1833981519152805460ff60401b1916600160401b17905561175b565b60405163f92ee8a960e01b8152600490fd5b90501538611065565b303b15915061105d565b869150611053565b3461023257600036600319011261023257600b54600c54604080516001600160401b03808516825293821c9093166020840152820152606090f35b3461023257600036600319011261023257608060055460065460075460085491604051938452602084015260408301526060820152f35b346102325760003660031901126102325760408051906111cf8261037d565b60058252602090640352e302e360dc1b6020840152604051916020835283519182602085015260005b83811061121a5784604081866000838284010152601f80199101168101030190f35b85810183015185820183015282016111f8565b3461023257600036600319011261023257602060ff600d5460a01c166040519015158152f35b3461023257600036600319011261023257602063ffffffff600d5460a81c16604051908152f35b34610232576000366003190112610232576020600354604051908152f35b3461023257600036600319011261023257600954600a54604080516001600160401b03808516825293821c9093166020840152820152606090f35b3461023257604036600319011261023257600435600f5443821180156113ce575b61135b57600091611306600092611677565b9161132861131c600e546001600160401b031690565b6001600160401b031690565b925b811561136d575b509091501561135b5761134a610a4c926024359261168b565b604051911081529081906020820190565b60405163b0b4387760e01b8152600490fd5b8261138b61131c61137d84610327565b50546001600160401b031690565b11156113b4575b600281106113af578381146113af576113aa906118e5565b61132a565b611331565b93505060016113c861131c61137d86610327565b93611392565b50600381106112f4565b346102325760203660031901126102325761095f6113f461021c565b6113fc611966565b6118f2565b34610232576000366003190112610232576020600f54604051908152f35b6040906001600160401b03815116600b549067ffffffffffffffff60401b6020840151851b16916001600160801b0319161717600b550151600c55565b90600d5460ff8160a01c169081611597575b506115855781516001600160401b031661149961131c61148c611634565b516001600160401b031690565b6001600160401b038092161180159061154e575b61153c577fa04a773924505a418564363725f56832f5772e6b8d0dbd6efce724dfe803dae6906114eb60408501936114e5855161199f565b85611ec1565b6114f48461141f565b61150384824216834316612133565b611528602061151986516001600160401b031690565b9501516001600160401b031690565b9251604051908152928116931691602090a3565b60405163051c46ef60e01b8152600490fd5b5060208301516001600160401b03168161157c61131c602061156e611634565b01516001600160401b031690565b911611156114ad565b6040516301474c8f60e71b8152600490fd5b6001600160a01b031633141590503861146e565b604051906115b8826103b8565b60006040838281528260208201520152565b604051906115d7826103b8565b81600b546001600160401b0390818116835260401c1660208201526040600c54910152565b602081015190606060408201519101516040519160208301938452604083015260608201526060815261162e8161039d565b51902090565b61163c6115ab565b506116456115ca565b90565b604051906116558261037d565b60006020838281520152565b634e487b7160e01b600052601160045260246000fd5b60001981019190821161168657565b611661565b9190820391821161168657565b6116a0611648565b50600f54906116b66116b183611677565b610327565b50906116d061131c6001809401546001600160401b031690565b811015611749576116ec61131c600e546001600160401b031690565b83811061170e5750505060016117076116b161164593611677565b5001610450565b8161172e61131c8561171f85610327565b5001546001600160401b031690565b1161173a5782016116ec565b61164593506117079150610327565b604051631856a49960e21b8152600490fd5b9190926117729061176a6129cc565b6113fc6129cc565b61177a6129cc565b6001600160401b03908161179584516001600160401b031690565b16158015906118c6575b80156118ba575b80156118ae575b80156118a2575b8015611899575b611887576104219361185661187c9261180b866040906001600160401b038151166009549067ffffffffffffffff60401b6020840151851b16916001600160801b03191617176009550151600a55565b82516005556020830151600655604083015160075560608301516008556118318661141f565b600d805463ffffffff60a81b191660a89290921b63ffffffff60a81b16919091179055565b611877611862826115fc565b9182600055519161187283600155565b600255565b600355565b804216904316612133565b6040516350dd03f760e11b8152600490fd5b508351156117bb565b506060840151156117b4565b506040840151156117ad565b506020840151156117a6565b506118de61131c60208501516001600160401b031690565b151561179f565b8015611686576000190190565b6001600160a01b0390811690811561194d57600080516020612aa183398151915280546001600160a01b031981168417909155167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b604051631e4fbdf760e01b815260006004820152602490fd5b600080516020612aa1833981519152546001600160a01b0316330361198757565b60405163118cdaa760e01b8152336004820152602490fd5b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000111156119c857565b60405162461bcd60e51b815260206004820152601b60248201527f426e3235343a20696e76616c6964207363616c6172206669656c6400000000006044820152606490fd5b6040519061012082018281106001600160401b038211176103985760405260088252610100366020840137565b8051156103625760200190565b8051600110156103625760400190565b8051600210156103625760600190565b8051600310156103625760800190565b90816020910312610232575180151581036102325790565b90815180825260208080930193019160005b828110611aaf575050505090565b835185529381019392810192600101611aa1565b61046090611adc83825160208091805184520151910152565b60208181015180516040860152015160608401526040810151805160808501526020015160a08401526060810151805160c08501526020015160e0840152608081015190611b3a610100928386019060208091805184520151910152565b60a081015191611b5a610140938487019060208091805184520151910152565b60c082015192611b7a610180948588019060208091805184520151910152565b60e083015191611b9a6101c0938489019060208091805184520151910152565b830151611bb7610200918289019060208091805184520151910152565b61012084015191611bd861024093848a019060208091805184520151910152565b84015192611bf661028094858a019060208091805184520151910152565b611c3161016086015196611c1a6102c098898c019060208091805184520151910152565b86015180516103008b0152602001516103208a0152565b6101a08501516103408901528401516103608801526101e08401516103808801528301516103a08701526102208301516103c08701528201516103e08601526102608201516104008601528101516104208501526102a08101516104408501520151910152565b939290611ead610421936104e092611e9e6102606109609280518b52602081015160208c0152611cda604082015160408d019060208091805184520151910152565b6060810151805160808d01526020015160a08c01526080810151805160c08d01526020015160e08c0152611e888b611d2660a08401516101008093019060208091805184520151910152565b611e598d6103c060c0860151611d4c610140918285019060208091805184520151910152565b611e2c60e088015195611d6f610180978887019060208091805184520151910152565b880151611d8c6101c0918287019060208091805184520151910152565b611dfd6101208a015193611db0610200958689019060208091805184520151910152565b8a015197611dce610240998a89019060208091805184520151910152565b6101608b01518051610280890152602001516102a08801528a015180516102c0880152602001516102e0870152565b6101a0890151805161030087015260200151610320860152880151805161034086015260200151610360850152565b6101e08701518051610380850152602001516103a084015286015191019060208091805184520151910152565b61022083015180516104008f0152602001516104208e015282015180516104408e0152602001516104608d0152565b015180516104808b0152602001516104a08a0152565b806104c0890152870190611a8f565b940190611ac3565b6040513d6000823e3d90fd5b602090611ecc612397565b6040611ed6611a0d565b92600154611ee385611a3a565b52611ef861131c82516001600160401b031690565b611f0185611a47565b52611f1861131c868301516001600160401b031690565b611f2185611a57565b520151611f2d83611a67565b52611f4c6040519485938493630c76545d60e21b855260048501611c98565b038173__$5c5c07cf4f55be9472c2b47d897172e765$__5af4908115611fbd57600091611f8e575b5015611f7c57565b6040516309bde33960e01b8152600490fd5b611fb0915060203d602011611fb6575b611fa881836103d3565b810190611a77565b38611f74565b503d611f9e565b611eb5565b6001600160401b03918216908216039190821161168657565b90611ff25760028160008093558260018201550155565b634e487b7160e01b600052600060045260246000fd5b6001600160401b038091169081146116865760010190565b600f54600160401b811015610398576001810180600f5581101561036257602060037f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac80492600f600052029261212c6040857f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac80201926001600160401b03936120c08583511682906001600160401b03166001600160401b0319825416179055565b8582015167ffffffffffffffff60401b825491851b169067ffffffffffffffff60401b19161790550151918251167f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac8038601906001600160401b03166001600160401b0319825416179055565b0151910155565b90916121a261042193600f548015159081612208575b506121ac575b604061216560208501516001600160401b031690565b930151612182612173610414565b6001600160401b039095168552565b6020840152612192612173610423565b6001600160401b03166020840152565b6040820152612020565b6121ca6121c46116b1600e546001600160401b031690565b90611fdb565b6122036121e76121e2600e546001600160401b031690565b612008565b6001600160401b03166001600160401b0319600e541617600e55565b61214f565b61224b915061221c6116b161222d92611677565b505460401c6001600160401b031690565b61224561221c6116b1600e546001600160401b031690565b90611fc2565b6001600160401b03612272612269600d5463ffffffff9060a81c1690565b63ffffffff1690565b9116101538612149565b90816020910312610232575190565b612293610430565b9060008252600060208301526122a7611648565b60408301526122b4611648565b60608301526122c1611648565b60808301526122ce611648565b60a08301526122db611648565b60c08301526122e8611648565b60e08301526122f5611648565b610100830152612303611648565b610120830152612311611648565b61014083015261231f611648565b61016083015261232d611648565b61018083015261233b611648565b6101a0830152612349611648565b6101c0830152612357611648565b6101e0830152612365611648565b610200830152612373611648565b610220830152612381611648565b61024083015261238f611648565b610260830152565b61239f61228b565b906210000082527f2ce6cc664a32147bfe6a0c94a95bf0496679405ccae01648cd4ec021145120d560206008818501527f03a0a9acc3e3815a7ed6cb1379f7d157e6343164729376392a693acbd3ec283c81604086017f20c9403133dfde9a9d382df76fb0523571648725abc0a7c12830bb690ec83b338151525101527f21be232a42246a5663ebf483470cca666ffe9d4f0e63b929c596a7658714e97081606086017f2866c18ad1df10ef13542cce6250ce02cb2a6b72ae00a9852e271187e9e4e0db8151525101527f0be0f448839080132d47de17de0099b4cd74ae1e6b71cdda06cdebb868a50c6d81608086017f07d77873b9860074118e75808c79468b83c8ed64ba14db5cb5afa8e534de7b998151525101527f18f95cdda42ce11d9d10a3b335acc214e3807c578c5359405d810c208df600938160a086017f13bd45a023491eadea44cc3f24cfbd1796eade9c0e39ee81d9f63ea0a58066258151525101527f28c2217f7bacf6f8b2b8ee4a90fcf8b5bca04205ea84e8e1eb54b85dd41bde288160c086017f0970d978763461f09e9ec63454073497386e4d282fedc2ac5b967cb9fd3fa8a98151525101527f202c3e390cee7c5c8525da2329a19f4936f6f71ca97dde6c6fa32b382d5acc038160e086017f02fe3d02988db718380052970aba46a3296df5f29b736ba1f2c4ccffc8b596938151525101527f1c8c2b856cdade256ba3237f39afd5e170a9532012f7aecae49d459b29f6f6ad8161010086017f23ac10ae6ca5cacee8744bb939aaa835390954b91ae668a2c8d0edda558a89e78151525101527f29392152723097e07113c3d7786d245ec40c30928015cd50b5668a4f4ea170318161012086017f16ec03d260bd7ac1c50ffa63565d5274b4582ceea52ff40b81cdfe8f444f01e48151525101527f07fea127dae943b8dc148f1408d40cff465c9c4721943669b1e4fd5a39db70368161014086017f2cdbfb3a4053c8489b0c94e74338ac19118df7a06bc56b1eb4d0e0dc4eae72488151525101527f118623e6bc136ee6d3f9907cd4ad04a9418ea03ba99ad753227cdfee598e84158161016086017f031455a79a2e0ce78a6cb53526ec04ac19716a86b08a93df48d178f8b77e56198151525101527f0805e392bcbc12e40a722778632d73fe981e4bc6fa6d1178b70af7be1cb9a3a38161018086017f0861d1997761a852226aac7ba9717bf6ae56451099be774cdf02ef352a58cbc88151525101527f089eb9c727e6cb07082bc3e6f40cf04f439fe48000602b584774dad7efc6607c816101a086017f101d1e3978cb9f1e303d413144ebe67682c9eb0cfe11242959aa6029d78cdbbc8151525101527f18e45d627aadd4df2794ecd9909fac1a753f0c6fa8a9c6654a7a58b0912fffd5816101c086017f2d489f2493263aa873bcd94f21efb45bf257a61d81c0c95c3297916506653b408151525101527f0eaba9f429c5f6fc3103d4cc4056c500ff42425d8e6465c5b8e145219f9c5cd3816101e086017f0e43e3a4b13cb438e2ad924614261ad0240214fa1c83fcda6a0bf779eb39ffc58151525101527f2b7bc74608d7ec7dadd0597d6a4010d8bfc2b31900281901cedc42bdbb0fb8fc8161020086017f29ae351d09dcf41c0a80ab05393738358baab37e6fbc464b3bb13258994a1fa48151525101527f27ec80e811e636f3348267923c8e641bd98a7e37c5216670cbff14ae323f9e0e8161022086017f066802c7ceb9e913d4f65433a20661e097acac1affecbb534a54f76a297822268151525101527f1588579e6c3378ea32cb641205ef762a63cd353a0bd670394528ad2081ee8dd48161024086017f12604d1f87c583f6c9710c73eaf590af9d07aa743d1381d0e9dff0eab261423981515251015261026084017f247d65261d3a4ab042ba937331f6d0c0c5eb9ea78753a92084db1a6939e19e82815152510152565b90813b156129ab57600080516020612ac183398151915280546001600160a01b0319166001600160a01b0384169081179091557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a28051156129905761298d916129fb565b50565b50503461299957565b60405163b398979f60e01b8152600490fd5b604051634c9c8ce360e01b81526001600160a01b0383166004820152602490fd5b60ff600080516020612ae18339815191525460401c16156129e957565b604051631afcd79f60e31b8152600490fd5b60008061164593602081519101845af43d15612a39573d91612a1c83610a50565b92612a2a60405194856103d3565b83523d6000602085013e612a3d565b6060915b90612a645750805115612a5257805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580612a97575b612a75575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b15612a6d56fe9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a164736f6c6343000817000a" diff --git a/contract-bindings/src/light_client.rs b/contract-bindings/src/light_client.rs index 2924e7ea0..d86a130cf 100644 --- a/contract-bindings/src/light_client.rs +++ b/contract-bindings/src/light_client.rs @@ -41,19 +41,13 @@ pub mod light_client { inputs: ::std::vec![::ethers::core::abi::ethabi::Param { name: ::std::borrow::ToOwned::to_owned("state"), kind: ::ethers::core::abi::ethabi::ParamType::Tuple(::std::vec![ - ::ethers::core::abi::ethabi::ParamType::Uint(64usize), - ::ethers::core::abi::ethabi::ParamType::Uint(64usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ],), internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned( - "struct LightClient.LightClientState", - ), + ::std::borrow::ToOwned::to_owned("struct LightClient.StakeState",), ), },], outputs: ::std::vec![::ethers::core::abi::ethabi::Param { @@ -104,41 +98,6 @@ pub mod light_client { ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), ), }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("feeLedgerComm"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableBlsKeyComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableSchnorrKeyComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableAmountComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("threshold"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, ], constant: ::core::option::Option::None, state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, @@ -242,41 +201,6 @@ pub mod light_client { ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), ), }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("feeLedgerComm"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableBlsKeyComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableSchnorrKeyComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableAmountComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("threshold"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, ], constant: ::core::option::Option::None, state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, @@ -293,11 +217,6 @@ pub mod light_client { ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ],), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned( @@ -341,11 +260,6 @@ pub mod light_client { ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ],), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned( @@ -443,11 +357,6 @@ pub mod light_client { ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ],), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned( @@ -533,11 +442,6 @@ pub mod light_client { ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ],), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned( @@ -837,41 +741,6 @@ pub mod light_client { ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), ), }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("feeLedgerComm"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableBlsKeyComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableSchnorrKeyComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableAmountComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("threshold"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, ], constant: ::core::option::Option::None, state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, @@ -1278,13 +1147,13 @@ pub mod light_client { .method_hash([173, 60, 177, 204], ()) .expect("method not found (this should never happen)") } - ///Calls the contract's `computeStakeTableComm` (0xaa922732) function + ///Calls the contract's `computeStakeTableComm` (0x6f96bdae) function pub fn compute_stake_table_comm( &self, - state: LightClientState, + state: StakeState, ) -> ::ethers::contract::builders::ContractCall { self.0 - .method_hash([170, 146, 39, 50], (state,)) + .method_hash([111, 150, 189, 174], (state,)) .expect("method not found (this should never happen)") } ///Calls the contract's `disablePermissionedProverMode` (0x69cc6a04) function @@ -1298,19 +1167,8 @@ pub mod light_client { ///Calls the contract's `finalizedState` (0x9fdb54a7) function pub fn finalized_state( &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ( - u64, - u64, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ), - > { + ) -> ::ethers::contract::builders::ContractCall + { self.0 .method_hash([159, 219, 84, 167], ()) .expect("method not found (this should never happen)") @@ -1350,19 +1208,8 @@ pub mod light_client { ///Calls the contract's `genesisState` (0xd24d933d) function pub fn genesis_state( &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ( - u64, - u64, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ), - > { + ) -> ::ethers::contract::builders::ContractCall + { self.0 .method_hash([210, 77, 147, 61], ()) .expect("method not found (this should never happen)") @@ -1414,7 +1261,7 @@ pub mod light_client { .method_hash([13, 142, 110, 44], ()) .expect("method not found (this should never happen)") } - ///Calls the contract's `initialize` (0x8ed3e045) function + ///Calls the contract's `initialize` (0x9baa3cc9) function pub fn initialize( &self, genesis: LightClientState, @@ -1424,7 +1271,7 @@ pub mod light_client { ) -> ::ethers::contract::builders::ContractCall { self.0 .method_hash( - [142, 211, 224, 69], + [155, 170, 60, 201], ( genesis, genesis_stake_state, @@ -1444,14 +1291,14 @@ pub mod light_client { .method_hash([224, 48, 51, 1], (block_number, threshold)) .expect("method not found (this should never happen)") } - ///Calls the contract's `newFinalizedState` (0x409939b7) function + ///Calls the contract's `newFinalizedState` (0x2063d4f7) function pub fn new_finalized_state( &self, new_state: LightClientState, proof: PlonkProof, ) -> ::ethers::contract::builders::ContractCall { self.0 - .method_hash([64, 153, 57, 183], (new_state, proof)) + .method_hash([32, 99, 212, 247], (new_state, proof)) .expect("method not found (this should never happen)") } ///Calls the contract's `owner` (0x8da5cb5b) function @@ -1537,19 +1384,8 @@ pub mod light_client { pub fn states( &self, index: u32, - ) -> ::ethers::contract::builders::ContractCall< - M, - ( - u64, - u64, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ), - > { + ) -> ::ethers::contract::builders::ContractCall + { self.0 .method_hash([127, 23, 186, 173], index) .expect("method not found (this should never happen)") @@ -2637,7 +2473,7 @@ pub mod light_client { abi = "UPGRADE_INTERFACE_VERSION()" )] pub struct UpgradeInterfaceVersionCall; - ///Container type for all input parameters for the `computeStakeTableComm` function with signature `computeStakeTableComm((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256))` and selector `0xaa922732` + ///Container type for all input parameters for the `computeStakeTableComm` function with signature `computeStakeTableComm((uint256,uint256,uint256,uint256))` and selector `0x6f96bdae` #[derive( Clone, ::ethers::contract::EthCall, @@ -2652,10 +2488,10 @@ pub mod light_client { )] #[ethcall( name = "computeStakeTableComm", - abi = "computeStakeTableComm((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256))" + abi = "computeStakeTableComm((uint256,uint256,uint256,uint256))" )] pub struct ComputeStakeTableCommCall { - pub state: LightClientState, + pub state: StakeState, } ///Container type for all input parameters for the `disablePermissionedProverMode` function with signature `disablePermissionedProverMode()` and selector `0x69cc6a04` #[derive( @@ -2845,7 +2681,7 @@ pub mod light_client { )] #[ethcall(name = "getVersion", abi = "getVersion()")] pub struct GetVersionCall; - ///Container type for all input parameters for the `initialize` function with signature `initialize((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256),uint32,address)` and selector `0x8ed3e045` + ///Container type for all input parameters for the `initialize` function with signature `initialize((uint64,uint64,uint256),(uint256,uint256,uint256,uint256),uint32,address)` and selector `0x9baa3cc9` #[derive( Clone, ::ethers::contract::EthCall, @@ -2860,7 +2696,7 @@ pub mod light_client { )] #[ethcall( name = "initialize", - abi = "initialize((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256),uint32,address)" + abi = "initialize((uint64,uint64,uint256),(uint256,uint256,uint256,uint256),uint32,address)" )] pub struct InitializeCall { pub genesis: LightClientState, @@ -2889,7 +2725,7 @@ pub mod light_client { pub block_number: ::ethers::core::types::U256, pub threshold: ::ethers::core::types::U256, } - ///Container type for all input parameters for the `newFinalizedState` function with signature `newFinalizedState((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256),((uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))` and selector `0x409939b7` + ///Container type for all input parameters for the `newFinalizedState` function with signature `newFinalizedState((uint64,uint64,uint256),((uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))` and selector `0x2063d4f7` #[derive( Clone, ::ethers::contract::EthCall, @@ -2899,7 +2735,7 @@ pub mod light_client { )] #[ethcall( name = "newFinalizedState", - abi = "newFinalizedState((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256),((uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))" + abi = "newFinalizedState((uint64,uint64,uint256),((uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))" )] pub struct NewFinalizedStateCall { pub new_state: LightClientState, @@ -3636,7 +3472,7 @@ pub mod light_client { Hash, )] pub struct UpgradeInterfaceVersionReturn(pub ::std::string::String); - ///Container type for all return fields from the `computeStakeTableComm` function with signature `computeStakeTableComm((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256))` and selector `0xaa922732` + ///Container type for all return fields from the `computeStakeTableComm` function with signature `computeStakeTableComm((uint256,uint256,uint256,uint256))` and selector `0x6f96bdae` #[derive( Clone, ::ethers::contract::EthAbiType, @@ -3667,11 +3503,6 @@ pub mod light_client { pub view_num: u64, pub block_height: u64, pub block_comm_root: ::ethers::core::types::U256, - pub fee_ledger_comm: ::ethers::core::types::U256, - pub stake_table_bls_key_comm: ::ethers::core::types::U256, - pub stake_table_schnorr_key_comm: ::ethers::core::types::U256, - pub stake_table_amount_comm: ::ethers::core::types::U256, - pub threshold: ::ethers::core::types::U256, } ///Container type for all return fields from the `frozenStakeTableCommitment` function with signature `frozenStakeTableCommitment()` and selector `0x382b215a` #[derive( @@ -3737,11 +3568,6 @@ pub mod light_client { pub view_num: u64, pub block_height: u64, pub block_comm_root: ::ethers::core::types::U256, - pub fee_ledger_comm: ::ethers::core::types::U256, - pub stake_table_bls_key_comm: ::ethers::core::types::U256, - pub stake_table_schnorr_key_comm: ::ethers::core::types::U256, - pub stake_table_amount_comm: ::ethers::core::types::U256, - pub threshold: ::ethers::core::types::U256, } ///Container type for all return fields from the `getFinalizedState` function with signature `getFinalizedState()` and selector `0x82d07ff3` #[derive( @@ -3964,11 +3790,6 @@ pub mod light_client { pub view_num: u64, pub block_height: u64, pub block_comm_root: ::ethers::core::types::U256, - pub fee_ledger_comm: ::ethers::core::types::U256, - pub stake_table_bls_key_comm: ::ethers::core::types::U256, - pub stake_table_schnorr_key_comm: ::ethers::core::types::U256, - pub stake_table_amount_comm: ::ethers::core::types::U256, - pub threshold: ::ethers::core::types::U256, } ///Container type for all return fields from the `votingStakeTableCommitment` function with signature `votingStakeTableCommitment()` and selector `0x76b6b7cb` #[derive( diff --git a/contract-bindings/src/light_client_mock.rs b/contract-bindings/src/light_client_mock.rs index 5df10708c..7dc2aec66 100644 --- a/contract-bindings/src/light_client_mock.rs +++ b/contract-bindings/src/light_client_mock.rs @@ -22,11 +22,6 @@ pub mod light_client_mock { ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ],), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned("struct LightClient.LightClientState",), @@ -77,19 +72,13 @@ pub mod light_client_mock { inputs: ::std::vec![::ethers::core::abi::ethabi::Param { name: ::std::borrow::ToOwned::to_owned("state"), kind: ::ethers::core::abi::ethabi::ParamType::Tuple(::std::vec![ - ::ethers::core::abi::ethabi::ParamType::Uint(64usize), - ::ethers::core::abi::ethabi::ParamType::Uint(64usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ],), internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned( - "struct LightClient.LightClientState", - ), + ::std::borrow::ToOwned::to_owned("struct LightClient.StakeState",), ), },], outputs: ::std::vec![::ethers::core::abi::ethabi::Param { @@ -140,41 +129,6 @@ pub mod light_client_mock { ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), ), }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("feeLedgerComm"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableBlsKeyComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableSchnorrKeyComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableAmountComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("threshold"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, ], constant: ::core::option::Option::None, state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, @@ -278,41 +232,6 @@ pub mod light_client_mock { ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), ), }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("feeLedgerComm"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableBlsKeyComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableSchnorrKeyComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableAmountComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("threshold"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, ], constant: ::core::option::Option::None, state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, @@ -329,11 +248,6 @@ pub mod light_client_mock { ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ],), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned( @@ -377,11 +291,6 @@ pub mod light_client_mock { ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ],), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned( @@ -479,11 +388,6 @@ pub mod light_client_mock { ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ],), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned( @@ -569,11 +473,6 @@ pub mod light_client_mock { ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ],), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned( @@ -743,11 +642,6 @@ pub mod light_client_mock { ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(64usize), ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - ::ethers::core::abi::ethabi::ParamType::Uint(256usize), ],), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned( @@ -955,41 +849,6 @@ pub mod light_client_mock { ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), ), }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("feeLedgerComm"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableBlsKeyComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableSchnorrKeyComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("stakeTableAmountComm",), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("BN254.ScalarField"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("threshold"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, ], constant: ::core::option::Option::None, state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, @@ -1396,13 +1255,13 @@ pub mod light_client_mock { .method_hash([173, 60, 177, 204], ()) .expect("method not found (this should never happen)") } - ///Calls the contract's `computeStakeTableComm` (0xaa922732) function + ///Calls the contract's `computeStakeTableComm` (0x6f96bdae) function pub fn compute_stake_table_comm( &self, - state: LightClientState, + state: StakeState, ) -> ::ethers::contract::builders::ContractCall { self.0 - .method_hash([170, 146, 39, 50], (state,)) + .method_hash([111, 150, 189, 174], (state,)) .expect("method not found (this should never happen)") } ///Calls the contract's `disablePermissionedProverMode` (0x69cc6a04) function @@ -1416,19 +1275,8 @@ pub mod light_client_mock { ///Calls the contract's `finalizedState` (0x9fdb54a7) function pub fn finalized_state( &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ( - u64, - u64, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ), - > { + ) -> ::ethers::contract::builders::ContractCall + { self.0 .method_hash([159, 219, 84, 167], ()) .expect("method not found (this should never happen)") @@ -1468,19 +1316,8 @@ pub mod light_client_mock { ///Calls the contract's `genesisState` (0xd24d933d) function pub fn genesis_state( &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ( - u64, - u64, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ), - > { + ) -> ::ethers::contract::builders::ContractCall + { self.0 .method_hash([210, 77, 147, 61], ()) .expect("method not found (this should never happen)") @@ -1532,7 +1369,7 @@ pub mod light_client_mock { .method_hash([13, 142, 110, 44], ()) .expect("method not found (this should never happen)") } - ///Calls the contract's `initialize` (0x8ed3e045) function + ///Calls the contract's `initialize` (0x9baa3cc9) function pub fn initialize( &self, genesis: LightClientState, @@ -1542,7 +1379,7 @@ pub mod light_client_mock { ) -> ::ethers::contract::builders::ContractCall { self.0 .method_hash( - [142, 211, 224, 69], + [155, 170, 60, 201], ( genesis, genesis_stake_state, @@ -1562,14 +1399,14 @@ pub mod light_client_mock { .method_hash([224, 48, 51, 1], (block_number, threshold)) .expect("method not found (this should never happen)") } - ///Calls the contract's `newFinalizedState` (0x409939b7) function + ///Calls the contract's `newFinalizedState` (0x2063d4f7) function pub fn new_finalized_state( &self, new_state: LightClientState, proof: PlonkProof, ) -> ::ethers::contract::builders::ContractCall { self.0 - .method_hash([64, 153, 57, 183], (new_state, proof)) + .method_hash([32, 99, 212, 247], (new_state, proof)) .expect("method not found (this should never happen)") } ///Calls the contract's `owner` (0x8da5cb5b) function @@ -1608,13 +1445,13 @@ pub mod light_client_mock { .method_hash([113, 80, 24, 166], ()) .expect("method not found (this should never happen)") } - ///Calls the contract's `setFinalizedState` (0x202a0adb) function + ///Calls the contract's `setFinalizedState` (0xb5adea3c) function pub fn set_finalized_state( &self, state: LightClientState, ) -> ::ethers::contract::builders::ContractCall { self.0 - .method_hash([32, 42, 10, 219], (state,)) + .method_hash([181, 173, 234, 60], (state,)) .expect("method not found (this should never happen)") } ///Calls the contract's `setHotShotDownSince` (0x2d52aad6) function @@ -1688,19 +1525,8 @@ pub mod light_client_mock { pub fn states( &self, index: u32, - ) -> ::ethers::contract::builders::ContractCall< - M, - ( - u64, - u64, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ::ethers::core::types::U256, - ), - > { + ) -> ::ethers::contract::builders::ContractCall + { self.0 .method_hash([127, 23, 186, 173], index) .expect("method not found (this should never happen)") @@ -2792,7 +2618,7 @@ pub mod light_client_mock { abi = "UPGRADE_INTERFACE_VERSION()" )] pub struct UpgradeInterfaceVersionCall; - ///Container type for all input parameters for the `computeStakeTableComm` function with signature `computeStakeTableComm((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256))` and selector `0xaa922732` + ///Container type for all input parameters for the `computeStakeTableComm` function with signature `computeStakeTableComm((uint256,uint256,uint256,uint256))` and selector `0x6f96bdae` #[derive( Clone, ::ethers::contract::EthCall, @@ -2807,10 +2633,10 @@ pub mod light_client_mock { )] #[ethcall( name = "computeStakeTableComm", - abi = "computeStakeTableComm((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256))" + abi = "computeStakeTableComm((uint256,uint256,uint256,uint256))" )] pub struct ComputeStakeTableCommCall { - pub state: LightClientState, + pub state: StakeState, } ///Container type for all input parameters for the `disablePermissionedProverMode` function with signature `disablePermissionedProverMode()` and selector `0x69cc6a04` #[derive( @@ -3000,7 +2826,7 @@ pub mod light_client_mock { )] #[ethcall(name = "getVersion", abi = "getVersion()")] pub struct GetVersionCall; - ///Container type for all input parameters for the `initialize` function with signature `initialize((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256),uint32,address)` and selector `0x8ed3e045` + ///Container type for all input parameters for the `initialize` function with signature `initialize((uint64,uint64,uint256),(uint256,uint256,uint256,uint256),uint32,address)` and selector `0x9baa3cc9` #[derive( Clone, ::ethers::contract::EthCall, @@ -3015,7 +2841,7 @@ pub mod light_client_mock { )] #[ethcall( name = "initialize", - abi = "initialize((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256),uint32,address)" + abi = "initialize((uint64,uint64,uint256),(uint256,uint256,uint256,uint256),uint32,address)" )] pub struct InitializeCall { pub genesis: LightClientState, @@ -3044,7 +2870,7 @@ pub mod light_client_mock { pub block_number: ::ethers::core::types::U256, pub threshold: ::ethers::core::types::U256, } - ///Container type for all input parameters for the `newFinalizedState` function with signature `newFinalizedState((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256),((uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))` and selector `0x409939b7` + ///Container type for all input parameters for the `newFinalizedState` function with signature `newFinalizedState((uint64,uint64,uint256),((uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))` and selector `0x2063d4f7` #[derive( Clone, ::ethers::contract::EthCall, @@ -3054,7 +2880,7 @@ pub mod light_client_mock { )] #[ethcall( name = "newFinalizedState", - abi = "newFinalizedState((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256),((uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))" + abi = "newFinalizedState((uint64,uint64,uint256),((uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))" )] pub struct NewFinalizedStateCall { pub new_state: LightClientState, @@ -3138,7 +2964,7 @@ pub mod light_client_mock { )] #[ethcall(name = "renounceOwnership", abi = "renounceOwnership()")] pub struct RenounceOwnershipCall; - ///Container type for all input parameters for the `setFinalizedState` function with signature `setFinalizedState((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256))` and selector `0x202a0adb` + ///Container type for all input parameters for the `setFinalizedState` function with signature `setFinalizedState((uint64,uint64,uint256))` and selector `0xb5adea3c` #[derive( Clone, ::ethers::contract::EthCall, @@ -3153,7 +2979,7 @@ pub mod light_client_mock { )] #[ethcall( name = "setFinalizedState", - abi = "setFinalizedState((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256))" + abi = "setFinalizedState((uint64,uint64,uint256))" )] pub struct SetFinalizedStateCall { pub state: LightClientState, @@ -3916,7 +3742,7 @@ pub mod light_client_mock { Hash, )] pub struct UpgradeInterfaceVersionReturn(pub ::std::string::String); - ///Container type for all return fields from the `computeStakeTableComm` function with signature `computeStakeTableComm((uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256))` and selector `0xaa922732` + ///Container type for all return fields from the `computeStakeTableComm` function with signature `computeStakeTableComm((uint256,uint256,uint256,uint256))` and selector `0x6f96bdae` #[derive( Clone, ::ethers::contract::EthAbiType, @@ -3947,11 +3773,6 @@ pub mod light_client_mock { pub view_num: u64, pub block_height: u64, pub block_comm_root: ::ethers::core::types::U256, - pub fee_ledger_comm: ::ethers::core::types::U256, - pub stake_table_bls_key_comm: ::ethers::core::types::U256, - pub stake_table_schnorr_key_comm: ::ethers::core::types::U256, - pub stake_table_amount_comm: ::ethers::core::types::U256, - pub threshold: ::ethers::core::types::U256, } ///Container type for all return fields from the `frozenStakeTableCommitment` function with signature `frozenStakeTableCommitment()` and selector `0x382b215a` #[derive( @@ -4017,11 +3838,6 @@ pub mod light_client_mock { pub view_num: u64, pub block_height: u64, pub block_comm_root: ::ethers::core::types::U256, - pub fee_ledger_comm: ::ethers::core::types::U256, - pub stake_table_bls_key_comm: ::ethers::core::types::U256, - pub stake_table_schnorr_key_comm: ::ethers::core::types::U256, - pub stake_table_amount_comm: ::ethers::core::types::U256, - pub threshold: ::ethers::core::types::U256, } ///Container type for all return fields from the `getFinalizedState` function with signature `getFinalizedState()` and selector `0x82d07ff3` #[derive( @@ -4244,11 +4060,6 @@ pub mod light_client_mock { pub view_num: u64, pub block_height: u64, pub block_comm_root: ::ethers::core::types::U256, - pub fee_ledger_comm: ::ethers::core::types::U256, - pub stake_table_bls_key_comm: ::ethers::core::types::U256, - pub stake_table_schnorr_key_comm: ::ethers::core::types::U256, - pub stake_table_amount_comm: ::ethers::core::types::U256, - pub threshold: ::ethers::core::types::U256, } ///Container type for all return fields from the `votingStakeTableCommitment` function with signature `votingStakeTableCommitment()` and selector `0x76b6b7cb` #[derive( diff --git a/contract-bindings/src/shared_types.rs b/contract-bindings/src/shared_types.rs index c2531a1ed..ff73ac624 100644 --- a/contract-bindings/src/shared_types.rs +++ b/contract-bindings/src/shared_types.rs @@ -105,7 +105,7 @@ pub struct HotShotCommitment { pub block_height: u64, pub block_comm_root: ::ethers::core::types::U256, } -///`LightClientState(uint64,uint64,uint256,uint256,uint256,uint256,uint256,uint256)` +///`LightClientState(uint64,uint64,uint256)` #[derive( Clone, ::ethers::contract::EthAbiType, @@ -122,11 +122,6 @@ pub struct LightClientState { pub view_num: u64, pub block_height: u64, pub block_comm_root: ::ethers::core::types::U256, - pub fee_ledger_comm: ::ethers::core::types::U256, - pub stake_table_bls_key_comm: ::ethers::core::types::U256, - pub stake_table_schnorr_key_comm: ::ethers::core::types::U256, - pub stake_table_amount_comm: ::ethers::core::types::U256, - pub threshold: ::ethers::core::types::U256, } ///`StakeState(uint256,uint256,uint256,uint256)` #[derive( diff --git a/contracts/rust/adapter/src/light_client.rs b/contracts/rust/adapter/src/light_client.rs index 30ce0933d..5b905d913 100644 --- a/contracts/rust/adapter/src/light_client.rs +++ b/contracts/rust/adapter/src/light_client.rs @@ -17,11 +17,6 @@ pub struct ParsedLightClientState { pub view_num: u64, pub block_height: u64, pub block_comm_root: U256, - pub fee_ledger_comm: U256, - pub bls_key_comm: U256, - pub schnorr_key_comm: U256, - pub amount_comm: U256, - pub threshold: U256, } impl ParsedLightClientState { @@ -35,11 +30,6 @@ impl ParsedLightClientState { view_num: 0, block_height: 0, block_comm_root: U256::from(0), - fee_ledger_comm: U256::from(0), - bls_key_comm: U256::from(123), - schnorr_key_comm: U256::from(123), - amount_comm: U256::from(20), - threshold: U256::from(1), } } } @@ -58,11 +48,6 @@ impl From for ParsedLightClientState { view_num: field_to_u256(pi.view_number()).as_u64(), block_height: field_to_u256(pi.block_height()).as_u64(), block_comm_root: field_to_u256(pi.block_comm_root()), - fee_ledger_comm: field_to_u256(pi.fee_ledger_comm()), - bls_key_comm: field_to_u256(pi.qc_key_comm()), - schnorr_key_comm: field_to_u256(pi.state_key_comm()), - amount_comm: field_to_u256(pi.stake_amount_comm()), - threshold: field_to_u256(pi.threshold()), } } } @@ -73,42 +58,27 @@ impl From for ParsedLightClie view_num: state.view_num, block_height: state.block_height, block_comm_root: state.block_comm_root, - fee_ledger_comm: state.fee_ledger_comm, - bls_key_comm: state.stake_table_bls_key_comm, - schnorr_key_comm: state.stake_table_schnorr_key_comm, - amount_comm: state.stake_table_amount_comm, - threshold: state.threshold, } } } impl From for PublicInput { fn from(s: ParsedLightClientState) -> Self { - let fields = vec![ - u256_to_field(s.threshold), + let fields: Vec, 4>> = vec![ CircuitField::from(s.view_num), CircuitField::from(s.block_height), u256_to_field(s.block_comm_root), - u256_to_field(s.fee_ledger_comm), - u256_to_field(s.bls_key_comm), - u256_to_field(s.schnorr_key_comm), - u256_to_field(s.amount_comm), ]; Self::from(fields) } } -impl From<(u64, u64, U256, U256, U256, U256, U256, U256)> for ParsedLightClientState { - fn from(s: (u64, u64, U256, U256, U256, U256, U256, U256)) -> Self { +impl From<(u64, u64, U256)> for ParsedLightClientState { + fn from(s: (u64, u64, U256)) -> Self { Self { view_num: s.0, block_height: s.1, block_comm_root: s.2, - fee_ledger_comm: s.3, - bls_key_comm: s.4, - schnorr_key_comm: s.5, - amount_comm: s.6, - threshold: s.7, } } } @@ -119,12 +89,6 @@ impl From for LightClientState { view_number: s.view_num as usize, block_height: s.block_height as usize, block_comm_root: u256_to_field(s.block_comm_root), - fee_ledger_comm: u256_to_field(s.fee_ledger_comm), - stake_table_comm: ( - u256_to_field(s.bls_key_comm), - u256_to_field(s.schnorr_key_comm), - u256_to_field(s.amount_comm), - ), } } } @@ -160,13 +124,14 @@ impl ParsedStakeState { } } } -impl From for ParsedStakeState { - fn from(s: ParsedLightClientState) -> Self { + +impl From for StakeState { + fn from(s: ParsedStakeState) -> Self { Self { - threshold: s.threshold, - bls_key_comm: s.bls_key_comm, - schnorr_key_comm: s.schnorr_key_comm, - amount_comm: s.amount_comm, + threshold: u256_to_field(s.threshold), + stake_table_bls_key_comm: u256_to_field(s.bls_key_comm), + stake_table_schnorr_key_comm: u256_to_field(s.schnorr_key_comm), + stake_table_amount_comm: u256_to_field(s.amount_comm), } } } @@ -179,17 +144,6 @@ impl FromStr for ParsedStakeState { } } -impl From for ParsedStakeState { - fn from(pi: PublicInput) -> Self { - Self { - threshold: field_to_u256(pi.threshold()), - bls_key_comm: field_to_u256(pi.qc_key_comm()), - schnorr_key_comm: field_to_u256(pi.state_key_comm()), - amount_comm: field_to_u256(pi.stake_amount_comm()), - } - } -} - impl From for ParsedStakeState { fn from(state: contract_bindings::light_client::StakeState) -> Self { Self { @@ -201,18 +155,6 @@ impl From for ParsedStakeState { } } -impl From for PublicInput { - fn from(s: ParsedStakeState) -> Self { - let fields = vec![ - u256_to_field(s.threshold), - u256_to_field(s.bls_key_comm), - u256_to_field(s.schnorr_key_comm), - u256_to_field(s.amount_comm), - ]; - Self::from(fields) - } -} - impl From<(U256, U256, U256, U256)> for ParsedStakeState { fn from(s: (U256, U256, U256, U256)) -> Self { Self { @@ -224,17 +166,6 @@ impl From<(U256, U256, U256, U256)> for ParsedStakeState { } } -impl From for StakeState { - fn from(s: ParsedStakeState) -> Self { - Self { - threshold: u256_to_field(s.threshold), - stake_table_bls_key_comm: u256_to_field(s.bls_key_comm), - stake_table_schnorr_key_comm: u256_to_field(s.schnorr_key_comm), - stake_table_amount_comm: u256_to_field(s.amount_comm), - } - } -} - impl From for contract_bindings::light_client::StakeState { fn from(s: ParsedStakeState) -> Self { // exactly the same struct with same field types, safe to transmute diff --git a/contracts/rust/diff-test/src/main.rs b/contracts/rust/diff-test/src/main.rs index e92cfd3ce..f2f5d3859 100644 --- a/contracts/rust/diff-test/src/main.rs +++ b/contracts/rust/diff-test/src/main.rs @@ -10,7 +10,10 @@ use ethers::{ abi::{AbiDecode, AbiEncode, Address}, types::{Bytes, U256}, }; -use hotshot_contract_adapter::{jellyfish::*, light_client::ParsedLightClientState}; +use hotshot_contract_adapter::{ + jellyfish::*, + light_client::{ParsedLightClientState, ParsedStakeState}, +}; use hotshot_state_prover::mock_ledger::{ gen_plonk_proof_for_test, MockLedger, MockSystemParam, BLOCKS_PER_EPOCH, STAKE_TABLE_CAPACITY, }; @@ -469,8 +472,13 @@ fn main() { let pp = MockSystemParam::init(BLOCKS_PER_EPOCH); let ledger = MockLedger::init(pp, num_init_validators as usize); - let (voting_st_comm, frozen_st_comm) = ledger.get_stake_table_comms(); - let res = (ledger.get_state(), voting_st_comm, frozen_st_comm); + let (voting_st_comm, frozen_st_comm, stake_table) = ledger.get_stake_table_comms(); + let res = ( + ledger.get_state(), + voting_st_comm, + frozen_st_comm, + stake_table, + ); println!("{}", res.encode_hex()); } Action::MockConsecutiveFinalizedStates => { @@ -487,6 +495,7 @@ fn main() { let mut new_states: Vec = vec![]; let mut proofs: Vec = vec![]; + let mut stake_stakes: Vec = vec![]; for i in 1..block_per_epoch + 2 { // only update stake table at the last block, as it would only take effect in next epoch anyway. if i == block_per_epoch { @@ -503,9 +512,17 @@ fn main() { ledger.elapse_with_block(); - let (pi, proof) = ledger.gen_state_proof(); + let (pi, proof, stt) = ledger.gen_state_proof(); new_states.push(pi.into()); proofs.push(proof.into()); + + let parsed_stake_state = ParsedStakeState { + threshold: field_to_u256(stt.threshold), + bls_key_comm: field_to_u256(stt.stake_table_bls_key_comm), + schnorr_key_comm: field_to_u256(stt.stake_table_schnorr_key_comm), + amount_comm: field_to_u256(stt.stake_table_amount_comm), + }; + stake_stakes.push(parsed_stake_state.into()); } let res = (new_states, proofs); @@ -533,7 +550,7 @@ fn main() { } let res = if require_valid_proof { - let (pi, proof) = ledger.gen_state_proof(); + let (pi, proof, stt) = ledger.gen_state_proof(); let pi_parsed: ParsedLightClientState = pi.into(); let proof_parsed: ParsedPlonkProof = proof.into(); (pi_parsed, proof_parsed) @@ -555,7 +572,7 @@ fn main() { ledger.elapse_with_block(); // first block in epoch 1 - let (pi, proof) = ledger.gen_state_proof(); + let (pi, proof, stt) = ledger.gen_state_proof(); new_states.push(pi.into()); proofs.push(proof.into()); diff --git a/contracts/script/LightClient.s.sol b/contracts/script/LightClient.s.sol index de9a6fe39..03ea91260 100644 --- a/contracts/script/LightClient.s.sol +++ b/contracts/script/LightClient.s.sol @@ -9,7 +9,12 @@ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy contract DeployLightClientContractScript is Script { function run(uint32 numInitValidators, uint32 stateHistoryRetentionPeriod) external - returns (address payable proxyAddress, address admin, LC.LightClientState memory) + returns ( + address payable proxyAddress, + address admin, + LC.LightClientState memory, + LC.StakeState memory + ) { // TODO for a production deployment provide the right genesis state and value @@ -19,37 +24,30 @@ contract DeployLightClientContractScript is Script { cmds[2] = vm.toString(uint256(numInitValidators)); bytes memory result = vm.ffi(cmds); - (LC.LightClientState memory state,,) = - abi.decode(result, (LC.LightClientState, bytes32, bytes32)); - - LC.StakeState memory stakeState = LC.StakeState( - state.threshold, - state.stakeTableBlsKeyComm, - state.stakeTableSchnorrKeyComm, - state.stakeTableAmountComm - ); + (LC.LightClientState memory state,,, LC.StakeState memory stakeState) = + abi.decode(result, (LC.LightClientState, bytes32, bytes32, LC.StakeState)); return deployContract(state, stakeState, stateHistoryRetentionPeriod); } - function runDemo(uint32 stateHistoryRetentionPeriod) - external - returns (address payable proxyAddress, address admin, LC.LightClientState memory) - { - string[] memory cmds = new string[](1); - cmds[0] = "gen-demo-genesis"; - - bytes memory result = vm.ffi(cmds); - LC.LightClientState memory state = abi.decode(result, (LC.LightClientState)); - LC.StakeState memory stakeState = LC.StakeState( - state.threshold, - state.stakeTableBlsKeyComm, - state.stakeTableSchnorrKeyComm, - state.stakeTableAmountComm - ); - - return deployContract(state, stakeState, stateHistoryRetentionPeriod); - } + // function runDemo(uint32 stateHistoryRetentionPeriod) + // external + // returns (address payable proxyAddress, address admin, LC.LightClientState memory) + // { + // string[] memory cmds = new string[](1); + // cmds[0] = "gen-demo-genesis"; + + // bytes memory result = vm.ffi(cmds); + // LC.LightClientState memory state = abi.decode(result, (LC.LightClientState)); + // LC.StakeState memory stakeState = LC.StakeState( + // state.threshold, + // state.stakeTableBlsKeyComm, + // state.stakeTableSchnorrKeyComm, + // state.stakeTableAmountComm + // ); + + // return deployContract(state, stakeState, stateHistoryRetentionPeriod); + // } /// @notice deploys the impl, proxy & initializes the impl /// @return proxyAddress The address of the proxy @@ -59,7 +57,15 @@ contract DeployLightClientContractScript is Script { LC.LightClientState memory state, LC.StakeState memory stakeState, uint32 stateHistoryRetentionPeriod - ) private returns (address payable proxyAddress, address admin, LC.LightClientState memory) { + ) + private + returns ( + address payable proxyAddress, + address admin, + LC.LightClientState memory, + LC.StakeState memory + ) + { string memory seedPhrase = vm.envString("MNEMONIC"); (admin,) = deriveRememberKey(seedPhrase, 0); vm.startBroadcast(admin); @@ -81,6 +87,6 @@ contract DeployLightClientContractScript is Script { proxyAddress = payable(address(proxy)); - return (proxyAddress, admin, state); + return (proxyAddress, admin, state, stakeState); } } diff --git a/contracts/script/LightClientWithDefender.s.sol b/contracts/script/LightClientWithDefender.s.sol index 629076b32..c0fd0ffbf 100644 --- a/contracts/script/LightClientWithDefender.s.sol +++ b/contracts/script/LightClientWithDefender.s.sol @@ -30,7 +30,9 @@ contract LightClientDefenderDeployScript is Script { cmds[2] = vm.toString(uint256(numInitValidators)); bytes memory result = vm.ffi(cmds); - (state,,) = abi.decode(result, (LC.LightClientState, bytes32, bytes32)); + LC.StakeState memory stakeState; + (state,,, stakeState) = + abi.decode(result, (LC.LightClientState, bytes32, bytes32, LC.StakeState)); ApprovalProcessResponse memory upgradeApprovalProcess = Defender.getUpgradeApprovalProcess(); multisig = upgradeApprovalProcess.via; @@ -49,13 +51,6 @@ contract LightClientDefenderDeployScript is Script { opts.defender.useDefenderDeploy = true; opts.defender.salt = bytes32(abi.encodePacked(contractSalt)); - LC.StakeState memory stakeState = LC.StakeState( - state.threshold, - state.stakeTableBlsKeyComm, - state.stakeTableSchnorrKeyComm, - state.stakeTableAmountComm - ); - proxy = Upgrades.deployUUPSProxy( contractName, abi.encodeCall( diff --git a/contracts/src/LightClient.sol b/contracts/src/LightClient.sol index e9eae5898..0a2bb62cf 100644 --- a/contracts/src/LightClient.sol +++ b/contracts/src/LightClient.sol @@ -94,20 +94,10 @@ contract LightClient is Initializable, OwnableUpgradeable, UUPSUpgradeable { /// @param viewNum The latest view number of the finalized HotShot chain /// @param blockHeight The block height of the latest finalized block /// @param blockCommRoot The merkle root of historical block commitments (BN254::ScalarField) - /// @param feeLedgerComm The commitment to the fee ledger state (type: BN254::ScalarField) - /// @param stakeTableBlsKeyComm The commitment to the BlsVerKey column of the stake table - /// @param stakeTableSchnorrKeyComm The commitment to the SchnorrVerKey column of the table - /// @param stakeTableAmountComm The commitment to the stake amount column of the stake table - /// @param threshold The (stake-weighted) quorum threshold for a QC to be considered as valid struct LightClientState { uint64 viewNum; uint64 blockHeight; BN254.ScalarField blockCommRoot; - BN254.ScalarField feeLedgerComm; - BN254.ScalarField stakeTableBlsKeyComm; - BN254.ScalarField stakeTableSchnorrKeyComm; - BN254.ScalarField stakeTableAmountComm; - uint256 threshold; } /// @notice The finalized HotShot Stake state (as the digest of the entire HotShot state) @@ -227,10 +217,10 @@ contract LightClient is Initializable, OwnableUpgradeable, UUPSUpgradeable { // feeLedgerComm can be zero, if we optionally support fee ledger yet. if ( _genesis.viewNum != 0 || _genesis.blockHeight != 0 - || BN254.ScalarField.unwrap(_genesis.stakeTableBlsKeyComm) == 0 - || BN254.ScalarField.unwrap(_genesis.stakeTableSchnorrKeyComm) == 0 - || BN254.ScalarField.unwrap(_genesis.stakeTableAmountComm) == 0 - || _genesis.threshold == 0 + || BN254.ScalarField.unwrap(_genesisStakeState.stakeTableBlsKeyComm) == 0 + || BN254.ScalarField.unwrap(_genesisStakeState.stakeTableSchnorrKeyComm) == 0 + || BN254.ScalarField.unwrap(_genesisStakeState.stakeTableAmountComm) == 0 + || _genesisStakeState.threshold == 0 ) { revert InvalidArgs(); } @@ -240,11 +230,11 @@ contract LightClient is Initializable, OwnableUpgradeable, UUPSUpgradeable { stateHistoryRetentionPeriod = _stateHistoryRetentionPeriod; - bytes32 initStakeTableComm = computeStakeTableComm(_genesis); + bytes32 initStakeTableComm = computeStakeTableComm(_genesisStakeState); votingStakeTableCommitment = initStakeTableComm; - votingThreshold = _genesis.threshold; + votingThreshold = _genesisStakeState.threshold; frozenStakeTableCommitment = initStakeTableComm; - frozenThreshold = _genesis.threshold; + frozenThreshold = _genesisStakeState.threshold; updateStateHistory(uint64(block.number), uint64(block.timestamp), _genesis); } @@ -281,10 +271,6 @@ contract LightClient is Initializable, OwnableUpgradeable, UUPSUpgradeable { } // format validity check BN254.validateScalarField(newState.blockCommRoot); - BN254.validateScalarField(newState.feeLedgerComm); - BN254.validateScalarField(newState.stakeTableBlsKeyComm); - BN254.validateScalarField(newState.stakeTableSchnorrKeyComm); - BN254.validateScalarField(newState.stakeTableAmountComm); // check plonk proof verifyProof(newState, proof); @@ -326,10 +312,6 @@ contract LightClient is Initializable, OwnableUpgradeable, UUPSUpgradeable { publicInput[1] = uint256(state.viewNum); publicInput[2] = uint256(state.blockHeight); publicInput[3] = BN254.ScalarField.unwrap(state.blockCommRoot); - publicInput[4] = BN254.ScalarField.unwrap(state.feeLedgerComm); - publicInput[5] = BN254.ScalarField.unwrap(finalizedState.stakeTableBlsKeyComm); - publicInput[6] = BN254.ScalarField.unwrap(finalizedState.stakeTableSchnorrKeyComm); - publicInput[7] = BN254.ScalarField.unwrap(finalizedState.stakeTableAmountComm); if (!PlonkVerifier.verify(vk, publicInput, proof)) { revert InvalidProof(); @@ -337,12 +319,7 @@ contract LightClient is Initializable, OwnableUpgradeable, UUPSUpgradeable { } /// @notice Given the light client state, compute the short commitment of the stake table - function computeStakeTableComm(LightClientState memory state) - public - pure - virtual - returns (bytes32) - { + function computeStakeTableComm(StakeState memory state) public pure virtual returns (bytes32) { return keccak256( abi.encodePacked( state.stakeTableBlsKeyComm, diff --git a/contracts/test/DeployLightClientTestScript.s.sol b/contracts/test/DeployLightClientTestScript.s.sol index 264596600..1b489b383 100644 --- a/contracts/test/DeployLightClientTestScript.s.sol +++ b/contracts/test/DeployLightClientTestScript.s.sol @@ -20,15 +20,8 @@ contract DeployLightClientTestScript is Script { cmds[2] = vm.toString(uint256(numInitValidators)); bytes memory result = vm.ffi(cmds); - (LC.LightClientState memory state,,) = - abi.decode(result, (LC.LightClientState, bytes32, bytes32)); - - LC.StakeState memory stakeState = LC.StakeState( - state.threshold, - state.stakeTableBlsKeyComm, - state.stakeTableSchnorrKeyComm, - state.stakeTableAmountComm - ); + (LC.LightClientState memory state,,, LC.StakeState memory stakeState) = + abi.decode(result, (LC.LightClientState, bytes32, bytes32, LC.StakeState)); return deployContract(state, stakeState, stateHistoryRetentionPeriod, owner); } @@ -51,24 +44,24 @@ contract DeployLightClientTestScript is Script { return (lcTestProxy, admin, state); } - function runDemo(uint32 stateHistoryRetentionPeriod, address owner) - external - returns (address payable proxyAddress, address admin, LC.LightClientState memory) - { - string[] memory cmds = new string[](1); - cmds[0] = "gen-demo-genesis"; - - bytes memory result = vm.ffi(cmds); - LC.LightClientState memory state = abi.decode(result, (LC.LightClientState)); - LC.StakeState memory stakeState = LC.StakeState( - state.threshold, - state.stakeTableBlsKeyComm, - state.stakeTableSchnorrKeyComm, - state.stakeTableAmountComm - ); - - return deployContract(state, stakeState, stateHistoryRetentionPeriod, owner); - } + // function runDemo(uint32 stateHistoryRetentionPeriod, address owner) + // external + // returns (address payable proxyAddress, address admin, LC.LightClientState memory) + // { + // string[] memory cmds = new string[](1); + // cmds[0] = "gen-demo-genesis"; + + // bytes memory result = vm.ffi(cmds); + // LC.LightClientState memory state = abi.decode(result, (LC.LightClientState)); + // LC.StakeState memory stakeState = LC.StakeState( + // state.threshold, + // state.stakeTableBlsKeyComm, + // state.stakeTableSchnorrKeyComm, + // state.stakeTableAmountComm + // ); + + // return deployContract(state, stakeState, stateHistoryRetentionPeriod, owner); + // } /// @notice deploys the impl, proxy & initializes the impl /// @return proxyAddress The address of the proxy diff --git a/contracts/test/LightClient.t.sol b/contracts/test/LightClient.t.sol index be4b8475b..3778ab8f8 100644 --- a/contracts/test/LightClient.t.sol +++ b/contracts/test/LightClient.t.sol @@ -58,21 +58,21 @@ contract LightClientCommonTest is Test { cmds[2] = vm.toString(STAKE_TABLE_CAPACITY / 2); bytes memory result = vm.ffi(cmds); - (LC.LightClientState memory state, bytes32 votingSTComm, bytes32 frozenSTComm) = - abi.decode(result, (LC.LightClientState, bytes32, bytes32)); + ( + LC.LightClientState memory state, + bytes32 votingSTComm, + bytes32 frozenSTComm, + LC.StakeState memory stakeState + ) = abi.decode(result, (LC.LightClientState, bytes32, bytes32, LC.StakeState)); genesis = state; - genesisStakeState = LC.StakeState( - state.threshold, - state.stakeTableBlsKeyComm, - state.stakeTableSchnorrKeyComm, - state.stakeTableAmountComm - ); + genesisStakeState = stakeState; (lcTestProxy, admin) = deployAndInitProxy(genesis, genesisStakeState, MAX_HISTORY_SECONDS); - bytes32 expectedStakeTableComm = lc.computeStakeTableComm(state); + bytes32 expectedStakeTableComm = lc.computeStakeTableComm(genesisStakeState); assertEq(votingSTComm, expectedStakeTableComm); assertEq(frozenSTComm, expectedStakeTableComm); + // assertEq(genesisStakeState, lc.genesisStakeState()); } function assertEq(BN254.ScalarField a, BN254.ScalarField b) public pure { @@ -91,58 +91,59 @@ contract LightClient_constructor_Test is LightClientCommonTest { assertEq(abi.encode(lc.getGenesisState()), abi.encode(genesis)); assertEq(abi.encode(lc.getFinalizedState()), abi.encode(genesis)); - bytes32 stakeTableComm = lc.computeStakeTableComm(genesis); + bytes32 stakeTableComm = lc.computeStakeTableComm(genesisStakeState); assertEq(lc.votingStakeTableCommitment(), stakeTableComm); assertEq(lc.frozenStakeTableCommitment(), stakeTableComm); - assertEq(lc.votingThreshold(), genesis.threshold); - assertEq(lc.frozenThreshold(), genesis.threshold); + assertEq(lc.votingThreshold(), genesisStakeState.threshold); + assertEq(lc.frozenThreshold(), genesisStakeState.threshold); } // @dev helper function to be able to initialize the contract and capture the revert error function initWithExpectRevert( LC.LightClientState memory _genesis, + LC.StakeState memory _genesisStakeState, uint32 _stateHistoryRetentionPeriod ) private { vm.expectRevert(LC.InvalidArgs.selector); - LC.StakeState memory _genesisStakeState = LC.StakeState( - _genesis.threshold, - _genesis.stakeTableBlsKeyComm, - _genesis.stakeTableSchnorrKeyComm, - _genesis.stakeTableAmountComm - ); lc = new LCMock(_genesis, _genesisStakeState, _stateHistoryRetentionPeriod); } function test_RevertWhen_InvalidGenesis() external { LC.LightClientState memory badGenesis = genesis; + LC.StakeState memory badGenesisStakeState = genesisStakeState; // wrong viewNum would revert badGenesis.viewNum = 1; - initWithExpectRevert(badGenesis, MAX_HISTORY_SECONDS); + initWithExpectRevert(badGenesis, badGenesisStakeState, MAX_HISTORY_SECONDS); badGenesis.viewNum = genesis.viewNum; // revert to correct // wrong blockHeight would revert badGenesis.blockHeight = 1; - initWithExpectRevert(badGenesis, MAX_HISTORY_SECONDS); + initWithExpectRevert(badGenesis, badGenesisStakeState, MAX_HISTORY_SECONDS); badGenesis.blockHeight = genesis.blockHeight; // revert to correct // zero-valued stake table commitments would revert - badGenesis.stakeTableBlsKeyComm = BN254.ScalarField.wrap(0); - initWithExpectRevert(badGenesis, MAX_HISTORY_SECONDS); - badGenesis.stakeTableBlsKeyComm = genesis.stakeTableBlsKeyComm; // revert to correct - badGenesis.stakeTableSchnorrKeyComm = BN254.ScalarField.wrap(0); - initWithExpectRevert(badGenesis, MAX_HISTORY_SECONDS); - badGenesis.stakeTableSchnorrKeyComm = genesis.stakeTableSchnorrKeyComm; // revert to correct - badGenesis.stakeTableAmountComm = BN254.ScalarField.wrap(0); + badGenesisStakeState.stakeTableBlsKeyComm = BN254.ScalarField.wrap(0); + initWithExpectRevert(badGenesis, badGenesisStakeState, MAX_HISTORY_SECONDS); + + badGenesisStakeState.stakeTableBlsKeyComm = badGenesisStakeState.stakeTableBlsKeyComm; // revert + // to correct + badGenesisStakeState.stakeTableSchnorrKeyComm = BN254.ScalarField.wrap(0); + initWithExpectRevert(badGenesis, badGenesisStakeState, MAX_HISTORY_SECONDS); + + badGenesisStakeState.stakeTableSchnorrKeyComm = + badGenesisStakeState.stakeTableSchnorrKeyComm; // revert to correct + badGenesisStakeState.stakeTableAmountComm = BN254.ScalarField.wrap(0); - initWithExpectRevert(badGenesis, MAX_HISTORY_SECONDS); - badGenesis.stakeTableAmountComm = genesis.stakeTableAmountComm; // revert to correct + initWithExpectRevert(badGenesis, badGenesisStakeState, MAX_HISTORY_SECONDS); + badGenesisStakeState.stakeTableAmountComm = badGenesisStakeState.stakeTableAmountComm; // revert + // to correct // zero-valued threshold would revert - badGenesis.threshold = 0; - initWithExpectRevert(badGenesis, MAX_HISTORY_SECONDS); - badGenesis.threshold = genesis.threshold; // revert to correct + badGenesisStakeState.threshold = 0; + initWithExpectRevert(badGenesis, badGenesisStakeState, MAX_HISTORY_SECONDS); + badGenesisStakeState.threshold = badGenesisStakeState.threshold; // revert to correct } } @@ -338,8 +339,8 @@ contract LightClient_newFinalizedState_Test is LightClientCommonTest { cmds[2] = vm.toString(numInitValidators); bytes memory result = vm.ffi(cmds); - (LC.LightClientState memory state,,) = - abi.decode(result, (LC.LightClientState, bytes32, bytes32)); + (LC.LightClientState memory state,,,) = + abi.decode(result, (LC.LightClientState, bytes32, bytes32, LC.StakeState)); genesis = state; (lcTestProxy, admin) = deployAndInitProxy(genesis, genesisStakeState, MAX_HISTORY_SECONDS); @@ -367,11 +368,11 @@ contract LightClient_newFinalizedState_Test is LightClientCommonTest { assertEq(abi.encode(lc.getFinalizedState()), abi.encode(states[i])); - bytes32 stakeTableComm = lc.computeStakeTableComm(genesis); + bytes32 stakeTableComm = lc.computeStakeTableComm(genesisStakeState); assertEq(lc.votingStakeTableCommitment(), stakeTableComm); assertEq(lc.frozenStakeTableCommitment(), stakeTableComm); - assertEq(lc.votingThreshold(), genesis.threshold); - assertEq(lc.frozenThreshold(), genesis.threshold); + assertEq(lc.votingThreshold(), genesisStakeState.threshold); + assertEq(lc.frozenThreshold(), genesisStakeState.threshold); } } @@ -399,11 +400,11 @@ contract LightClient_newFinalizedState_Test is LightClientCommonTest { vm.prank(permissionedProver); lc.newFinalizedState(state, proof); - bytes32 stakeTableComm = lc.computeStakeTableComm(genesis); + bytes32 stakeTableComm = lc.computeStakeTableComm(genesisStakeState); assertEq(lc.votingStakeTableCommitment(), stakeTableComm); assertEq(lc.frozenStakeTableCommitment(), stakeTableComm); - assertEq(lc.votingThreshold(), genesis.threshold); - assertEq(lc.frozenThreshold(), genesis.threshold); + assertEq(lc.votingThreshold(), genesisStakeState.threshold); + assertEq(lc.frozenThreshold(), genesisStakeState.threshold); } /// @dev Test unhappy path when a valid but oudated finalized state is submitted @@ -457,31 +458,6 @@ contract LightClient_newFinalizedState_Test is LightClientCommonTest { vm.expectRevert("Bn254: invalid scalar field"); lc.newFinalizedState(badState, proof); badState.blockCommRoot = newState.blockCommRoot; - - // invalid scalar for feeLedgerComm - badState.feeLedgerComm = BN254.ScalarField.wrap(BN254.R_MOD + 1); - vm.expectRevert("Bn254: invalid scalar field"); - lc.newFinalizedState(badState, proof); - badState.feeLedgerComm = newState.feeLedgerComm; - - // invalid scalar for stakeTableBlsKeyComm - badState.stakeTableBlsKeyComm = BN254.ScalarField.wrap(BN254.R_MOD + 2); - vm.expectRevert("Bn254: invalid scalar field"); - lc.newFinalizedState(badState, proof); - badState.stakeTableBlsKeyComm = newState.stakeTableBlsKeyComm; - - // invalid scalar for stakeTableSchnorrKeyComm - badState.stakeTableSchnorrKeyComm = BN254.ScalarField.wrap(BN254.R_MOD + 3); - vm.expectRevert("Bn254: invalid scalar field"); - lc.newFinalizedState(badState, proof); - badState.stakeTableSchnorrKeyComm = newState.stakeTableSchnorrKeyComm; - - // invalid scalar for stakeTableAmountComm - badState.stakeTableAmountComm = BN254.ScalarField.wrap(BN254.R_MOD + 4); - vm.expectRevert("Bn254: invalid scalar field"); - lc.newFinalizedState(badState, proof); - badState.stakeTableAmountComm = newState.stakeTableAmountComm; - vm.stopPrank(); } /// @dev Test unhappy path when the plonk proof or the public inputs are wrong @@ -498,7 +474,11 @@ contract LightClient_newFinalizedState_Test is LightClientCommonTest { abi.decode(result, (LC.LightClientState, V.PlonkProof)); BN254.ScalarField randScalar = BN254.ScalarField.wrap(1234); - LC.LightClientState memory badState = newState; + LC.LightClientState memory badState = LC.LightClientState({ + viewNum: newState.viewNum, + blockHeight: newState.blockHeight, + blockCommRoot: newState.blockCommRoot + }); // wrong view num vm.startPrank(permissionedProver); @@ -519,30 +499,6 @@ contract LightClient_newFinalizedState_Test is LightClientCommonTest { lc.newFinalizedState(badState, proof); badState.blockCommRoot = newState.blockCommRoot; - // wrong feeLedgerComm - badState.feeLedgerComm = randScalar; - vm.expectRevert(LC.InvalidProof.selector); - lc.newFinalizedState(badState, proof); - badState.feeLedgerComm = newState.feeLedgerComm; - - // wrong stakeTableBlsKeyComm - badState.stakeTableBlsKeyComm = randScalar; - vm.expectRevert(LC.InvalidProof.selector); - lc.newFinalizedState(badState, proof); - badState.stakeTableBlsKeyComm = newState.stakeTableBlsKeyComm; - - // wrong stakeTableSchnorrKeyComm - badState.stakeTableSchnorrKeyComm = randScalar; - vm.expectRevert(LC.InvalidProof.selector); - lc.newFinalizedState(badState, proof); - badState.stakeTableSchnorrKeyComm = newState.stakeTableSchnorrKeyComm; - - // wrong stakeTableAmountComm - badState.stakeTableAmountComm = randScalar; - vm.expectRevert(LC.InvalidProof.selector); - lc.newFinalizedState(badState, proof); - badState.stakeTableAmountComm = newState.stakeTableAmountComm; - cmds = new string[](3); cmds[0] = "diff-test"; cmds[1] = "dummy-proof"; @@ -566,9 +522,15 @@ contract LightClient_newFinalizedState_Test is LightClientCommonTest { (LC.LightClientState memory newState, V.PlonkProof memory proof) = abi.decode(result, (LC.LightClientState, V.PlonkProof)); + LC.LightClientState memory newLCState = LC.LightClientState({ + viewNum: newState.viewNum, + blockHeight: newState.blockHeight, + blockCommRoot: newState.blockCommRoot + }); + vm.expectRevert(LC.InvalidProof.selector); vm.prank(permissionedProver); - lc.newFinalizedState(newState, proof); + lc.newFinalizedState(newLCState, proof); } } diff --git a/contracts/test/LightClientUpgradeSameContract.t.sol b/contracts/test/LightClientUpgradeSameContract.t.sol index ca094a69a..4333de9ab 100644 --- a/contracts/test/LightClientUpgradeSameContract.t.sol +++ b/contracts/test/LightClientUpgradeSameContract.t.sol @@ -16,6 +16,7 @@ contract LightClientUpgradeSameContractTest is Test { UpgradeLightClientScript public upgrader = new UpgradeLightClientScript(); LCV1.LightClientState public stateV1; + LCV1.StakeState public stakeStateV1; address public admin; address public proxy; @@ -24,7 +25,7 @@ contract LightClientUpgradeSameContractTest is Test { // deploy the first implementation with its proxy function setUp() public { - (proxy, admin, stateV1) = deployer.run(5, MAX_HISTORY_SECONDS); + (proxy, admin, stateV1, stakeStateV1) = deployer.run(5, MAX_HISTORY_SECONDS); lcV1Proxy = LCV1(proxy); } @@ -33,11 +34,11 @@ contract LightClientUpgradeSameContractTest is Test { assertEq(abi.encode(lcV1Proxy.getFinalizedState()), abi.encode(stateV1)); - bytes32 stakeTableComm = lcV1Proxy.computeStakeTableComm(stateV1); + bytes32 stakeTableComm = lcV1Proxy.computeStakeTableComm(stakeStateV1); assertEq(lcV1Proxy.votingStakeTableCommitment(), stakeTableComm); assertEq(lcV1Proxy.frozenStakeTableCommitment(), stakeTableComm); - assertEq(lcV1Proxy.votingThreshold(), stateV1.threshold); - assertEq(lcV1Proxy.frozenThreshold(), stateV1.threshold); + assertEq(lcV1Proxy.votingThreshold(), stakeStateV1.threshold); + assertEq(lcV1Proxy.frozenThreshold(), stakeStateV1.threshold); } // that the data remains the same after upgrading the implementation @@ -47,16 +48,8 @@ contract LightClientUpgradeSameContractTest is Test { // of the upgraded contract is set to 0 lcV2Proxy = LCV2(upgrader.run(0, proxy)); - LCV2.LightClientState memory expectedLightClientState = LCV2.LightClientState( - stateV1.viewNum, - stateV1.blockHeight, - stateV1.blockCommRoot, - stateV1.feeLedgerComm, - stateV1.stakeTableBlsKeyComm, - stateV1.stakeTableSchnorrKeyComm, - stateV1.stakeTableAmountComm, - stateV1.threshold - ); + LCV2.LightClientState memory expectedLightClientState = + LCV2.LightClientState(stateV1.viewNum, stateV1.blockHeight, stateV1.blockCommRoot); assertEq(abi.encode(lcV2Proxy.getFinalizedState()), abi.encode(expectedLightClientState)); } diff --git a/contracts/test/LightClientUpgradeToVx.t.sol b/contracts/test/LightClientUpgradeToVx.t.sol index 66227c41e..98ae33974 100644 --- a/contracts/test/LightClientUpgradeToVx.t.sol +++ b/contracts/test/LightClientUpgradeToVx.t.sol @@ -23,6 +23,7 @@ contract LightClientUpgradeToVxTest is Test { ULCV3 public upgraderV3 = new ULCV3(); LCV1.LightClientState public stateV1; + LCV1.StakeState public stakeStateV1; address public admin; address public proxy; @@ -31,7 +32,7 @@ contract LightClientUpgradeToVxTest is Test { // deploy the first implementation with its proxy function setUp() public { - (proxy, admin, stateV1) = deployer.run(5, MAX_HISTORY_SECONDS); + (proxy, admin, stateV1, stakeStateV1) = deployer.run(5, MAX_HISTORY_SECONDS); lcV1Proxy = LCV1(proxy); } @@ -40,11 +41,11 @@ contract LightClientUpgradeToVxTest is Test { assertEq(abi.encode(lcV1Proxy.getFinalizedState()), abi.encode(stateV1)); - bytes32 stakeTableComm = lcV1Proxy.computeStakeTableComm(stateV1); + bytes32 stakeTableComm = lcV1Proxy.computeStakeTableComm(stakeStateV1); assertEq(lcV1Proxy.votingStakeTableCommitment(), stakeTableComm); assertEq(lcV1Proxy.frozenStakeTableCommitment(), stakeTableComm); - assertEq(lcV1Proxy.votingThreshold(), stateV1.threshold); - assertEq(lcV1Proxy.frozenThreshold(), stateV1.threshold); + assertEq(lcV1Proxy.votingThreshold(), stakeStateV1.threshold); + assertEq(lcV1Proxy.frozenThreshold(), stakeStateV1.threshold); } // test that the data remains the same after upgrading the implementation @@ -57,16 +58,8 @@ contract LightClientUpgradeToVxTest is Test { assertEq(lcV2Proxy.newField(), myNewField); - LCV1.LightClientState memory expectedLightClientState = LCV1.LightClientState( - stateV1.viewNum, - stateV1.blockHeight, - stateV1.blockCommRoot, - stateV1.feeLedgerComm, - stateV1.stakeTableBlsKeyComm, - stateV1.stakeTableSchnorrKeyComm, - stateV1.stakeTableAmountComm, - stateV1.threshold - ); + LCV1.LightClientState memory expectedLightClientState = + LCV1.LightClientState(stateV1.viewNum, stateV1.blockHeight, stateV1.blockCommRoot); LCV2.ExtendedLightClientState memory expectedExtendedLightClientState = LCV2.ExtendedLightClientState(0); @@ -88,16 +81,8 @@ contract LightClientUpgradeToVxTest is Test { assertEq(lcV2Proxy.newField(), myNewField); - LCV1.LightClientState memory expectedLightClientState = LCV1.LightClientState( - stateV1.viewNum, - stateV1.blockHeight, - stateV1.blockCommRoot, - stateV1.feeLedgerComm, - stateV1.stakeTableBlsKeyComm, - stateV1.stakeTableSchnorrKeyComm, - stateV1.stakeTableAmountComm, - stateV1.threshold - ); + LCV1.LightClientState memory expectedLightClientState = + LCV1.LightClientState(stateV1.viewNum, stateV1.blockHeight, stateV1.blockCommRoot); LCV2.ExtendedLightClientState memory expectedExtendedLightClientState = LCV2.ExtendedLightClientState(0); @@ -124,16 +109,8 @@ contract LightClientUpgradeToVxTest is Test { assertEq(lcV2Proxy.newField(), myNewField); - LCV1.LightClientState memory expectedLightClientState = LCV1.LightClientState( - stateV1.viewNum, - stateV1.blockHeight, - stateV1.blockCommRoot, - stateV1.feeLedgerComm, - stateV1.stakeTableBlsKeyComm, - stateV1.stakeTableSchnorrKeyComm, - stateV1.stakeTableAmountComm, - stateV1.threshold - ); + LCV1.LightClientState memory expectedLightClientState = + LCV1.LightClientState(stateV1.viewNum, stateV1.blockHeight, stateV1.blockCommRoot); LCV2.ExtendedLightClientState memory expectedExtendedLightClientState = LCV2.ExtendedLightClientState(0); @@ -169,16 +146,8 @@ contract LightClientUpgradeToVxTest is Test { assertEq(lcV2Proxy.newField(), myNewField); - LCV1.LightClientState memory expectedLightClientState = LCV1.LightClientState( - stateV1.viewNum, - stateV1.blockHeight, - stateV1.blockCommRoot, - stateV1.feeLedgerComm, - stateV1.stakeTableBlsKeyComm, - stateV1.stakeTableSchnorrKeyComm, - stateV1.stakeTableAmountComm, - stateV1.threshold - ); + LCV1.LightClientState memory expectedLightClientState = + LCV1.LightClientState(stateV1.viewNum, stateV1.blockHeight, stateV1.blockCommRoot); LCV2.ExtendedLightClientState memory expectedExtendedLightClientState = LCV2.ExtendedLightClientState(0); diff --git a/contracts/test/LightClientV2.sol b/contracts/test/LightClientV2.sol index 418aaf41c..a598ad70c 100644 --- a/contracts/test/LightClientV2.sol +++ b/contracts/test/LightClientV2.sol @@ -63,10 +63,6 @@ contract LightClientV2 is LightClient { } // format validity check BN254.validateScalarField(newState.blockCommRoot); - BN254.validateScalarField(newState.feeLedgerComm); - BN254.validateScalarField(newState.stakeTableBlsKeyComm); - BN254.validateScalarField(newState.stakeTableSchnorrKeyComm); - BN254.validateScalarField(newState.stakeTableAmountComm); // check plonk proof verifyProof(newState, proof); @@ -79,14 +75,6 @@ contract LightClientV2 is LightClient { // different data handling mechanisms // and this each field needs to be assigned individually finalizedState = newState; - // states[finalizedState].viewNum = newState.viewNum; - // states[finalizedState].blockHeight = newState.blockHeight; - // states[finalizedState].blockCommRoot = newState.blockCommRoot; - // states[finalizedState].feeLedgerComm = newState.feeLedgerComm; - // states[finalizedState].stakeTableBlsKeyComm = newState.stakeTableBlsKeyComm; - // states[finalizedState].stakeTableSchnorrKeyComm = newState.stakeTableSchnorrKeyComm; - // states[finalizedState].stakeTableAmountComm = newState.stakeTableAmountComm; - // states[finalizedState].threshold = newState.threshold; extendedFinalzedState.extraField = 2; diff --git a/contracts/test/mocks/LightClientMock.sol b/contracts/test/mocks/LightClientMock.sol index f4b7e5bc9..242efeeee 100644 --- a/contracts/test/mocks/LightClientMock.sol +++ b/contracts/test/mocks/LightClientMock.sol @@ -40,10 +40,6 @@ contract LightClientMock is LC { publicInput[1] = uint256(state.viewNum); publicInput[2] = uint256(state.blockHeight); publicInput[3] = BN254.ScalarField.unwrap(state.blockCommRoot); - publicInput[4] = BN254.ScalarField.unwrap(state.feeLedgerComm); - publicInput[5] = BN254.ScalarField.unwrap(finalizedState.stakeTableBlsKeyComm); - publicInput[6] = BN254.ScalarField.unwrap(finalizedState.stakeTableSchnorrKeyComm); - publicInput[7] = BN254.ScalarField.unwrap(finalizedState.stakeTableAmountComm); if (!PlonkVerifier.verify(vk, publicInput, proof)) { revert InvalidProof(); diff --git a/hotshot-state-prover/src/circuit.rs b/hotshot-state-prover/src/circuit.rs index c903473f9..7fb3907e7 100644 --- a/hotshot-state-prover/src/circuit.rs +++ b/hotshot-state-prover/src/circuit.rs @@ -51,7 +51,7 @@ pub struct LightClientStateVar { /// `vars[2]`: block commitment root /// `vars[3]`: fee ledger commitment /// `vars[4-6]`: stake table commitment - vars: [Variable; 7], + vars: [Variable; 3], } impl LightClientStateVar { @@ -68,10 +68,6 @@ impl LightClientStateVar { circuit.create_public_variable(view_number_f)?, circuit.create_public_variable(block_height_f)?, circuit.create_public_variable(state.block_comm_root)?, - circuit.create_public_variable(state.fee_ledger_comm)?, - circuit.create_public_variable(state.stake_table_comm.0)?, - circuit.create_public_variable(state.stake_table_comm.1)?, - circuit.create_public_variable(state.stake_table_comm.2)?, ], }) } @@ -257,10 +253,6 @@ where view_number_f, block_height_f, lightclient_state.block_comm_root, - lightclient_state.fee_ledger_comm, - lightclient_state.stake_table_comm.0, - lightclient_state.stake_table_comm.1, - lightclient_state.stake_table_comm.2, ]; // Checking whether the accumulated weight exceeds the quorum threshold @@ -359,8 +351,6 @@ where view_number: 0, block_height: 0, block_comm_root: F::default(), - fee_ledger_comm: F::default(), - stake_table_comm: (F::default(), F::default(), F::default()), }; build::( &[], @@ -410,18 +400,13 @@ mod tests { let block_comm_root = VariableLengthRescueCRHF::::evaluate(vec![F::from(1u32), F::from(2u32)]).unwrap() [0]; - let fee_ledger_comm = - VariableLengthRescueCRHF::::evaluate(vec![F::from(3u32), F::from(5u32)]).unwrap() - [0]; let lightclient_state = GenericLightClientState { view_number: 100, block_height: 73, block_comm_root, - fee_ledger_comm, - stake_table_comm: st.commitment(SnapshotVersion::LastEpochStart).unwrap(), }; - let state_msg: [F; 7] = lightclient_state.clone().into(); + let state_msg: [F; 3] = lightclient_state.clone().into(); let sigs = state_keys .iter() @@ -527,7 +512,7 @@ mod tests { // bad path: bad stake table commitment let mut bad_lightclient_state = lightclient_state.clone(); bad_lightclient_state.stake_table_comm.1 = F::default(); - let bad_state_msg: [F; 7] = bad_lightclient_state.clone().into(); + let bad_state_msg: [F; 3] = bad_lightclient_state.clone().into(); let sig_for_bad_state = state_keys .iter() .map(|(key, _)| { @@ -552,7 +537,7 @@ mod tests { let mut wrong_light_client_state = lightclient_state.clone(); // state with a different qc key commitment wrong_light_client_state.stake_table_comm.0 = F::default(); - let wrong_state_msg: [F; 7] = wrong_light_client_state.into(); + let wrong_state_msg: [F; 3] = wrong_light_client_state.into(); let wrong_sigs = state_keys .iter() .map(|(key, _)| { diff --git a/hotshot-state-prover/src/mock_ledger.rs b/hotshot-state-prover/src/mock_ledger.rs index f31f641a3..b33ffc73f 100644 --- a/hotshot-state-prover/src/mock_ledger.rs +++ b/hotshot-state-prover/src/mock_ledger.rs @@ -15,12 +15,15 @@ use ethers::{ utils, }; use hotshot_contract_adapter::{ - jellyfish::{field_to_u256, open_key, u256_to_field}, - light_client::ParsedLightClientState, + jellyfish::{field_to_u256, open_key, u256_to_field /* , u256_to_field*/}, + light_client::{ParsedLightClientState, ParsedStakeState}, }; use hotshot_stake_table::vec_based::StakeTable; use hotshot_types::{ - light_client::{GenericLightClientState, GenericPublicInput, LightClientState}, + light_client::{ + GenericLightClientState, GenericPublicInput, GenericStakeState, LightClientState, + StakeState, + }, traits::stake_table::{SnapshotVersion, StakeTableScheme}, }; use itertools::izip; @@ -99,14 +102,14 @@ impl MockLedger { // arbitrary commitment values as they don't affect logic being tested let block_comm_root = F::from(1234); - let fee_ledger_comm = F::from(5678); + // let fee_ledger_comm: ark_ff::Fp, 4> = F::from(5678); let genesis = LightClientState { view_number: 0, block_height: 0, block_comm_root, - fee_ledger_comm, - stake_table_comm: st.commitment(SnapshotVersion::LastEpochStart).unwrap(), + // fee_ledger_comm, + // stake_table_comm: st.commitment(SnapshotVersion::LastEpochStart).unwrap(), }; Self { pp, @@ -137,12 +140,11 @@ impl MockLedger { } let new_root = self.new_dummy_comm(); - let new_fee_ledger_comm = self.new_dummy_comm(); + // let new_fee_ledger_comm = self.new_dummy_comm(); self.state.view_number += 1; self.state.block_height += 1; self.state.block_comm_root = new_root; - self.state.fee_ledger_comm = new_fee_ledger_comm; } /// Elapse a view without a new finalized block @@ -208,8 +210,8 @@ impl MockLedger { } /// Return the light client state and proof of consensus on this finalized state - pub fn gen_state_proof(&mut self) -> (GenericPublicInput, Proof) { - let state_msg: [F; 7] = self.state.clone().into(); + pub fn gen_state_proof(&mut self) -> (GenericPublicInput, Proof, GenericStakeState) { + let state_msg: [F; 3] = self.state.clone().into(); let st: Vec<(BLSVerKey, U256, SchnorrVerKey)> = self .st @@ -282,22 +284,35 @@ impl MockLedger { STAKE_TABLE_CAPACITY, ) .expect("Fail to generate state proof"); - (pi, proof) + + let stake_table_comm = self + .st + .clone() + .commitment(SnapshotVersion::LastEpochStart) + .unwrap(); + let stt = StakeState { + threshold: u256_to_field(self.threshold), + stake_table_bls_key_comm: stake_table_comm.clone().0, + stake_table_schnorr_key_comm: stake_table_comm.clone().1, + stake_table_amount_comm: stake_table_comm.clone().2, + }; + + (pi, proof, stt) } /// a malicious attack, generating a fake stake table full of adversarial stakers /// adv-controlled stakers signed the state and replace the stake table commitment with that of the fake one /// in an attempt to hijack the correct stake table. pub fn gen_state_proof_with_fake_stakers(&mut self) -> (GenericPublicInput, Proof) { - let mut new_state = self.state.clone(); + let new_state = self.state.clone(); let (adv_qc_keys, adv_state_keys) = key_pairs_for_testing(STAKE_TABLE_CAPACITY, &mut self.rng); let adv_st = stake_table_for_testing(&adv_qc_keys, &adv_state_keys); // replace new state with adversarial stake table commitment - new_state.stake_table_comm = adv_st.commitment(SnapshotVersion::EpochStart).unwrap(); - let state_msg: [F; 7] = new_state.clone().into(); + // new_state.stake_table_comm = adv_st.commitment(SnapshotVersion::EpochStart).unwrap(); + let state_msg: [F; 3] = new_state.clone().into(); // every fake stakers sign on the adverarial new state let bit_vec = vec![true; STAKE_TABLE_CAPACITY]; @@ -347,21 +362,16 @@ impl MockLedger { pub fn get_state(&self) -> ParsedLightClientState { // The ugly conversion due to slight difference of `LightClientState` in solidity containing `threshold` let pi = vec![ - u256_to_field(self.threshold), F::from(self.state.view_number as u64), F::from(self.state.block_height as u64), self.state.block_comm_root, - self.state.fee_ledger_comm, - self.state.stake_table_comm.0, - self.state.stake_table_comm.1, - self.state.stake_table_comm.2, ]; let pi: GenericPublicInput = pi.into(); pi.into() } /// Returns the (bytes32 votingStakeTableComm, bytes32 frozenStakeTableComm) used in contract - pub fn get_stake_table_comms(&self) -> (H256, H256) { + pub fn get_stake_table_comms(&self) -> (H256, H256, ParsedStakeState) { let (bls_key_comm, schnorr_key_comm, amount_comm) = self.st.commitment(SnapshotVersion::EpochStart).unwrap(); let frozen_st_comm = utils::keccak256( @@ -384,7 +394,18 @@ impl MockLedger { .unwrap(), ); - (voting_st_comm.into(), frozen_st_comm.into()) + let stake_table: ParsedStakeState = ParsedStakeState { + threshold: self.threshold, + bls_key_comm: field_to_u256(bls_key_comm), + schnorr_key_comm: field_to_u256(schnorr_key_comm), + amount_comm: field_to_u256(amount_comm), + }; + + ( + voting_st_comm.into(), + frozen_st_comm.into(), + stake_table.into(), + ) } // return a dummy commitment value diff --git a/hotshot-state-prover/src/service.rs b/hotshot-state-prover/src/service.rs index e7ff14ac2..3def06ec2 100644 --- a/hotshot-state-prover/src/service.rs +++ b/hotshot-state-prover/src/service.rs @@ -22,8 +22,8 @@ use ethers::{ }; use futures::FutureExt; use hotshot_contract_adapter::{ - jellyfish::{u256_to_field, ParsedPlonkProof}, - light_client::ParsedLightClientState, + jellyfish::{field_to_u256, u256_to_field, ParsedPlonkProof}, + light_client::{ParsedLightClientState, ParsedStakeState}, }; use hotshot_stake_table::vec_based::{config::FieldType, StakeTable}; use hotshot_types::{ @@ -200,6 +200,35 @@ pub fn light_client_genesis_from_stake_table( Ok(pi.into()) } +pub async fn light_client_genesis_stake( + sequencer_url: &Url, + stake_table_capacity: usize, +) -> anyhow::Result { + let st = init_stake_table_from_sequencer(sequencer_url, stake_table_capacity) + .await + .with_context(|| "Failed to initialize stake table")?; + light_client_genesis_stake_from_stake_table(st) +} + +#[inline] +pub fn light_client_genesis_stake_from_stake_table( + st: StakeTable, +) -> anyhow::Result { + let (bls_comm, schnorr_comm, stake_comm) = st + .commitment(SnapshotVersion::LastEpochStart) + .expect("Commitment computation shouldn't fail."); + let threshold = one_honest_threshold(st.total_stake(SnapshotVersion::LastEpochStart)?); + + let stt = ParsedStakeState { + threshold: threshold, + bls_key_comm: field_to_u256(bls_comm), + schnorr_key_comm: field_to_u256(schnorr_comm), + amount_comm: field_to_u256(stake_comm), + }; + + Ok(stt) +} + pub fn load_proving_key(stake_table_capacity: usize) -> ProvingKey { let srs = { let num_gates = crate::circuit::build_for_preprocessing::< @@ -352,7 +381,7 @@ pub async fn sync_state( entries.iter().enumerate().for_each(|(i, (key, stake))| { if let Some(sig) = bundle.signatures.get(key) { // Check if the signature is valid - let state_msg: [FieldType; 7] = (&bundle.state).into(); + let state_msg: [FieldType; 3] = (&bundle.state).into(); if key.verify(&state_msg, sig, CS_ID_SCHNORR).is_ok() { signer_bit_vec[i] = true; signatures[i] = sig.clone(); @@ -584,14 +613,7 @@ mod test { schnorr_key_comm: {:x?},\ amount_comm: {:x?},\ threshold: {}", - genesis.view_num, - genesis.block_height, - genesis.block_comm_root, - genesis.fee_ledger_comm, - genesis.bls_key_comm.encode_hex(), - genesis.schnorr_key_comm.encode_hex(), - genesis.amount_comm.encode_hex(), - genesis.threshold, + genesis.view_num, genesis.block_height, genesis.block_comm_root, ); (genesis, stake_genesis, qc_keys, state_keys, st) } @@ -605,7 +627,7 @@ mod test { ) -> (PublicInput, Proof) { let mut rng = test_rng(); - let new_state_msg: [CircuitField; 7] = { + let new_state_msg: [CircuitField; 3] = { // sorry for the complicated .into() conversion chain, might improve in the future let pi_msg: LightClientState = new_state.clone().into(); pi_msg.into() diff --git a/hotshot-state-prover/src/snark.rs b/hotshot-state-prover/src/snark.rs index 08ab7a80b..89c60922f 100644 --- a/hotshot-state-prover/src/snark.rs +++ b/hotshot-state-prover/src/snark.rs @@ -215,10 +215,10 @@ mod tests { view_number: 100, block_height: 73, block_comm_root, - fee_ledger_comm, - stake_table_comm: st.commitment(SnapshotVersion::LastEpochStart).unwrap(), + // fee_ledger_comm, + // stake_table_comm: st.commitment(SnapshotVersion::LastEpochStart).unwrap(), }; - let state_msg: [CircuitField; 7] = lightclient_state.clone().into(); + let state_msg: [CircuitField; 3] = lightclient_state.clone().into(); let sigs = schnorr_keys .iter() diff --git a/sequencer/src/api.rs b/sequencer/src/api.rs index 0e628ab78..4dedce900 100644 --- a/sequencer/src/api.rs +++ b/sequencer/src/api.rs @@ -628,6 +628,11 @@ pub mod test_helpers { light_client_genesis_from_stake_table(st).unwrap() } + pub fn light_client_genesis_stake(&self) -> ParsedStakeState { + let st = self.cfg.stake_table(); + light_client_genesis_stake_from_stake_table(st).unwrap() + } + pub async fn stop_consensus(&mut self) { self.server.shutdown_consensus().await; diff --git a/sequencer/src/bin/deploy.rs b/sequencer/src/bin/deploy.rs index 5552ff5d8..8e98fb04b 100644 --- a/sequencer/src/bin/deploy.rs +++ b/sequencer/src/bin/deploy.rs @@ -3,7 +3,7 @@ use std::{fs::File, io::stdout, path::PathBuf}; use clap::Parser; use futures::FutureExt; use hotshot_stake_table::config::STAKE_TABLE_CAPACITY; -use hotshot_state_prover::service::light_client_genesis; +use hotshot_state_prover::service::{light_client_genesis, light_client_genesis_stake}; use sequencer_utils::{ deployer::{deploy, ContractGroup, Contracts, DeployedContracts}, logging, @@ -101,6 +101,8 @@ async fn main() -> anyhow::Result<()> { let sequencer_url = opt.sequencer_url.clone(); let genesis = light_client_genesis(&sequencer_url, opt.stake_table_capacity).boxed(); + let genesis_stake = + light_client_genesis_stake(&sequencer_url, opt.stake_table_capacity).boxed(); let contracts = deploy( opt.rpc_url, @@ -109,6 +111,7 @@ async fn main() -> anyhow::Result<()> { opt.use_mock_contract, opt.only, genesis, + genesis_stake, contracts, ) .await?; diff --git a/sequencer/src/bin/espresso-dev-node.rs b/sequencer/src/bin/espresso-dev-node.rs index f5172b607..1329451f9 100644 --- a/sequencer/src/bin/espresso-dev-node.rs +++ b/sequencer/src/bin/espresso-dev-node.rs @@ -196,6 +196,7 @@ async fn main() -> anyhow::Result<()> { tracing::info!("Hotshot config {config:?}"); let light_client_genesis = network.light_client_genesis(); + let light_client_genesis_stake = network.light_client_genesis_stake(); let contracts = Contracts::new(); let mut light_client_addresses = vec![]; @@ -240,6 +241,7 @@ async fn main() -> anyhow::Result<()> { true, None, async { Ok(light_client_genesis.clone()) }.boxed(), + async { Ok(light_client_genesis_stake.clone()) }.boxed(), contracts.clone(), ) .await?; diff --git a/sequencer/src/state_signature.rs b/sequencer/src/state_signature.rs index cf4e7e041..997366526 100644 --- a/sequencer/src/state_signature.rs +++ b/sequencer/src/state_signature.rs @@ -164,8 +164,6 @@ fn form_light_client_state( view_number: leaf.view_number().u64() as usize, block_height: leaf.height() as usize, block_comm_root: hash_bytes_to_field(&block_comm_root_bytes)?, - fee_ledger_comm: hash_bytes_to_field(&fee_ledger_comm_bytes)?, - stake_table_comm: *stake_table_comm, }) } diff --git a/sequencer/src/state_signature/relay_server.rs b/sequencer/src/state_signature/relay_server.rs index de61ba92d..d17b728a5 100644 --- a/sequencer/src/state_signature/relay_server.rs +++ b/sequencer/src/state_signature/relay_server.rs @@ -114,7 +114,7 @@ impl StateRelayServerDataSource for StateRelayServerState { // StatusCode::Unauthorized, // "The posted key is not found in the stake table.".to_owned(), // ))?; - let state_msg: [FieldType; 7] = (&state).into(); + let state_msg: [FieldType; 3] = (&state).into(); if StateSignatureScheme::verify(&(), &key, state_msg, &signature).is_err() { return Err(tide_disco::error::ServerError::catch_all( StatusCode::BAD_REQUEST, diff --git a/utils/src/deployer.rs b/utils/src/deployer.rs index 14644f469..948f11100 100644 --- a/utils/src/deployer.rs +++ b/utils/src/deployer.rs @@ -311,6 +311,7 @@ pub async fn deploy( use_mock_contract: bool, only: Option>, genesis: BoxFuture<'_, anyhow::Result>, + genesis_stake: BoxFuture<'_, anyhow::Result>, mut contracts: Contracts, ) -> anyhow::Result { let provider = Provider::::try_from(l1url.to_string())?; @@ -358,10 +359,10 @@ pub async fn deploy( let light_client = LightClient::new(lc_address, l1.clone()); let genesis = genesis.await?.clone(); - let parsed_stake_state: ParsedStakeState = genesis.clone().into(); + let genesis_stake = genesis_stake.await?.clone(); let data = light_client - .initialize(genesis.into(), parsed_stake_state.into(), 864000, owner) + .initialize(genesis.into(), genesis_stake.into(), 864000, owner) .calldata() .context("calldata for initialize transaction not available")?; contracts