Jamie Lokier
242dfdd5ac
Bugfix: Off by 1 in EIP-170 code size checks in `stateless`
...
Fixes an off by 1 error where `EIP170_CODE_SIZE_LIMIT` was being treated as the
lowest invalid value by EVM code, but the highest valid value by witness code.
To remove confusion, this is renamed to `EIP170_MAX_CODE_SIZE` with value
0x6000, which matches the name (`MAX_CODE_SIZE`) and value used for this limit
in [EIP-170](https://eips.ethereum.org/EIPS/eip-170 ).
Signed-off-by: Jamie Lokier <jamie@shareable.org>
2021-10-19 10:30:53 +01:00
jangko
165f9fea2e
reduce warnings
2020-07-21 13:15:06 +07:00
jangko
a2de3067a9
add test for short rlp in block witness
2020-07-08 23:17:48 +07:00
jangko
883f03b732
update block witness docs
2020-07-08 21:14:19 +07:00
jangko
0d0bc35137
block witness spec changes: explicit short rlp encoding
2020-07-08 21:05:20 +07:00
jangko
7d062e171b
block witness: add test for unwanted multiple identical keys when constructing witness from trie
2020-06-02 12:27:13 +03:00
jangko
57e9bea4ec
add more test for invalid input
2020-05-24 11:41:20 +07:00
jangko
6c583c8e32
block witness: add more tests contain invalid data
2020-05-19 09:27:53 +07:00
jangko
612192cf86
block witness: switch uint encoding to uvarint LEB128 encoding
2020-05-16 13:18:05 +07:00
jangko
61c60abdf2
block witness new spec impl
2020-05-14 11:09:01 +07:00
andri lim
758ebabd87
working test_witness_json prototype
2020-05-08 12:16:24 +07:00
andri lim
12b6d805cf
fix some invalid doAssert
2020-05-07 11:28:11 +07:00
andri lim
78f06426db
add more comments for both witness builder and tree builder
2020-05-06 11:45:21 +07:00
andri lim
e5c4c7d16f
fix typo
2020-05-06 10:36:00 +07:00
andri lim
aa572696c5
fix account node with 'CodeUntouched' type
2020-05-05 20:07:38 +07:00
andri lim
37db9a55ee
deals with touched/not touched account code
2020-05-05 15:21:39 +07:00
andri lim
e9191fefa1
witness builder major transformation, support multiproof
2020-05-05 13:50:31 +07:00
andri lim
6a9555b2b9
add raises to public API
2020-05-03 08:47:14 +07:00
andri lim
1ef3f60b40
validate the branch of the constructed trie beside validate rootHash
2020-05-03 08:11:04 +07:00
andri lim
6ccb2d65cd
tidier readbytes exception
2020-04-29 16:59:38 +07:00
andri lim
41753a55e9
fix typo
2020-04-29 16:26:09 +07:00
andri lim
7c2ed75b09
treebuilder will raise exception on parsing error
2020-04-29 16:22:39 +07:00
andri lim
fdb750f67e
implement witness header encoding decoding and implement buildForest
2020-04-29 15:29:25 +07:00
andri lim
90c2ede43b
deals with EIP170 error
2020-04-29 13:06:27 +07:00
andri lim
d95ded217b
implement account storage encoding and decoding
2020-04-29 13:06:26 +07:00
andri lim
4de8eaa81d
implement account code encoding and decoding
2020-04-29 13:06:26 +07:00
andri lim
2ae02fd629
implement account serializer and deserializer
2020-04-29 13:06:25 +07:00
andri lim
a540b8cbeb
InputStream still unstable, use seq[byte] again
2020-04-29 13:06:25 +07:00
andri lim
8db1109515
remove 17th elem code from branch node parser/encoder
2020-04-29 13:06:23 +07:00
andri lim
649597e714
cleanup unused code
2020-04-29 13:06:23 +07:00
andri lim
cecb8986a4
readU32 new spec, change LE to BE
2020-04-29 13:06:23 +07:00
andri lim
73c487fdb0
switch back to InputStream
2020-04-29 13:06:22 +07:00
andri lim
323204d939
deals with short node len < 32
2020-04-29 13:06:22 +07:00
andri lim
9cebceaf8e
hex prefix encoding minor optimization
2020-04-29 13:06:21 +07:00
andri lim
c33fb4deed
block witness: trie node encoding roundtrip test success using recursive functions
2020-04-29 13:06:20 +07:00
andri lim
809f9d13bd
move witness types from tree_from_witness.nim to witness_types.nim
2020-04-29 13:06:20 +07:00
andri lim
2a4228c7a7
use stew/endians2/fromBytesLE to parse uint32
2020-04-29 13:05:14 +07:00
Zahary Karadjov
8ab61abacd
Use the latest FastStreams API
2020-04-29 12:47:56 +07:00
andri lim
c943c699f2
implement tree builder [skip ci] ***NO_CI***
2020-04-29 12:47:56 +07:00