From 104e13500fdab38b95694335683ba652a5fb683d Mon Sep 17 00:00:00 2001 From: Naohiro Yoshida Date: Thu, 25 Jul 2024 17:58:58 +0900 Subject: [PATCH] validate turn_length Signed-off-by: Naohiro Yoshida --- light-client/src/client.rs | 33 ++++++++++++++------------- light-client/src/errors.rs | 8 +++++++ light-client/src/fixture/localnet.rs | 4 ++-- light-client/src/header/eth_header.rs | 17 ++++++++------ 4 files changed, 37 insertions(+), 25 deletions(-) diff --git a/light-client/src/client.rs b/light-client/src/client.rs index 65176fb..0d25acc 100644 --- a/light-client/src/client.rs +++ b/light-client/src/client.rs @@ -985,16 +985,26 @@ mod test { // Detect misbehavior // Use blocks of two local nets with the same ChainID(=9999) and validator set. - let any = hex!("0a282f6962632e6c69676874636c69656e74732e7061726c69612e76312e4d69736265686176696f757212b1340a0b78782d7061726c69612d31128f1a0a90060a8d06f9030aa025ffb3920008fd0591adc665132f7296d4d3da213f27ad5f13c29bae6b53b150a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794a7876ea32e7a748c697d01345145485561305b24a03feedbe444fcdaeea389d10588435b9657b71aea384266ac09e15c0772ea6bc9a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028204a58402625a00808465122d33b90111d98301020b846765746889676f312e31392e3133856c696e75780000e904d98cf8ae07b8608ce4e95f382e2d06eb6c98641c574069f7c8cfdb482a4c58290f9f2ee86f6d4ce520d7bb6a6be1acd082c07a9d65b45f1334def3c66fc793003cf06f3fcea7ce055b34aa911f6ff7b9bf2eb083f3e7010a34e8c61aa70edd8ad630c82f3d4a8bf8488204a3a02d59fc7d664ae17504839bf6c49ca0e21fa794fe661c86e929a522bd4872d3458204a4a025ffb3920008fd0591adc665132f7296d4d3da213f27ad5f13c29bae6b53b1508022216e66d52050e392e6a6b86f677363e01be8deb6611cab76cada1bfd6c0b7048798c2376f52d8357d8aeb6e6c0109dd802675c849dff145dc3dd470fc7bce400a000000000000000000000000000000000000000000000000000000000000000008800000000000000000a90060a8d06f9030aa09432b9b136e91a12cea5e9cc363bc821e90da6c7b2d7f369533afa746ac21508a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794d9a13701eafb76870cb220843b8c6476824bfa15a03feedbe444fcdaeea389d10588435b9657b71aea384266ac09e15c0772ea6bc9a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028204a68402625a00808465122d36b90111d98301020b846765746889676f312e31392e3133856c696e75780000e904d98cf8ae07b8608f21cd736cba2bf8c4af32f237f4851282c77b602f3e5ef48c48e16b36fae2f8a80bdb501d48c235b3409ec53340742919fbab1a54cde9da53886da4e7280a7c450714fbdd1dd5907a9f4990fb99e1badebba671d521d47f1cdd23ce3eec2e90f8488204a4a025ffb3920008fd0591adc665132f7296d4d3da213f27ad5f13c29bae6b53b1508204a5a09432b9b136e91a12cea5e9cc363bc821e90da6c7b2d7f369533afa746ac21508804b8debfb8d55a7f71547fd88e1c40eb0efe960d32d08601589e22a62bb0ebeb26b984bba8f736484ae789567e5d9563104126e78181a293d6ee504e9ad35725801a000000000000000000000000000000000000000000000000000000000000000008800000000000000000a90060a8d06f9030aa086efaa0d95f31de170d88687b07806f3bf271bf842b65f6dd76b326e1575e609a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948fdaaa7e6631e438625ca25c857a3727ea28e565a03feedbe444fcdaeea389d10588435b9657b71aea384266ac09e15c0772ea6bc9a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028204a78402625a00808465122d39b90111d98301020b846765746889676f312e31392e3133856c696e75780000e904d98cf8ae07b86094c8bc4a6ed9b43a592f7c7a035e27b119ff45ea9e7e6ab149136ab18f268499c6d6d920aab86608315093fffaa354cf0077173664aebe97ca185285e739559a01c96d04a30df92c23ce051b1700c8fabd41e1ac8db8229a3c08a067a60a4ee7f8488204a5a09432b9b136e91a12cea5e9cc363bc821e90da6c7b2d7f369533afa746ac215088204a6a086efaa0d95f31de170d88687b07806f3bf271bf842b65f6dd76b326e1575e6098085641457482587c8687b5e40069f915f48961cad6069305c278fb117d4661cd80c92987afd0b4e44e794945580feeedece4b1b68098b6134de8be2ed2245aa8b01a00000000000000000000000000000000000000000000000000000000000000000880000000000000000120310a0091aaa04f90227f901d1a06ed7d26d8a14a9cd8aeb3f01960cae49b7e95dbd549fff6556694ea3ee3dc173a0c445c1e18313a154c9cfd1a1bdbf2fb6d7513227c59c5cfe4ed6b2f1585ea74ea06c664a574aeaa739d85b114d13a20a15330b02565910dfb142b6715b5742a562a0726016a81a8017e5825a30ad9481c2ea45a35601f9e17a25ef74fb2fcc093ecb80a019977eb86a7f4c991220db91b3be76de8c43b5f5ea5414ad2ae17d27226ff633a075d1dffd2abda435b74cfaccf176f5e0938c60d66068a44727add2ef2df1f3eea0c993119ba273a56742e6fa6f92bb58a0120a3b3d27200340be21bc37ae8fdce2a04f3e6cb5f42f4cfe12e8e586e820edf8460ca87b27b4823c129d986c127e4898a07def82f69a90079ffaeaa69f6fda2b28363547c376948939c06aa8206c51c022a0b84308f4cb54366a086a4fdd936c40ab7ba0429ca9b7a624a6db6c5ac35c0b9ca041feda5565ebddc0a30be2e0fef75fe61729344ec36395f2f1e60865cd434a58a01223a2c45e23b4266f6b786bb346c31ea0c18ac94135d2f5138cc2851f7bf44a80a00d690f6252aa5118f41dce0eb3fdd420419d6d73ef7d51559385cab56a0308e2a054529b9b4e918ca60d7d2c1f1c9104a1442f9dcee09012b637ec7bd7ec46702680f8518080808080808080a00f079d6471365442c66c0559bffebac0b429bc330e636338e9c5dac3bd3fbaf7808080a0e2ec5bfa0874d74ec0fdffc07602dab45aa5a426ed8ce5c3f11c957ef5ccecca8080808022448fdaaa7e6631e438625ca25c857a3727ea28e5658bb6a87761d9668637faacae15f907dd813ea1df4f85062fa5535765c198bb9d55293684a75d3a12e65215a8b410f2072244a7876ea32e7a748c697d01345145485561305b24a4f05ea3dd58373394ba3a7ca3cabec78b69e044b2b09e82171d82e6e3998a9ed1f82226cd4540bcc8c3bafa8c9c72512244d9a13701eafb76870cb220843b8c6476824bfa15ab63700b5d3f58338176990c8488a7c319480310b5ec39d23453839ff26116b29a91e20f834835c5e6f670961d7df8ff2a448fdaaa7e6631e438625ca25c857a3727ea28e5658bb6a87761d9668637faacae15f907dd813ea1df4f85062fa5535765c198bb9d55293684a75d3a12e65215a8b410f2072a44a7876ea32e7a748c697d01345145485561305b24a4f05ea3dd58373394ba3a7ca3cabec78b69e044b2b09e82171d82e6e3998a9ed1f82226cd4540bcc8c3bafa8c9c72512a44d9a13701eafb76870cb220843b8c6476824bfa15ab63700b5d3f58338176990c8488a7c319480310b5ec39d23453839ff26116b29a91e20f834835c5e6f670961d7df8ff1a8f1a0a90060a8d06f9030aa0312846a6b051a39d1ac8afa16dd707c278c2590b5b5399dd5dbaa2c87e9c6d04a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794a7876ea32e7a748c697d01345145485561305b24a049b529cd1d9b70dc216289fe9519c319964f0f7bd9458056da2defcf42743335a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028204a58402625a00808465122d36b90111d98301020b846765746889676f312e31392e3133856c696e75780000e904d98cf8ae07b860a0be31d422b4b017cc814dedd756cafcaff3c871779a6321284cebe91e5e1c2c0cb49b65be2a9bb41eabfc5480c8c75f0906339f62235d0b4352b3af1e38c79986cc1eb16880f26dd9c8f40bd8020890985d59f01bba4dd46df62be6a0c05414f8488204a3a0263c6cea09d25bb460401680cc3142f116c5a377f8ef11060e80f0f612f1c3168204a4a0312846a6b051a39d1ac8afa16dd707c278c2590b5b5399dd5dbaa2c87e9c6d0480f7464a0e50746e1283e82b6ea17ec53c71c61ed86665a300756b53d37dd3991346774d2ac3c242d8f0371f0ebe08f5af80757c6cd3e239212106d05d067064a300a000000000000000000000000000000000000000000000000000000000000000008800000000000000000a90060a8d06f9030aa04f09e6f36be8d56f196ab819ceab4de899dd91ea84d1a579c59cfe8d41f74269a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794d9a13701eafb76870cb220843b8c6476824bfa15a049b529cd1d9b70dc216289fe9519c319964f0f7bd9458056da2defcf42743335a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028204a68402625a00808465122d39b90111d98301020b846765746889676f312e31392e3133856c696e75780000e904d98cf8ae07b8608ae8e9f3eeb44fc2ace50cb82e7922ccfad7571f507e89282474c970cd87f2f90cb7e3e22ef872e48cc904015c4792290b172b0e9aef2090a9ee653c0f258c215314c810b42b1a4399378cfeb7e8130082d7048bbc25c56373e4167b25feb51ff8488204a4a0312846a6b051a39d1ac8afa16dd707c278c2590b5b5399dd5dbaa2c87e9c6d048204a5a04f09e6f36be8d56f196ab819ceab4de899dd91ea84d1a579c59cfe8d41f742698048e891fd5b3f1eed759866fe722882c746dab531d47e972732640e42f49365b1348eb77bdc7425486f16a59b5080dd87b9406f1d532c37b8589e4b666cfd855b00a000000000000000000000000000000000000000000000000000000000000000008800000000000000000a90060a8d06f9030aa0ccdadba9c31c3462045f7552ec31591fc033d53cc02f66efe74a7a11527dd886a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948fdaaa7e6631e438625ca25c857a3727ea28e565a049b529cd1d9b70dc216289fe9519c319964f0f7bd9458056da2defcf42743335a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028204a78402625a00808465122d3cb90111d98301020b846765746889676f312e31392e3133856c696e75780000e904d98cf8ae07b860b5564a5fdce667a739c336d6b07beec17f8afcbc72da74f98e690327c32893b81ff51a6badcb7dfc0af7de042dc3b90e0467fef125d666956f3179b5330fc7a47624858eee5cb9edc93b45677417b742d213d97205770fcd0a36d6c409f551aff8488204a5a04f09e6f36be8d56f196ab819ceab4de899dd91ea84d1a579c59cfe8d41f742698204a6a0ccdadba9c31c3462045f7552ec31591fc033d53cc02f66efe74a7a11527dd88680299e2c8ee9446f79b09078581adec0382f5f0a5f49986493802bc10349e535d71b7e2d734818374617361443398ac0a3e3a343b7ca920586db67a7dcae60018101a00000000000000000000000000000000000000000000000000000000000000000880000000000000000120310a0091aaa04f90227f901d1a06ed7d26d8a14a9cd8aeb3f01960cae49b7e95dbd549fff6556694ea3ee3dc173a010790f90204b51f76a67de8b4bd23f62ea75f921641ff583a3ec5e8d681df975a06c664a574aeaa739d85b114d13a20a15330b02565910dfb142b6715b5742a562a051b92742fd280c4a2285b18197d40134dfe7d903b7d707cea1bd5f442a78a63580a019977eb86a7f4c991220db91b3be76de8c43b5f5ea5414ad2ae17d27226ff633a022a617263a20b5549555a9424a99ea156c9337b4b2009f9274febe93638918aaa0c993119ba273a56742e6fa6f92bb58a0120a3b3d27200340be21bc37ae8fdce2a04f3e6cb5f42f4cfe12e8e586e820edf8460ca87b27b4823c129d986c127e4898a07def82f69a90079ffaeaa69f6fda2b28363547c376948939c06aa8206c51c022a0b84308f4cb54366a086a4fdd936c40ab7ba0429ca9b7a624a6db6c5ac35c0b9ca041feda5565ebddc0a30be2e0fef75fe61729344ec36395f2f1e60865cd434a58a01223a2c45e23b4266f6b786bb346c31ea0c18ac94135d2f5138cc2851f7bf44a80a00d690f6252aa5118f41dce0eb3fdd420419d6d73ef7d51559385cab56a0308e2a09ab965be5ca3cbb09432f80709f918076cbad663afd466131fd184c8bda104c480f8518080808080808080a00f079d6471365442c66c0559bffebac0b429bc330e636338e9c5dac3bd3fbaf7808080a0e2ec5bfa0874d74ec0fdffc07602dab45aa5a426ed8ce5c3f11c957ef5ccecca8080808022448fdaaa7e6631e438625ca25c857a3727ea28e5658bb6a87761d9668637faacae15f907dd813ea1df4f85062fa5535765c198bb9d55293684a75d3a12e65215a8b410f2072244a7876ea32e7a748c697d01345145485561305b24a4f05ea3dd58373394ba3a7ca3cabec78b69e044b2b09e82171d82e6e3998a9ed1f82226cd4540bcc8c3bafa8c9c72512244d9a13701eafb76870cb220843b8c6476824bfa15ab63700b5d3f58338176990c8488a7c319480310b5ec39d23453839ff26116b29a91e20f834835c5e6f670961d7df8ff2a448fdaaa7e6631e438625ca25c857a3727ea28e5658bb6a87761d9668637faacae15f907dd813ea1df4f85062fa5535765c198bb9d55293684a75d3a12e65215a8b410f2072a44a7876ea32e7a748c697d01345145485561305b24a4f05ea3dd58373394ba3a7ca3cabec78b69e044b2b09e82171d82e6e3998a9ed1f82226cd4540bcc8c3bafa8c9c72512a44d9a13701eafb76870cb220843b8c6476824bfa15ab63700b5d3f58338176990c8488a7c319480310b5ec39d23453839ff26116b29a91e20f834835c5e6f670961d7df8ff").to_vec(); + let any = hex!("0a282f6962632e6c69676874636c69656e74732e7061726c69612e76312e4d69736265686176696f757212ad3b0a0b78782d7061726c69612d3112c11c0ad5060ad206f9034fa0df813ab13cd8fa64526bab2d574bd83199f358cf875b5a7ca34c55cc59fb7841a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794a7876ea32e7a748c697d01345145485561305b24a0347db7085bed92889205f4566fdeb71b36981b2662282e5b49f74f146e1b2920a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000282022d8402625a00808466a21174b90111d98301040c846765746889676f312e32312e3132856c696e7578000060b2e37bf8ae03b860b42b097ae5430552430062d80b2015710882c0520cf58dc6b987d0aa042840525bab13a5098af712b844bccf36b2ccb009fa3796f7088dec9a5dfcc0db6e4ab502fcca21d59598bd4f7504415662ec094b6ba1555c7faa0389468e45e11e8655f84882022ba0fe631870634a3823f363cdb9c6bd572b1a3ecaa9daeb98a784610a1cd1107e4882022ca0df813ab13cd8fa64526bab2d574bd83199f358cf875b5a7ca34c55cc59fb78418008487b8053f33e79d8758655252a23e25ce9f3440557d0ed67c80700633730674c5c682fa86414f136befd54de6023cbbb74bc48edc438ad136bc34f520b264100a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080a000000000000000000000000000000000000000000000000000000000000000000ad5060ad206f9034fa09e0419600f424df6786dbbdef3f774c0a3d9a9785c8e3aec85ec4d95a2a526ada01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794a7876ea32e7a748c697d01345145485561305b24a0347db7085bed92889205f4566fdeb71b36981b2662282e5b49f74f146e1b2920a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000282022e8402625a00808466a21177b90111d98301040c846765746889676f312e32312e3132856c696e7578000060b2e37bf8ae03b86099480987f69ba68b91ea25863b7cc7881fa57156c57f04b9a1ce33fa6766522d1ddafbb4b0ebd913bedee575cf18790f163d68c5d8fc5d389206ec1baf04b7daf1b17c9b5e688f29e71bfc5c40c5327dd6a36a7fd6e043305f6fe01da6fc77bff84882022ca0df813ab13cd8fa64526bab2d574bd83199f358cf875b5a7ca34c55cc59fb784182022da09e0419600f424df6786dbbdef3f774c0a3d9a9785c8e3aec85ec4d95a2a526ad80aab31b654039b4edef9af34f1bfbff4999aafd9c007bb3925378e865a8fde7d9693646834fc0323d375029594e363a4d96d49d0d5bc1dd6d98ed87d13fcfc4a700a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080a000000000000000000000000000000000000000000000000000000000000000000ad5060ad206f9034fa0d71391dfe369c3f939c86aa6c3a25649a5ce9c298549e075981d65dc3278fadda01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794a7876ea32e7a748c697d01345145485561305b24a0347db7085bed92889205f4566fdeb71b36981b2662282e5b49f74f146e1b2920a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000282022f8402625a00808466a2117ab90111d98301040c846765746889676f312e32312e3132856c696e7578000060b2e37bf8ae03b860acd5509943efb944b23870db31f09b536731993d75078450bedefa5df77ea416d2d54be798d452d4562b57571fcf3ec00596cb4516d86b82a52081275c9ff9a35aed899b63791acbff7000f3c907c9d9f61e386c8c0de5ea79d67fd49c5675abf84882022da09e0419600f424df6786dbbdef3f774c0a3d9a9785c8e3aec85ec4d95a2a526ad82022ea0d71391dfe369c3f939c86aa6c3a25649a5ce9c298549e075981d65dc3278fadd8076a78528fffc86138b8155eaf036c0ccced82091d1cd7be5e7445d9d44b512907766334023ba1ac6b5376b39619e7198467598e549b284dcd065b4088ee0be0600a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080a00000000000000000000000000000000000000000000000000000000000000000120310ac041a9506f90312f901f1a094e7dcd05ddcc3923085b451330f3aa5ce5a628d6685506d99cb09b3aef0e11ea0cb21354718f7d012561dacf2274405cdd9bccd532afe18206bd26bf60e96c853a0b116ef7733a93eed23f018027c116e60436a228a9f9173bb9b0c40eb71216da6a09e8d71308bd38616ac52a39498cee9fcf29c440d9aacfedfc7143772c77ce54480a0a74e307420bf9966d5db9a83ce48edc32c7a8e43328c6373de6875cefa04ad7aa004371241b9d6f35e1f361f2109d19a9192a9c0c749b2bd15fcb131a1a6ce5e3ba00577e3e2c4649c5a23cbdabe0bbfed7cdf6e85c136d84d58127cdec86264ad6ea070c0f30031f40c8017dbfc2ef008e6a3aae2e3105a654e0c5439b6104752882ea08f81903ec8515875682785142e1f92bdeaf65fccd5d0cf78b1ff2905a07e5883a03052420ba2d24a04d3f830584d3dbd6907b6d82bab84ddd806d03470e2c9d51ca06fb1a1498c2c8f93944a4f672ff4e982480ad181c835c0d8078159c517c7977aa013a426820f7b7249edc97cc5c002e653ac84b437f3ac12ac940c3d4b09e09827a09fbc54eac488b27315b09a1afa8d12f168e4c4cb5aea2d9a6ab5e7266da2f7e8a077c5e5cd5bd518bc509ee5e71790f1e42e492e23875b097e565cff8e809e7c8aa0d4182165b298d7b52b0f2064d19ab8bdad2b3955fa5b3d85c00673beb97e124480f8b18080a0dc77b6ae50b675036e77b31973c79ec60c28c0d2c57b03ad99c2acfff2f0cd4e80a03f47312ca98ac1f6ae9db9752c2a33529723b64e654d87f7847cee0382edfb55a05e0f116451aaa1baab3f3abff2793c8318050eeed6bf62d464d343a11d86eb2880808080808080a0abbb1987d09a71106f586030d1ab913bae0008e2a7dec0d08f2d60cd30fb2ac8a096c706907bfc6472dd88315cb8e21ee6f60a661cd8050065e2ba387023ee96858080f869a020b1e2b1f9852058ee0aaadca3c963f77f6483a1a51c644d79386bcada360583b846f8440180a0e39304f0ec064a98e4b0a96432dfb0a9e4c7fd0f26a6bbcf9c75bff68c51a7a9a0b3d632130dcb5cb583b47ec0623e59ca3703e6e2564f144272b597f3e3511ba822448fdaaa7e6631e438625ca25c857a3727ea28e56592b50b17b5348f1aebe4c50d87c59b55223abe57c9c3df76cb4a96211bb393aacd440bac5f71ea3fc481abff6270142d2244a7876ea32e7a748c697d01345145485561305b24aed19f6cbeb659e104b4657c2e41822087506cb58b037aba5599314c2c4bea0ef4d3cbbc449b24abf396cfd71ac07af42a448fdaaa7e6631e438625ca25c857a3727ea28e56592b50b17b5348f1aebe4c50d87c59b55223abe57c9c3df76cb4a96211bb393aacd440bac5f71ea3fc481abff6270142d2a44d9a13701eafb76870cb220843b8c6476824bfa1595bd9f541fdb277d2bdd5ff223f95eb83f8d2b465c1bac3cf2d0bc551ad01a9037a4af083d66eff89b34200745db92cc300538061ad91e0ad5060ad206f9034fa0aeef6b8a15e0109c9838875b033b5c54d21c356cb5ddf395eb109b9b29ae694fa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794a7876ea32e7a748c697d01345145485561305b24a03e5bfca057d64cd5c54c82f5e213f8e7993411a5a490c0b93358f6def507e8d4a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000282022d8402625a00808466a2116eb90111d98301040c846765746889676f312e32312e3132856c696e75780000e0299c2ff8ae0fb86082b910df7cee75733375fb7716c34b14c1ce27f283c2d87ea0e2b2a0de42d18bdd724766b3a73d5daaa25befaa814df815605e8881819d421c8703100b7a93d1a22c89693625b4370d4d87b85ed676661ce65d46ef0c5c8325696892abf0d5d5f84882022ba03986751eb813b176c13e29485332e635df862b515516501e87113f50b655d80c82022ca0aeef6b8a15e0109c9838875b033b5c54d21c356cb5ddf395eb109b9b29ae694f80af43c5cc71b487cbe16b6771635dc751cbd6231274a3bbf87ae8b38c3319e5f54eb4e0a8186070727a19eb749b2e70068b7c505b1ed8b0dd7d6a595e2bf5db3601a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080a000000000000000000000000000000000000000000000000000000000000000000ad5060ad206f9034fa04a9481f17c19c739ab1961ffdba488b234d37254da0ec7e95d8cf5d4ad54893ba01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794a7876ea32e7a748c697d01345145485561305b24a03e5bfca057d64cd5c54c82f5e213f8e7993411a5a490c0b93358f6def507e8d4a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000282022e8402625a00808466a21171b90111d98301040c846765746889676f312e32312e3132856c696e75780000e0299c2ff8ae0fb860a41a9347a1766d7b59a6f4eb4434f89a5ff5e52df18b90baf4588374a65b578fdf85c4c605b325468883f22a49ce28bf1194955ae44b6de878a8def6b4c36cd5bb669be37d4a31bb7b48e45c7e0fe0d8fd43e86ba60871b6e1b7c731498d0df4f84882022ca0aeef6b8a15e0109c9838875b033b5c54d21c356cb5ddf395eb109b9b29ae694f82022da04a9481f17c19c739ab1961ffdba488b234d37254da0ec7e95d8cf5d4ad54893b80292058b3eeab2626c29d676db526a6a0d8b739a59f9d7971e5fd3e96192321e4759aa81a6bfdd5a211e3dca1d29f20fc5feffdb3261fb2afdd2fd9b4f9607fb201a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080a000000000000000000000000000000000000000000000000000000000000000000ad5060ad206f9034fa04a6b366f150065827cf5954904fdca9da5073531b4aa5462e86636feb61890aca01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794a7876ea32e7a748c697d01345145485561305b24a03e5bfca057d64cd5c54c82f5e213f8e7993411a5a490c0b93358f6def507e8d4a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000282022f8402625a00808466a21174b90111d98301040c846765746889676f312e32312e3132856c696e75780000e0299c2ff8ae0fb860a440c540974a6217ff340cbe742520fce50a18f18553f4816fdb43d9a74092ebb237ce4cce2a10f0e6d7b6ec58cf53990b91b8d2279eec1391748eab3a605cf1d900fa267dfc21cc8ebf35cb138c10287d49b3a4c1c5d18bd7727f74fa64e46ef84882022da04a9481f17c19c739ab1961ffdba488b234d37254da0ec7e95d8cf5d4ad54893b82022ea04a6b366f150065827cf5954904fdca9da5073531b4aa5462e86636feb61890ac806014de9b2c697f9b78ac9c86cdcc45bd19b3388569814a24bcbbe570a47561fd713af78490598f2d211f13cf1a5ed4bf299c1c1df8c677bd018b695c9f8339bf01a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080a00000000000000000000000000000000000000000000000000000000000000000120310ab041a9506f90312f901f1a094e7dcd05ddcc3923085b451330f3aa5ce5a628d6685506d99cb09b3aef0e11ea0d1c5c078d5c2983649e8200a84d8fef4d4c1ca8a06ed8f7be21f82c23a910edaa0b116ef7733a93eed23f018027c116e60436a228a9f9173bb9b0c40eb71216da6a0f9858d51200cb595d4f158c848af32e29fa61db4ddea7cde4006a7cbc306ef5880a03dc9ef066e7332efc09e4f620aab588d5465c1ed3b813c912928f1ffa44503a6a0a4aa3b0d5510f907876be1bff95c5867b088e8464e4ae75e45d016c5ac21c0faa00577e3e2c4649c5a23cbdabe0bbfed7cdf6e85c136d84d58127cdec86264ad6ea070c0f30031f40c8017dbfc2ef008e6a3aae2e3105a654e0c5439b6104752882ea08f81903ec8515875682785142e1f92bdeaf65fccd5d0cf78b1ff2905a07e5883a03052420ba2d24a04d3f830584d3dbd6907b6d82bab84ddd806d03470e2c9d51ca06fb1a1498c2c8f93944a4f672ff4e982480ad181c835c0d8078159c517c7977aa013a426820f7b7249edc97cc5c002e653ac84b437f3ac12ac940c3d4b09e09827a09fbc54eac488b27315b09a1afa8d12f168e4c4cb5aea2d9a6ab5e7266da2f7e8a077c5e5cd5bd518bc509ee5e71790f1e42e492e23875b097e565cff8e809e7c8aa076094ead9021f5472bb12b03aeb521e09d71029dfa5dac90afa7cb44cbdfc5bd80f8b18080a0dc77b6ae50b675036e77b31973c79ec60c28c0d2c57b03ad99c2acfff2f0cd4e80a0579a97aa89dbeb98396792baa31c4a7ea8e2f41da084140f07bb4bd655b72dd5a05e0f116451aaa1baab3f3abff2793c8318050eeed6bf62d464d343a11d86eb2880808080808080a0abbb1987d09a71106f586030d1ab913bae0008e2a7dec0d08f2d60cd30fb2ac8a096c706907bfc6472dd88315cb8e21ee6f60a661cd8050065e2ba387023ee96858080f869a020b1e2b1f9852058ee0aaadca3c963f77f6483a1a51c644d79386bcada360583b846f8440180a0e39304f0ec064a98e4b0a96432dfb0a9e4c7fd0f26a6bbcf9c75bff68c51a7a9a0b3d632130dcb5cb583b47ec0623e59ca3703e6e2564f144272b597f3e3511ba822448fdaaa7e6631e438625ca25c857a3727ea28e565a8c9cbefc0c78b71cdf18eeb8206601e665778faa6b4dd23740f8dd8eeb0c7bcc8f49a1c900396aee02d1639ab7897ff2244a7876ea32e7a748c697d01345145485561305b24b3f0af694696c1b453b1174a1ea8c1135c247eb168864c9731254bc2f28077f99fe195b477ee699d79f40468aa30c2b62244b2e42bc54d19116d2348ac83461e2e0915d508adaf6af61cafa835c72fe6e9feb717dd4ddf95424e29b6384bd27c0d6c9c616d15cf7fdf0f2f9fc1a4fa9197251b196be32244e04db2de85453e0936b441c339a26d10cfa71b50996157a84dd67ec797a9ea61e4023c01d5bb28cce995c4c8329900b7b96e5402c02696f6f7b62972af4ee81f3f58afc12a448fdaaa7e6631e438625ca25c857a3727ea28e565a8c9cbefc0c78b71cdf18eeb8206601e665778faa6b4dd23740f8dd8eeb0c7bcc8f49a1c900396aee02d1639ab7897ff2a44b2e42bc54d19116d2348ac83461e2e0915d508adaf6af61cafa835c72fe6e9feb717dd4ddf95424e29b6384bd27c0d6c9c616d15cf7fdf0f2f9fc1a4fa9197251b196be32a44d9a13701eafb76870cb220843b8c6476824bfa15b822666ed599d40aa3bc13feb3ca5d5bc9d3ebe23d3460078c755a5ddbd85a0a58a217860fb0ea675b708a82b288f4b32a44e04db2de85453e0936b441c339a26d10cfa71b50996157a84dd67ec797a9ea61e4023c01d5bb28cce995c4c8329900b7b96e5402c02696f6f7b62972af4ee81f3f58afc130083808").to_vec(); let any: Any = any.try_into().unwrap(); let misbehavior = Misbehaviour::try_from(any.clone()).unwrap(); let mut mock_consensus_state = BTreeMap::new(); - let trusted_cs = ConsensusState { - current_validators_hash: misbehavior.header_1.current_epoch_validators_hash(), - previous_validators_hash: misbehavior.header_1.previous_epoch_validators_hash(), - ..Default::default() - }; - mock_consensus_state.insert(misbehavior.header_1.trusted_height(), trusted_cs); + mock_consensus_state.insert( + misbehavior.header_1.trusted_height(), + ConsensusState { + current_validators_hash: misbehavior.header_1.current_epoch_validators_hash(), + previous_validators_hash: misbehavior.header_1.previous_epoch_validators_hash(), + ..Default::default() + }, + ); + mock_consensus_state.insert( + misbehavior.header_2.trusted_height(), + ConsensusState { + current_validators_hash: misbehavior.header_2.current_epoch_validators_hash(), + previous_validators_hash: misbehavior.header_2.previous_epoch_validators_hash(), + ..Default::default() + }, + ); let ctx = MockClientReader { client_state: Some(ClientState::default()), consensus_state: mock_consensus_state, @@ -1019,16 +1029,7 @@ mod test { // assert fixture validity assert_eq!(misbehavior.client_id, client_id); - assert_eq!(misbehavior.header_1.height(), new_height(0, 1189)); - assert_eq!( - misbehavior.header_1.block_hash(), - &hex!("9432b9b136e91a12cea5e9cc363bc821e90da6c7b2d7f369533afa746ac21508") - ); assert_eq!(misbehavior.header_2.height(), misbehavior.header_1.height()); - assert_eq!( - misbehavior.header_2.trusted_height(), - misbehavior.header_1.trusted_height() - ); assert_ne!( misbehavior.header_2.block_hash(), misbehavior.header_1.block_hash() diff --git a/light-client/src/errors.rs b/light-client/src/errors.rs index 3769d4e..2cc6b8a 100644 --- a/light-client/src/errors.rs +++ b/light-client/src/errors.rs @@ -106,6 +106,8 @@ pub enum Error { InsufficientValidatorCount(BlockNumber, usize, usize), UnexpectedVoteAddressCount(BlockNumber, usize, usize), UnexpectedBLSSignatureLength(usize), + UnexpectedTurnLength(u8), + UnexpectedExtraDataLength(usize), // Misbehaviour MissingHeader1, @@ -342,6 +344,12 @@ impl core::fmt::Display for Error { Error::LCPError(e1) => { write!(f, "LCPError: {}", e1) } + Error::UnexpectedTurnLength(e1) => { + write!(f, "UnexpectedTurnLength : {}", e1) + } + Error::UnexpectedExtraDataLength(e1) => { + write!(f, "UnexpectedExtraDataLength: {}", e1) + } } } } diff --git a/light-client/src/fixture/localnet.rs b/light-client/src/fixture/localnet.rs index 589bb7f..83e5910 100644 --- a/light-client/src/fixture/localnet.rs +++ b/light-client/src/fixture/localnet.rs @@ -86,8 +86,8 @@ impl Network for Localnet { } } fn error_update_client_non_neighboring_epoch_input(&self) -> (Vec, u64) { - let header = hex!("0a222f6962632e6c69676874636c69656e74732e7061726c69612e76312e48656164657212d15b0adf0a0adc0af90559a01b8c590cd6b9bcf6c24e47e5f6468083f6093d05f9cc6a3f45c0e61a7989914ca01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347941284214b9b9c85549ab3d2b972df0deef66ac2c9a03508e22b6e7dd679e544f7badb659cd936e1722f9a91136e800681d588b886aca01aa0294d38be68038c13ca83d122e765b2714e3cf5a7c8b382eab64f009be8eaa026033fa1fdf7e559f128b7380b369d908261c092e97040cd938d0c2cc83c8d52b90100000448000000b680400000c0c00010000280440000920200002040210200009000015e2004022110000830000800100000001222041000004000800040ac100004c0003004102013000540080008820021180000100482004041102000001c00100c68200202009509421005288a684028202400000408912000403080000c000040481c000c80141840181c20001004102084e02800200a040000880c18802006028010c000062808040a2022023082410200880080104a40e00011000000021410981200100a8000026900081200002000808004800420811049ea00206000121002c210000002491000941000110000249000809900084006210020000a00028402620fc884042c1d8083303e3c84663394e3b90337d883010406846765746888676f312e32312e39856c696e7578000000821df8b90808265da01e1a65d62b903c7b34c08cb389bf3d9996f763f030b1adcfb369c5a5df4a18e1529baffe7feaec66db3dbd1bc06810f7f6f88b7be6645418a7e2a2a3f40514c21284214b9b9c85549ab3d2b972df0deef66ac2c98e82934ca974fdcd97f3309de967d3c9c43fa711a8d673af5d75465844bf8969c8d1948d903748ac7b8b1720fa64e50c35552c16704d214347f29fa77f77da6d75d7c752b742ad4855bae330426b823e742da31f816cc83bc16d69a9134be0cfb4a1d17ec34f1b5b32d5c20440b8536b1e88f0f240d3256eb0babe89f0ea54edaa398513136612f5a334b49d766ebe3eb9f6bdc163bd2c19aa7e8cee1667851ae0c1651f01c4cf7cf2cfcf8475bff3e99cab25b05631472d76d76ee8823de52a1a431884c2ca930c5e72bff3803af79641cf964cc001671017f0b680f93b7dde085b24bbc67b2a562a216f903ac878c5477641328172a353f1e493cf7f5f2cf1aec83bf0c74df566a41aa7ed65ea84ea99e3849ef31887c0f880a0feb92f356f58fbd023a82f5311fc87a5883a662e9ebbbefc90bf13aa533c2438a4113804bf980a75ecd1309ea12fa2ed87a8744fbfc9b863d589037a9ace3b590165ea1c0c5ac72bf600b7c88c1e435f41932c1132aae1bfa0bb68e46b96ccb12c3415e4d82af717d8f474cf03cceff28abc65c9cbae594f725c80e12d96c9b86c3400e529bfe184056e257c07940bb664636f689e8d2027c834681f8f878b73445261034e946bb2d901b4b878f8b381fbb860851066357eff502b847239dce4def537c09981995b09a20b0332a5931b6a80a0756929d82d67ada1699558c423a5108b0754fc4a8729fd2967822ee274fecd8742703f1e758c0c25aa65667ac33ca73a09dacf4ffeed749d956d6b438a65fe35f84c8402620fc6a055a683a5f4aec18ad180c783416fa6064fd77d12dd9cce6aa4e2d21814a1358b8402620fc7a01b8c590cd6b9bcf6c24e47e5f6468083f6093d05f9cc6a3f45c0e61a7989914c80ac0efe500470240a4e493ae2a67a28f2974da7a8b00ef170fc1d2357732a713d15528f7773b127095705a9d064c155484a7e3e8ccefefbcd1cacc960b3a0fe5f00a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b42180800abe060abb06f90338a00675a9943e5eee827641ecf76ccdca86c00760201e79454d7d70bf1d1229f4e4a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d493479435552c16704d214347f29fa77f77da6d75d7c752a0f88cae15732bc072d88e3266e79c63ace19f6158d861b5a1527eecea8b3a0c90a0805f0392fd4fe5f40410188ae1823170f330fcbd460029d64100fb762c18db22a068061db6f72b36216ac8a6d4e7ade646d0481a5e58a1d446699f73f0000c65beb901000200000000000008100000400028002100000000101280100000602202000080440850000800001001020001000091010090200a10040008009012000080600042005010001000000010200880020010221000a0000208004a0c88000102140000080061090200800044000000000000080000000008088002090010040200040840000980000008000000000104000000100c200840100000000086001000200400000000008020084009000200204002800000000080008000920c0100000004880a0a0000004001810000000120124000009204080080001040c20000a000000030401000000201004004020001820000c00000000400480008000100a000028402620fc984042c1d80831a1f2484663394e6b90116d883010405846765746888676f312e32312e39856c696e7578000000821df8b9f8b381fbb86091ba1e6cf213db9c2384a8b80d1a61adeca1222451ad44989a3a4353c926cde613198ca3031c6b7c7988b0302c51f2bc1762f889d44c27476f73339069a6aa0b5fce63de2c6e847ee07c01620e47d27d090277ce3069e61a8e0e5dc75e7b6c02f84c8402620fc7a01b8c590cd6b9bcf6c24e47e5f6468083f6093d05f9cc6a3f45c0e61a7989914c8402620fc8a00675a9943e5eee827641ecf76ccdca86c00760201e79454d7d70bf1d1229f4e480899ca0f597006047cc915ce49e35b70eefe652a4f46d2cf8f9954323b29dc13a07ebbdc07dfa4f17138db9af8611fe9a98d289df90b46aacc8d86e6f39c7528e00a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b42180800abe060abb06f90338a06f8122b4b7c614859a61d8e12f236efc07d92370c52e9f3f8de48bc4c4c3f76aa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d493479440d3256eb0babe89f0ea54edaa398513136612f5a01d6899d6d2e0f411288f145754d9672ce2881c44d3e9a25a6a33d5f625ec608ca09ef5f809e4322bb7ac0df0c4b4ce82d4fea1e31832734ed2286e1bbf3bcf5967a04f4875ba4450b51981ced70f5cb8ecfcb4f402a2ecca8f038ce9340431ba6677b90100100800080000000008000160000000240000010190000800000040000000008000081421000000100002001101009800001410120000000000001a0000a11200002030300820000200001008002000002010000000000000c000508001101600000800200a02009000010000000148c2080000000004089000080890420000000042000800000000100000011010001001000c200c000200442000801810102f060000000006a02808440000028000040001008800000018000082000000000204414802000089000021400010428000008000840280010100104142000020000010108a08040800118400060000010020208002201000024000100000180000028402620fca840427f164831ba49084663394e9b90116d883010405846765746888676f312e32312e35856c696e7578000000821df8b9f8b381fbb860ae5cfdf126fe914ba373cc010e894bdc02c34c113feaa7bf6e027879725858c3aa8740b6abb90f1dc389003dae1eb30d11aaead3c1df95d86bfe201cf0c5a285dd915f13a712abd523322712c42b8195c6cab1b5b0314375c059f48b8b79c8e4f84c8402620fc8a00675a9943e5eee827641ecf76ccdca86c00760201e79454d7d70bf1d1229f4e48402620fc9a06f8122b4b7c614859a61d8e12f236efc07d92370c52e9f3f8de48bc4c4c3f76a80bf2db108411fe95e684c82f738764633a2d29253d20c1832b7189b7a52f4c7ab75224c2bc89d3d1765b1aea4a347f2526cf24c4518ce3eae863383938cd651a001a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b42180800abe060abb06f90338a0b8f6e83d72a579037a1747385d006303baecd2f9122ea38d7d7caeae4322fafaa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d493479476d76ee8823de52a1a431884c2ca930c5e72bff3a090533b33c3cc5cfecbd33918e04cc12957a3cf6a5844e65a0ca4f2ade2994b3ca0e6977483ef89448a9e5565ceff05271fd57f2ba905f9caad339902e605fc8db8a0465d7a4ebdc6f41f40124db3193e5a0565e6a877854715c5811eb143d1d5f392b9010002801044080080006022024040a0002000a840003012002810184001000409924008152008200011040240012c00100120102002000000200100020000a4702006466030020000000001000c00008000a0180000000000804241102800111710100c46a00a02009500060004288008400c000400081808900001045400020c400240001c0000000000000ab000081008001c0ea028028002042040800810202006480080400006380840100002001402010000c00000000002a08311208022021400981220004881000300c002035001000080808ccc0324001040420000600012383086100002080941c204000411810400800000c020004c08080080480209028402620fcb84042c1954832408c484663394ecb90116d883010405846765746888676f312e32312e39856c696e7578000000821df8b9f8b381fbb860ac51bacb0156bbd71fe9d754817bcd1ef367cd0a6ca2d719fd1f9294164e9ea536937167df9370e7e4271846d099f1c01785e38478fca04f68559d2740447cdfc8f8e1d9bfea1ad6d331b13c63d133504203d7b6197e59837128b91b568c302cf84c8402620fc9a06f8122b4b7c614859a61d8e12f236efc07d92370c52e9f3f8de48bc4c4c3f76a8402620fcaa0b8f6e83d72a579037a1747385d006303baecd2f9122ea38d7d7caeae4322fafa80995177c05ae18a7afb72a5a5b870aa4cec13dd3bec378bd0bdd45c8b32ff9d94379d0649899e58045bd798c90c83f068c6180ac3be527f5264fd1fa40d5f3f7f00a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b42180800abe060abb06f90338a0c1828f9fa73b74d490c01682f5e7851683736d6d38437034b118ecd99aac908ba01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347947f5f2cf1aec83bf0c74df566a41aa7ed65ea84eaa0909eadb50d8d80fed8719a8008f9a96a65105c9f9adf5f09583df44903455d08a07fa76502e2d2fad4544c010c2cb4719b07845b4ade4c57c05c194dbe35f27990a06c6141cf0821319308c5b281ebb93512f27f384d9d039387d765fa27ce7f5ab1b90100020000000004081820000040000000c400000202800200000008400241000080c0001c0000220050000000000200100000000082080000080000100000b064000000201000000011000010080200000020100000240a0400c000000080041700000804200002208000401000085000000a00000000080890000010140000080000400a0800080000000000040082000100000e2018000000000004c208100260060000040000003108081000020000400000004000000000200000200000030004000802001000004000000040101008020000000c06200000584002000020000018000010000000011100040000110280009000008080084400000004090000028402620fcc84042c1d80831f9f5d84663394efb90116d883010405846765746888676f312e32312e39856c696e7578000000821df8b9f8b381fbb860965d6d03c0493b4b7a3cf91fdbe7d114ebd38ce476e1bf47f1d1a55a8286408e61d2fedaac5e6c9b577f808ddeca453619c2fa244c4c8d0c521caf5148b532bcc376df1e5195419b11a350b03b596bbda029f1b074c42a3e9ce26d676c708c3ef84c8402620fcaa0b8f6e83d72a579037a1747385d006303baecd2f9122ea38d7d7caeae4322fafa8402620fcba0c1828f9fa73b74d490c01682f5e7851683736d6d38437034b118ecd99aac908b80e1175bb3858b24abde91024c935edf639b17cd3d48a67110b486064b018cc30273e32fc65969bdfaa4f6c72e0ead81230fa220f767d21f0a434ba82d9d5f6fcd01a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b42180800abe060abb06f90338a09c7cfa55ae4789be64a696d357083683dcbc0429843811c125087ffd383311b2a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794f474cf03cceff28abc65c9cbae594f725c80e12da00e783cf76ba10af8b476c2af6f0099182dc3d8891e6bfe8ccfbd4df4df9e5725a05943a3797fc784ab2a933a7e8cf5502c66932b4d565bf39673d8c84a97e7c163a0887d4fd11bac9b67f2a36358099ecfb8a3777074a31a1b01b0a2ddaa1621e312b9010000010000000080040002824000000024000000001800000000000000002800a0002810400000001004020001084090010094204a010004000000020000a0600002000030000020080800000c8800080020100001000000044200000804405400000802200a02808000040000000008400800000000802000100008100000040001000008000000000000000000a0100000000420080000000008100010100021060000000004842008400800020080040000400840088000000002000000000004102802000088000001200000000020000280040008002000104062004020008010108000000000010040040001010000008000000000004800080008000000018402620fcd84042c1d808310765984663394f2b90116d883010405846765746888676f312e32312e36856c696e7578000000821df8b9f8b381fbb8608ce86edf055073ed3657cb976abaaad5fd17879de455c0261f75a68f1fece6134ccbbad1adb809ce0c8e7b50249422c212357367f0e2feca28deb104d6bbfa1a2dd080a66914b21756e2198cf1c52f50ad6edcc07ec72818f917e9d7111a6574f84c8402620fcba0c1828f9fa73b74d490c01682f5e7851683736d6d38437034b118ecd99aac908b8402620fcca09c7cfa55ae4789be64a696d357083683dcbc0429843811c125087ffd383311b280f18262798880d70059d643979022a2b63e4198d03f7b42b1b2ae3750a00ad54632f0755542d43c630c263fefea44700a9c2f5780aacb850a98fb22816843643701a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b42180800abe060abb06f90338a0fe3e114a9b8862d981e404b7f83f43330e8a6a1d6f853b450ba8f358d8e594aea01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794980a75ecd1309ea12fa2ed87a8744fbfc9b863d5a020d51c5c97ddeaa92872cb51e57cf30cebf201e4455a7628909a944a153fdd29a08498edb273bef28ea8bfd2cbe9a99e2c94eac71fd9752a46178549e43b3dbb76a0af8c731b24f09013ae128678c593b89c686e5936789049da0a20a421f883e50bb9010012000008000800880000006000001000000000010002808010006006000800a200005c0000220010001800000000110100100102000000000009182000a06000020030380a0000008110000800000000a01000010002020040000000a4001400000880300286009880441010082008600c000000000838910000009008000800004200081000000c000000001000001011000c200a00000a040040c108100020060000040004006808001840020040c000000100000000010000901200c000080404681200100100000000000010000020400000041c000000104002000020001018084010010009011540064008110220009000001000014000980008080000028402620fce84042c1d80831f23d184663394f5b90116d883010405846765746888676f312e32312e39856c696e7578000000821df8b9f8b381f7b8608339e352db1dfd13827e415235e7ad9653cd14056bd7b78e93e09c86c36679ae02e13a2ec4aa1d8e2546fb5655f621d6041c1b9aa04ce18b41b7273fbab06eea3aead2ab3c6bdc791bb6268c781267b4ec81143312f419a48422eab7e7d8f1ebf84c8402620fcca09c7cfa55ae4789be64a696d357083683dcbc0429843811c125087ffd383311b28402620fcda0fe3e114a9b8862d981e404b7f83f43330e8a6a1d6f853b450ba8f358d8e594ae80b25e98a9d4d947ccedfd894f38dae23c09a3f30ea5b513470d75eac608d15b233c39278b14601bcd777c2f0c61fba173b2189614ff7ab761ec48e03ae2894eed00a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b42180800abe060abb06f90338a0ad80590a86e436e79aaa961dccc29d85d1304853ded12197ae2dffd42e75fa18a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347941284214b9b9c85549ab3d2b972df0deef66ac2c9a007e946b785a9637930533c6df8d79bb93184e47d65d28f7854d8c8ce16c63c42a015de33fa37a8bafb7578c335909aeff2b2b679997e548ee1a8d9f47a892ab1a7a02ced64c3059d0e81f236cdddfe8d034d05a08e1fe845ba32b4234d5ba8a377d6b901000000200400082008c2000a401000002000200a00103200000000502340000080002c142000000010002300818280140080100002400408000010120000a03000040000108400000000011108020012002210000020020408c80a100000171600020800200e02008001e00001200008001a0001000008089000081014000002040040000800000000000000000102000000000460080000000000088108904866060080800004006008400200060000400080008000900000a000820800020102040008020080000001850008400200004200009004800080111040424800a0000018204a5000020041000015000001020000810000202008440000000000c000018402620fcf84042c1d80831bb60084663394f8b90116d883010406846765746888676f312e32312e39856c696e7578000000821df8b9f8b381f7b8608e8cfe0b055b18d322025f0837aba5e1928a13f666255b83cf0529ed987b9b4e449d6248796bf8a351bf21cbeb4d869b14cfe57601beae23fed96172aaf53b42c247caacd125e363c7d4a36497c20523a72100fc4bc1a8f1db3ef66f882b1b84f84c8402620fcda0fe3e114a9b8862d981e404b7f83f43330e8a6a1d6f853b450ba8f358d8e594ae8402620fcea0ad80590a86e436e79aaa961dccc29d85d1304853ded12197ae2dffd42e75fa18805a390422f87c05ce81fad47bcbabb415c9bec71cdf4d6b8878409322a810d8567ef061cec5384ec4e0a754413ce28e6fdd24f54e84706337e863fef60b2489c100a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080120510b89c88131abe1af90d3bf90211a05d54f311542dc86508c3950fe9fd0e42666c4b0d2da357bf0ff5256206c4f499a0de4549196246f89565153fe5c293bd86825c81bebcaf5d863bc20db5b80f39c1a04260cf26a849cc8ae7d9e9490a0f3cae30ddb388a52bbb4381b648c6927f5d02a01043cbea73d2e4dad6a3021744ae80ecceee3fda23997f7e5a56d30721d6a89da0016bc5f3d3af4289603df49b9156999c4b3fab779399bba9dbb8d98a7d5fff36a09f7ae1ed754c036e23f8cee8168086eb854e9a74e50f80fe6eeedc06652d65a4a0aa0c44232305f2d9c73f4198c114a79f935d4f15479dcd8d61ab3fe5821608c3a0b2afddeb92bff5ff52f0d7d432e3b5e2c777988181eef046d4026e23a28a15fba02a6282e9d54cbe11efd2a4a36c899aeaa7cf7604c6c1d496d4ec36b26870d945a0d7c965d118cacf4d7282ee52216d42b231163efbb82fafc36bf6dccc2ace3b53a0e05dadba137f39580b713d54564bb2ccb48a4a4e882ac673aa972f6b4a7e2c84a0e35f8dffad08d4c9df98129ee14a657c0076c7e5ed00fea40d7bf4f9ae07c2c4a04a9dc6bc9c6a276620ccc29879f3e4195951f720322b72f3925c5862c5972487a06a7b7c9de98a1f4d36cf112f45b71e797694ed5b0c8ffcdcea26ed337bcea62ca0904b2f7a0c508f1876c1ffbba7832ef5babe8218fb7ac12d0f9bf4245b356a39a0bc5622b08b6882c64c3fd5ca4feb7cbe7845c911b3518874784719dac87bf31380f90211a0ed46c5f969903bd014b453e23bf036a0807d974ac245d974bea3edbfab8998f7a0fbe185c3ad730c361d61adafbf283c230a9e04a6971a5693a58b95d54a91dc18a01c49f9acbb2ef6407d5d88ad62c7e41c0ae4e1a86453d107f8b88e366e6f1f27a07f263e0e9ae17cbc40f87c3ce1249a552a18c5dc0b7fe42e43454663ac9d4a10a0ef16b26fa26244501acfcc480235d9fd3859b0511b1d840cb3960143eac49e4ea05e19c98be009508b8132d6bc03ce932ae80c584fed6c8b66690f51b6706c6110a02699c04fa558d4cf31a72eccdbd6c9b85921b18e92be8013b16bbbb0e0243d95a0bf06ce588155b0a5b8dd34eeb8b34d1ab6698da02bbd47b8df956f3f8f958f51a0105ad803a3be71de2802142849753f93fe3445762ccdccda5baafb2c350fe8ffa06e725a7130ddbff26e37c27c25830b6c3fac3575371cd00d26e799c30cfc61e5a045a5861fe345d073abd640549c0bc754f98a15f1349dc94ccaf8e366d747e800a01fa1a61b7b9716a711f42192e558ba2fcf059d8b87ad67cb4c73aa65bc918226a0e3b653f8469bce44931ae9a2f88c3ae385b70bae52b43902b618a0e29694dd8ca09f207e2e88901b54fb464545a33764841152a2669f6668610bc3fa10d5cfc2bba00393790748f68bcffb6f9e01a409b9d1e691406b635a1cca73ae061813ac4d5ba0c3f4178174074d467324173d8436674ce6c69fa7c49a4337a000635fb04dbf2380f90211a079c04022f20db8c5fcf561e1956bfe73e94c6e4cb2655ff506c2e298f1ab8f4da0c0c9908e024252617bb968a090881f478cf2cedee6762524d4b2d3521fce7b30a09a502add7d10c7817db9157721c4b03ff3327415d6d3b0307b11efa07a2ca300a0911e146a2367ecc6ea7dd6c2547ac9df60ead03cd1d14ddb3350b3968c7fca53a05cd154e740f91a9fc1b2b780c47cc5f525efab2e7c7c36248a2833a99206f291a03761f080edb655d24c234da08813efc750a093ea75e9603d558dd2889e254363a0035ad7eda8fb804cc3b2779b0f3c40e67f5c7fef6b354878cc659bb76c02871ea089848d6e6e0132be50e1428656da8fadda12cb411681a9cab7d5d9371650f2e3a054ab857606b93e77c264d3ae1c75bb7d8e532a75823fa0646934c6b07587d97da04303a53d5b1cf36d7ca5b3a35ff11b210b7fab8f2bea560fee8e1dc49863af08a083b73ad7bf82dc689745a5bd39837939169c725f44b3bbe5c2b9470c557cb6c1a01eb14803b41ee30b3d9256decc6b02f7b4eac0cba1cf60c7e806aa145dc95c3fa00f46a8879a158446fd5281f67942859516c094afff5c862d7925e28e0255dc1aa0a88775f84e8812564ca66ffdfc617993b642e48863299520f34c9e4f2b394b24a065a8676f56698d3c88c8360411a1b5d89cbdf44cef98a51fe1b761ed82177bdda0e9216b548ea5ad232ccea4285597ba3345a53d39fcd61de9546c24725edac4c980f90211a0fd00080f96539f8eb5a2b403c9594f7bbf1a9a773c9a4430d86ee7f4fc67f041a083d0f27ec441ee36c6b0479c30d213d373edacc372fc3818fc98eac3c53da4d9a09eefca974fe868babfc32bf6e1449d97d14a891e3b10bbe54f64e00a0b5dcca1a0ad7b3367ca39009b957a1825269c78ca3af9a2a87c43894fb8bb9ec165d7a4bea07b68db0a8ff70d3557ae4c04b964de0fb67e3c340f3649c0af4bf79b86e73be1a02af8fdf09ff77e7f4d0e325050a8f293c08d2cb328f8d3da7e083a7d48924224a032a90f4a4456c9a1cefc92ea7026d74d9c1c5117e8b7d405e9d9440a8edfefbba03c40b1884e0810d2d3579d8be5483a651ae4ea3041f484ddef2f0ad5a70efc06a06c34468de46e1c6fd59005d0201b3de36cab1a04daf1b42073e91fe35cac978ea05901b53bc10fe26bfa1936e1ba5a334d168558454429aecd803d3e63304984dda08e3a481bb8b089125b4e820bc9e59c606c47631394830b9b37c06c77110bc512a06411f9d1b96b36d413236b20ecaa77fef4bf17c023b6a0feb143a7dfd529053da0c388a4b630d106f22778df9782863b29cc712d25423c704117a9cd46190d55a6a0c3260e27d68de22e8dd36e2a15055e3f9cc0a1503510f8352be2458ce2849cf8a000d1dc7f94ab884d393c18ad9816d364c001e8ed29b5339d7d673d05d8cf8c18a0cc90581b3014a0af5d5a263a6581f442d75cccfce15f6da447c30aa3eee35adc80f90211a0f4f253a2981255c3c0c2b023a074cf35ee982c4709fe56d3cfbcc0d2d3e9e060a0c97e5c55396e530fb20bab042aabdf2883db66f41abb6c71f8eefdae67334800a006d2ac360ebe8eb14a59e2cccd35c3a23d9c559f183102ebdb3db068fdf6a634a03a78bec1492adf068ece5e9820d72df85d2e0b2b992f0cacb7198fc956473d94a0eecba4d8055f6358c4ed0989fbf575de5f137c4ffc73a53ade1d708c45641131a0eee901dcdf7b3b76f230c684200e990fc2284b3a3cac8156795643a8bf45f543a0c679d68e57dd545e7489f10898128a6a90ad7df29d3380ea3fa2c8d036a714c3a063062d6a6c1cfe1efff0e6965a65446b61982e763eb36652e1423df1fad08643a0d6c8ae23af8ad991e84c43f69bf280c54fc3a731b210bd60f5b8f39043480017a04614a62c039ff880d7c65c891e6fc6c55bf81bddadb42b5171a8d07f7218d7c2a0bfec07e9660db8afc02cd6cc2524246febc098f596a717190d1ef155317ce046a02aec38d6659b1b72f03b7b80e078dbc40650cea494f56606154538491df2598ea0c75fdcc0ec88840ac16c38f4a5902dc1e87d704cfdcec825b0aeee25fac08c32a0e09b0acd86da73ca9edd0ed45f52e970c710860aced6d2e1bb3617d45d1f1cc2a0bd67f755acb481bd586d2adae80b8155e8c887452ff964c8dd0ac888032b7d1ca04f03b5b8ef01c49629b79e51438d92a2dd9a490508152a96787ea1c39e1358e180f901b1a0b253f4d804466eedf2500f7c56b7b5c81937fd8547fbe942756bf1c2974245b9a0dfb6b4a54ee26fb0acc8a98e28efc6a9bef48610921ed4c5ddad4a6770ec413780a0e5b8323277c3cd8b0da5297fc709533d25bc28964698a6f2cbc4ba80c4c474c880a0ad4e25adf77388513a19b6e66f340845f4da575e05cbb41ec3ccacc962beb934a0ec3b2876d5a7b8fb4c959b2e2efd9a3fee75ee4e65da5438010367610ca50ccca0316db872ded9164c79a846190e57eb2c3a4379087798b8e1220b3cc5ff5aea06a05ad6bcb5a22ccc01a7b218c06c217b5c6f6a54cd77dbf3385422f37c3a5bbdc4a039d08aa5ea4684c934cd1911177ebea1f2f3438d891da946a0396ac10b663b1ea0c73d499a0e4709723af701832cc2e07949df500d5a817709746c124757f2a46d80a07967cd6ca41b76eceb64c5373d85399a380af1d1eae78f56a33a149677398df3a0753f05888f5454aba005e67e1061a0bbb982c308cf90a89746abebc76f640d44a01eba4f5159fcb36c5bde7933e2632b0923167fad080618e90b90e98f450e0673a0dc9282be875f1e21a4245c23816f7c36bfaee11d34c472c29ae4576985f2e9e880f8b180a0f53d8c2cc17264e3f43339e6390b3de4123e0d3014e2437d51e9527d32531dbba00cbb4e2b6e1f2b59fb98c96cd2ee4a0a9994e91d18564b8289c5dbf42d653e6a80a0585dc8b79c33d7f248c845ac6c35ea102dc2fd2870e4e96ae7891ea6093b3e6880808080808080a05b8b9aed0df2c69df192889f2a5c791f16590efae13338ab7279ea1bab2fd0b38080a07308e7b9a6597a64d45bafaf4b3a2a4525895d77c7d8c146ef7720f5c693f7b180f86e9d30e1120c458c4c09a9448628f84e81161b308d5c4041a3d3a1ea329d0eb84ef84c588823d85d5096750e00a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470224408265da01e1a65d62b903c7b34c08cb389bf3d9996f763f030b1adcfb369c5a5df4a18e1529baffe7feaec66db3dbd1bc06810f7f6f88b7be6645418a7e2a2a3f40514c222441284214b9b9c85549ab3d2b972df0deef66ac2c98e82934ca974fdcd97f3309de967d3c9c43fa711a8d673af5d75465844bf8969c8d1948d903748ac7b8b1720fa64e50c224440d3256eb0babe89f0ea54edaa398513136612f5a334b49d766ebe3eb9f6bdc163bd2c19aa7e8cee1667851ae0c1651f01c4cf7cf2cfcf8475bff3e99cab25b05631472d224476d76ee8823de52a1a431884c2ca930c5e72bff3803af79641cf964cc001671017f0b680f93b7dde085b24bbc67b2a562a216f903ac878c5477641328172a353f1e493cf22447f5f2cf1aec83bf0c74df566a41aa7ed65ea84ea99e3849ef31887c0f880a0feb92f356f58fbd023a82f5311fc87a5883a662e9ebbbefc90bf13aa533c2438a4113804bf2244980a75ecd1309ea12fa2ed87a8744fbfc9b863d589037a9ace3b590165ea1c0c5ac72bf600b7c88c1e435f41932c1132aae1bfa0bb68e46b96ccb12c3415e4d82af717d82244b71b214cb885500844365e95cd9942c7276e7fd8a2750ec6dded3dcdc2f351782310b0eadc077db59abca0f0cd26776e2e7acb9f3bce40b1fa5221fd1561226c6263cc5f2244f474cf03cceff28abc65c9cbae594f725c80e12d96c9b86c3400e529bfe184056e257c07940bb664636f689e8d2027c834681f8f878b73445261034e946bb2d901b4b8782a441284214b9b9c85549ab3d2b972df0deef66ac2c98e82934ca974fdcd97f3309de967d3c9c43fa711a8d673af5d75465844bf8969c8d1948d903748ac7b8b1720fa64e50c2a4435552c16704d214347f29fa77f77da6d75d7c752b742ad4855bae330426b823e742da31f816cc83bc16d69a9134be0cfb4a1d17ec34f1b5b32d5c20440b8536b1e88f0f22a4440d3256eb0babe89f0ea54edaa398513136612f5a334b49d766ebe3eb9f6bdc163bd2c19aa7e8cee1667851ae0c1651f01c4cf7cf2cfcf8475bff3e99cab25b05631472d2a4476d76ee8823de52a1a431884c2ca930c5e72bff3803af79641cf964cc001671017f0b680f93b7dde085b24bbc67b2a562a216f903ac878c5477641328172a353f1e493cf2a447f5f2cf1aec83bf0c74df566a41aa7ed65ea84ea99e3849ef31887c0f880a0feb92f356f58fbd023a82f5311fc87a5883a662e9ebbbefc90bf13aa533c2438a4113804bf2a44980a75ecd1309ea12fa2ed87a8744fbfc9b863d589037a9ace3b590165ea1c0c5ac72bf600b7c88c1e435f41932c1132aae1bfa0bb68e46b96ccb12c3415e4d82af717d82a44b71b214cb885500844365e95cd9942c7276e7fd8a2750ec6dded3dcdc2f351782310b0eadc077db59abca0f0cd26776e2e7acb9f3bce40b1fa5221fd1561226c6263cc5f2a44f474cf03cceff28abc65c9cbae594f725c80e12d96c9b86c3400e529bfe184056e257c07940bb664636f689e8d2027c834681f8f878b73445261034e946bb2d901b4b878").to_vec(); - let trusted_height = 39980600; + let header = hex!("0a222f6962632e6c69676874636c69656e74732e7061726c69612e76312e48656164657212de1b0ab4060ab106f9032ea04788023231ff806fc9c20db23fce4c06c3b70d9038168334ec3e2095840ce534a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948fdaaa7e6631e438625ca25c857a3727ea28e565a044a1ff3b091f2f544a4d42c0772da7a8c26265f177d0472730efa0719c157d35a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028201f68402625a00808466992e3bb90111d98301040b846765746889676f312e32312e3132856c696e75780000ffcc693ef8ae03b860a5847b013e471a925b8122c9c748725825aef5d215d1ccee2b83af041eba4cf9ee211aed07fdeac7b4c2f7b85070208505e6849508cb950b2678fd27d40fb8e8a8656c050dd44f6ec33c226f108d15c6cab19080cfffbea81cdc7b1a09bc0463f8488201f4a0b4dfd14d8766b8fa4e64335fbcb53e56699c8948cb032d0bb628fc166a9321318201f5a04788023231ff806fc9c20db23fce4c06c3b70d9038168334ec3e2095840ce53480462103279b25cbd0540468881b0b90266b9ade0a60d6a93bba8a7ae4aff1d15477df78046011f78aeebf21fe63204b5e2b9b1aa8c7e26234482902addbb62a4001a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b42180800ab4060ab106f9032ea0b1270c4b2a24c6bce1d07ec610c294d4b729b0c9c02d585e33018420bd6d8f5aa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794d9a13701eafb76870cb220843b8c6476824bfa15a044a1ff3b091f2f544a4d42c0772da7a8c26265f177d0472730efa0719c157d35a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028201f78402625a00808466992e3eb90111d98301040b846765746889676f312e32312e3132856c696e75780000ffcc693ef8ae03b86099624ac24cb33ea9d08bbc36916d4850fabbeea8f97d320a0493c574e4ec19f443070972f6c1737e0ca5269bdb11f16507096f009f7c1298d1ea37e22d2c0565cd5ae718284f80f5704228d6bc4d36ea63d7cd9a6077b15bf8e0c973c0b54f98f8488201f5a04788023231ff806fc9c20db23fce4c06c3b70d9038168334ec3e2095840ce5348201f6a0b1270c4b2a24c6bce1d07ec610c294d4b729b0c9c02d585e33018420bd6d8f5a80f3a3f4f618fa7a483fcc7f00b52e43e90085d5371c62a34f9a7150ad13921d805762782747f63307bee2a73980fc19c19af853800c7805fec26a3e405ea2b77500a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b42180800ab4060ab106f9032ea0be1699ee1c35954f180299bc9579d59ff6d57e5205cdc35c570d83d9e647d6d1a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948fdaaa7e6631e438625ca25c857a3727ea28e565a044a1ff3b091f2f544a4d42c0772da7a8c26265f177d0472730efa0719c157d35a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028201f88402625a00808466992e41b90111d98301040b846765746889676f312e32312e3132856c696e75780000ffcc693ef8ae03b860af4473d99c25cbf6cce8b3b305ec3dbccff96d7c6007f123dbbcbda8286428a69da7f9145ced0f2275b11daf1b7ad1e514938274bc4f960d25026f23c2f2f8a5d8cd3d32d87b4c66062988a657dbb5cd625bb256f328e8a4a81d92f0a2389fd1f8488201f6a0b1270c4b2a24c6bce1d07ec610c294d4b729b0c9c02d585e33018420bd6d8f5a8201f7a0be1699ee1c35954f180299bc9579d59ff6d57e5205cdc35c570d83d9e647d6d18083abf2596f14299f17a96f652981b52bb794315aee435f3e277a031b4955f4866c5179198606ef2c2f691d3352d1d6daaf2a995e75212fb413f520604e7e412001a0000000000000000000000000000000000000000000000000000000000000000088000000000000000080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080120310f5031a9506f90312f901f1a094e7dcd05ddcc3923085b451330f3aa5ce5a628d6685506d99cb09b3aef0e11ea02da84052a06a138dc625b9f6b0020fa250e7b1862a9ff3db6516a7e32ff33698a0b116ef7733a93eed23f018027c116e60436a228a9f9173bb9b0c40eb71216da6a0c4514d3d96fbd80ddd21b28182a517e555c417cd7683f805860098cd28a49a4380a0a74e307420bf9966d5db9a83ce48edc32c7a8e43328c6373de6875cefa04ad7aa056f4d573349c475d8d0dd015ee77c80ccc34d5742c2a7f2c266480b61f24a050a00577e3e2c4649c5a23cbdabe0bbfed7cdf6e85c136d84d58127cdec86264ad6ea070c0f30031f40c8017dbfc2ef008e6a3aae2e3105a654e0c5439b6104752882ea08f81903ec8515875682785142e1f92bdeaf65fccd5d0cf78b1ff2905a07e5883a03052420ba2d24a04d3f830584d3dbd6907b6d82bab84ddd806d03470e2c9d51ca06fb1a1498c2c8f93944a4f672ff4e982480ad181c835c0d8078159c517c7977aa013a426820f7b7249edc97cc5c002e653ac84b437f3ac12ac940c3d4b09e09827a09fbc54eac488b27315b09a1afa8d12f168e4c4cb5aea2d9a6ab5e7266da2f7e8a077c5e5cd5bd518bc509ee5e71790f1e42e492e23875b097e565cff8e809e7c8aa0d4182165b298d7b52b0f2064d19ab8bdad2b3955fa5b3d85c00673beb97e124480f8b18080a0dc77b6ae50b675036e77b31973c79ec60c28c0d2c57b03ad99c2acfff2f0cd4e80a03f47312ca98ac1f6ae9db9752c2a33529723b64e654d87f7847cee0382edfb55a05e0f116451aaa1baab3f3abff2793c8318050eeed6bf62d464d343a11d86eb2880808080808080a0abbb1987d09a71106f586030d1ab913bae0008e2a7dec0d08f2d60cd30fb2ac8a096c706907bfc6472dd88315cb8e21ee6f60a661cd8050065e2ba387023ee96858080f869a020b1e2b1f9852058ee0aaadca3c963f77f6483a1a51c644d79386bcada360583b846f8440180a0e39304f0ec064a98e4b0a96432dfb0a9e4c7fd0f26a6bbcf9c75bff68c51a7a9a0b3d632130dcb5cb583b47ec0623e59ca3703e6e2564f144272b597f3e3511ba822448fdaaa7e6631e438625ca25c857a3727ea28e56593428ee663799df81ea82bc8445a7d93c891ef324b5f4438eb766bcf75fc405fb79d3f618fcdd17f107b374368ef512f2244d9a13701eafb76870cb220843b8c6476824bfa15a82968379b116362f75bdb7cc4be8ca0ceea7c0f2e74be7c8f289cda6dcbc5edbb26400e1306c2de06f52a9a583dab992a44a7876ea32e7a748c697d01345145485561305b24903201f874819815e1a3f183c4addc814b71ec0e573e07f79ee9082926d82dd1711d6c45a9cc8841916d8563c2f80baa2a44d9a13701eafb76870cb220843b8c6476824bfa15a82968379b116362f75bdb7cc4be8ca0ceea7c0f2e74be7c8f289cda6dcbc5edbb26400e1306c2de06f52a9a583dab9930013801").to_vec(); + let trusted_height = 200; (header, trusted_height) } diff --git a/light-client/src/header/eth_header.rs b/light-client/src/header/eth_header.rs index 1f58f7c..22156aa 100644 --- a/light-client/src/header/eth_header.rs +++ b/light-client/src/header/eth_header.rs @@ -287,22 +287,26 @@ impl ETHHeader { } // https://github.com/bnb-chain/bsc/blob/33e6f840d25edb95385d23d284846955327b0fcd/consensus/parlia/parlia.go#L342 -pub fn get_validator_bytes_and_tern_term(extra_data: &[u8]) -> Option<(Validators, u8)> { +pub fn get_validator_bytes_and_tern_term(extra_data: &[u8]) -> Result<(Validators, u8), Error> { if extra_data.len() <= EXTRA_VANITY + EXTRA_SEAL { - return None; + return Err(Error::UnexpectedExtraDataLength(extra_data.len())); } let num = extra_data[EXTRA_VANITY] as usize; if num == 0 || extra_data.len() <= EXTRA_VANITY + EXTRA_SEAL + num * VALIDATOR_BYTES_LENGTH { - return None; + return Err(Error::UnexpectedExtraDataLength(extra_data.len())); } let start = EXTRA_VANITY + VALIDATOR_NUM_SIZE; let end = start + num * VALIDATOR_BYTES_LENGTH; - Some(( + let turn_length = extra_data[end]; + if !(turn_length == 1 || (turn_length >= 3 && turn_length <= 9)) { + return Err(Error::UnexpectedTurnLength(turn_length)); + } + Ok(( extra_data[start..end] .chunks(VALIDATOR_BYTES_LENGTH) .map(|s| s.into()) .collect(), - extra_data[end], + turn_length, )) } @@ -441,8 +445,7 @@ impl TryFrom for ETHHeader { let hash: Hash = keccak_256(&buffer_vec); let epoch = if number % BLOCKS_PER_EPOCH == 0 { - let (validators, turn_length) = get_validator_bytes_and_tern_term(&extra_data) - .ok_or_else(|| Error::MissingValidatorInEpochBlock(number))?; + let (validators, turn_length) = get_validator_bytes_and_tern_term(&extra_data)?; Some(Epoch::new(validators.into(), turn_length)) } else { None