diff --git a/.gitmodules b/.gitmodules index df485cc17..323c31aeb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -193,3 +193,8 @@ url = https://github.com/status-im/nim-websock ignore = dirty branch = master +[submodule "vendor/nim-ssz-serialization"] + path = vendor/nim-ssz-serialization + url = https://github.com/status-im/nim-ssz-serialization.git + ignore = untracked + branch = master diff --git a/fluffy/common/common_types.nim b/fluffy/common/common_types.nim index f755e18b0..82b64fb81 100644 --- a/fluffy/common/common_types.nim +++ b/fluffy/common/common_types.nim @@ -8,7 +8,7 @@ {.push raises: [Defect].} import - eth/ssz/ssz_serialization + ssz_serialization/types type ByteList* = List[byte, 2048] diff --git a/fluffy/network/history/history_content.nim b/fluffy/network/history/history_content.nim index bb456459d..6959a1e25 100644 --- a/fluffy/network/history/history_content.nim +++ b/fluffy/network/history/history_content.nim @@ -12,7 +12,7 @@ import std/options, nimcrypto/[sha2, hash], stew/objects, stint, - eth/ssz/ssz_serialization, + ssz_serialization, ../../common/common_types export ssz_serialization, common_types diff --git a/fluffy/network/state/state_content.nim b/fluffy/network/state/state_content.nim index 43de076d2..3f130e5e6 100644 --- a/fluffy/network/state/state_content.nim +++ b/fluffy/network/state/state_content.nim @@ -12,7 +12,7 @@ import std/options, nimcrypto/[sha2, hash], stew/objects, stint, - eth/ssz/ssz_serialization, + ssz_serialization, ../../common/common_types export ssz_serialization, common_types diff --git a/fluffy/network/wire/messages.nim b/fluffy/network/wire/messages.nim index 2a935b154..8a165a0bb 100644 --- a/fluffy/network/wire/messages.nim +++ b/fluffy/network/wire/messages.nim @@ -13,7 +13,7 @@ import std/options, stint, stew/[results, objects], - eth/ssz/ssz_serialization, + ssz_serialization, ../../common/common_types export ssz_serialization, stint, common_types @@ -114,9 +114,6 @@ template messageKind*(T: typedesc[SomeMessage]): MessageKind = template toSszType*(x: UInt256): array[32, byte] = toBytesLE(x) -template toSszType*(x: auto): auto = - x - func fromSszBytes*(T: type UInt256, data: openArray[byte]): T {.raises: [MalformedSszError, Defect].} = if data.len != sizeof(result): diff --git a/fluffy/network/wire/portal_protocol.nim b/fluffy/network/wire/portal_protocol.nim index fb723da7d..c0f03ea4c 100644 --- a/fluffy/network/wire/portal_protocol.nim +++ b/fluffy/network/wire/portal_protocol.nim @@ -13,8 +13,8 @@ import std/[sequtils, sets, algorithm], stew/results, chronicles, chronos, nimcrypto/hash, + ssz_serialization, eth/rlp, eth/p2p/discoveryv5/[protocol, node, enr, routing_table, random2, nodes_verification], - eth/ssz/ssz_serialization, ./messages export messages, routing_table diff --git a/fluffy/tests/test_state_network.nim b/fluffy/tests/test_state_network.nim index f671f3d13..d7a3e2f02 100644 --- a/fluffy/tests/test_state_network.nim +++ b/fluffy/tests/test_state_network.nim @@ -8,7 +8,7 @@ import std/os, testutils/unittests, - eth/[keys, trie/db, trie/hexary, ssz/ssz_serialization], + eth/[keys, trie/db, trie/hexary], eth/p2p/discoveryv5/protocol as discv5_protocol, eth/p2p/discoveryv5/routing_table, ../../nimbus/[genesis, chain_config, config, db/db_chain], ../network/wire/portal_protocol, diff --git a/vendor/nim-ssz-serialization b/vendor/nim-ssz-serialization new file mode 160000 index 000000000..5d65b20d6 --- /dev/null +++ b/vendor/nim-ssz-serialization @@ -0,0 +1 @@ +Subproject commit 5d65b20d6b56265902e5c9b6a2be4d1c2fd6427e