Commit Graph

81 Commits

Author SHA1 Message Date
Jacek Sieka 84664b0fc0
discv5: migrate to minilru (#741)
As it happens, the two share the exact same interface (even the test
suite removed in this PR passes) - `minilru` has an edge on efficiency
however, avoiding the doubly linked list node allocations etc
2024-10-03 12:34:38 +02:00
Jacek Sieka 6bd6bae86c
Align core types with execution spec (#733)
Since these types were written, we've gained an executable spec:

https://github.com/ethereum/execution-specs

This PR aligns some of the types we use with this spec to simplify
comparisons and cross-referencing.

Using a `distinct` type is a tradeoff between nim ergonomics, type
safety and the ability to work around nim quirks and stdlib weaknesses.

In particular, it allows us to overload common functions such as `hash`
with correct and performant versions as well as maintain control over
string conversions etc at the cost of a little bit of ceremony when
instantiating them.

Apart from distinct byte types, `Hash32`, is introduced in lieu of the
existing `Hash256`, again aligning this commonly used type with the spec
which picks bytes rather than bits in the name.
2024-09-29 10:52:19 +02:00
Miran b80c227f52
simplify .nimble file (#708) 2024-07-01 18:06:10 +02:00
Jacek Sieka 0e83cfda97
results: use standalone repo (#687) 2024-05-30 14:46:57 +02:00
tersec 16de7e7f5d
test refc in CI in Nim 2.0 and later (#676) 2024-02-14 03:35:28 +00:00
Kim De Mey 21f3014f54
Remove usage of stew/shim/net (#670)
* Remove usage of stew/shim/net and replace with std/net where needed

* Remove chronosStrictException compile flag
2024-01-24 09:09:11 +01:00
Jacek Sieka b89d712339
normalise nimble, ci (#567)
* normalise nimble, ci

* drop obsolete dep download

* add threads
2024-01-23 16:48:29 +00:00
Kim De Mey 496bcdab74
Fix chronos related deprecated warnings in discv5 and uTP (#667)
* Fix chronos related deprecated warnings in discv5

* Fix chronos related deprecated warnings in uTP code

* Improve discv5 closeWait order of events and add noCancel
2024-01-22 17:08:08 +01:00
Kim De Mey cbcd1fd307
Fix for uTP issues with latest chronos (#655)
* Fix for uTP issues with latest chronos

* Fix for discv5 issue with latest chronos

* Increase amount of data send in uTP and uTP over discv5 tests
2024-01-12 17:35:44 +01:00
jangko 6b8a7b009e
implement EIP-4844: Shard Blobs Transactions 2023-06-23 13:48:51 +07:00
tersec 7564b21ade
support only Nim 1.6+ (#606) 2023-05-09 20:19:44 +00:00
Kim De Mey 4d55bfc9e8
Move dcli tool to a tools folder (#584) 2023-01-27 18:40:40 +01:00
Kim De Mey 86b37bf72e
Default compile all tests and binaries with TRACE log level (#549)
In order to avoid unused warning and more importantly to make
sure all log statements work.
2022-11-10 09:01:58 +01:00
tersec 92b14b43eb
--styleCheck:error (#520)
* --styleCheck:error

* testcase -> testCase

* more testcase -> testCase

* remove unused imports

* MessageKind enum name consistency in tests

* rest of fuzz_decode_message

* rlpEncodeEIP155 -> rlpEncodeEip155
2022-07-21 08:58:17 +00:00
Jacek Sieka 41b8588ade
move rocksdb to nimbus-eth1 (#460)
sqlite ftw!
2022-04-04 13:46:57 +02:00
jangko cf95b688e6
EIP-4399 preparation
From EIP-4399 spec:

Renaming

The mixHash field SHOULD further be renamed to random.

...
2022-02-01 13:41:50 +07:00
Kim De Mey 2c236f6495
Style fixes according to --styleCheck:usages (#452)
Currently only setting `--styleCheck:hint` as there are some
dependency fixes required and the compiler seems to trip over the
findnode MessageKind, findnode Message field and the findNode
proc. Also over protocol.Protocol usage.
2021-12-20 13:14:50 +01:00
Ștefan Talpalaru 2088d7568d
CI: test with multiple Nim version (#429)
* CI: test with multiple Nim version

* clean up the testing tree a little

* replace "unittest" with "unittest2"
2021-12-11 19:12:55 +01:00
Etan Kissling 3ce2d9a58e
remove outdated and incorrect SSZ code
This removes the outdated copy of the SSZ code. It became incorrect
over time (e.g., empty SSZ list elements), and is no longer in use by
GitHub projects: https://github.com/search?q=extension%3Anim+eth%2Fssz

The canonical SSZ implementation resides at `nim-ssz-serialization`.
Compared to `nim-eth`, these changes were made meanwhile:
- `bitseqs` was extended with JSON serialization support,
  and with the new functions `isZero` and `countOnes`.
- `bytes_reader` was renamed to `codec`, extended with a few additional
  SSZ type conversions as well as support for `SingleMemberUnion`.
- The simplified merkle tree implementation in `merkle_tree.nim`
  was removed. It was not used by other projects.
- `merkleization` was extended with support for `HashArray`, `HashList`
  and `SingleMemberUnion`. The `isValidProof` functionality has been
  moved to `nimbus-eth2` and replaced with the EF defined function
  `is_valid_merkle_branch`. The test was also moved to `nimbus-eth2`.
  There are no other GitHub projects using `isValidProof`:
  https://github.com/search?q=extension%3Anim+isValidProof
  Furthermore, a definition for `GeneralizedIndex` was added.
- `ssz_serialization` was moved one directory up, and improved with
  bug fixes and `HashArray`, `HashList` and `SingleMemberUnion` support.
- `types` was extended with JSON serialization and new type support for
  `Uint128`, `Uint256`, `HashArray`, `HashList` and `SingleMemberUnion`.
  There is also a new `getBit` function for `BitList`.
2021-12-10 15:51:22 +01:00
KonradStaniec 8139aae346
Advertise correct rcv buffer size (#423)
* Advertise correct rcv buffer size
2021-11-12 10:58:49 +01:00
KonradStaniec 7ae287ad1b
Add rudimentary connect function (#405)
* Add rudimentary connect function
2021-10-11 14:16:06 +02:00
KonradStaniec 9f2f101070
Add initial skeleton of utp protocol (#397)
* Add initial impl of utp over udp

* Add more comments

* Add licenses and push declarations

* Add tests to nimble task

* Pr comments

Use better random generator
Raise assert error in case of buffer io exception
2021-09-13 14:54:06 +02:00
Kim De Mey df6020832b
Build fuzzing tests in CI and fix current fuzzing tests (#396)
* Build fuzzing tests in CI and fix current fuzzing tests

* Build fuzzing tests separately (fix Windows CI)
2021-09-07 16:00:01 +02:00
KonradStaniec e3fba48f0f
add merkle proof verification (#379)
* add merkle proof verification

* remove redundant buffer

* simplify verification function
2021-07-23 13:40:47 +02:00
KonradStaniec 20ad6504b7
Add merkleization tests (#378)
* Add merkleization tests

* Fix typo in build file

* add test prefix
2021-07-21 09:24:07 +02:00
Kim De Mey 41127eaee8
Remove portal wire code which was moved to nimbus-eth1 repo (#370) 2021-07-09 22:14:31 +02:00
kdeme e2e30247bf
Add implementation of Portal wire protocol 2021-06-09 14:57:30 +02:00
Kim De Mey 41aba1b6a0
Add nim allowed versions in nimble (#363) 2021-06-02 22:23:36 +02:00
kdeme 90b4724492
Adjust for chronosStrictException usage in rest of eth/p2p 2021-05-06 17:20:54 +02:00
kdeme b0474c0d40
Add raises annotations to discovery.nim
And add push raises Defect, remove unneeded gcsafe and remove
all usage of inline.
2021-04-27 21:11:54 +02:00
kdeme 9fed10de88
Allow for discv4 chronos strict usage
And group p2p tests that can be run with strict usage along the way.
2021-04-27 10:09:54 +02:00
Jamie Lokier a48687d277
discv4: Add test associated with fix to Kademlia crash (#341)
It's been confirmed that the test fails if the Kademlia crash workaround isn't
in `findNode`, and passes with it there.

Signed-off-by: Jamie Lokier <jamie@shareable.org>
2021-04-06 18:46:32 +01:00
Kim De Mey 762415319c
Add build_dcli target and add it to CI (#344)
* Add build_dcli target and add it to CI

* Fix local imports for dcli

* And use local imports for all other files too

* Use local imports in tests and rlpx protocols
2021-04-06 13:33:24 +02:00
Kim De Mey 207b783253
Nimble file cleanup and group discv5 tests to compile once (#340) 2021-03-29 15:26:34 +02:00
Kim De Mey ac8aa0e037
Run discv5 tests with chronosStrictException on (#338) 2021-03-26 15:20:03 +01:00
kdeme e43ee6ef9c Add ip address voting through pong responses 2021-02-01 20:30:55 +02:00
jangko f50a68a992
add github action 2021-01-05 18:54:53 +07:00
kdeme 44637cdd8e
Remove support for discovery v5.0 2020-11-13 12:33:07 +01:00
kdeme 8042d72711 Add discovery v5.1 implementation 2020-10-16 21:20:47 +03:00
Kim De Mey c9caafb2a4
Replace memory db with lrucache for temporary storage of sessions (#292) 2020-09-10 14:49:48 +02:00
Ștefan Talpalaru 8e8c982270
Nimble: go back to depending on nim-nat-traversal HEAD (#291) 2020-08-28 04:13:16 +00:00
tersec 6ca6a91875
revert nimble reference to previous nat-traversal commit (#289)
* try VS 2013 image

* try mingw/gcc 7.3 for x64

* try mingw/gcc 6.3 for x64

* DIR not supported

* try systeminfo and/or wmic

* dump path, attempt 1

* dump gcc version

* move diagnostics to before nimble install

* try reverting to previous nim-nat-traversal commit

* fix nimble syntax

* try reverting non-git-commit-related changes

* remove echo %CC%, which showed that variable nonexistent or empty
2020-08-27 21:11:46 +00:00
Kim De Mey f3de959261
Discv5 readme (#278)
* Add discovery v5 readme + test_discv5 task

* Move hkdf tests to test file and add to nimble task
2020-07-12 23:53:27 +02:00
kdeme 2d7b3440f2 make bitsPerHop configurable + add routing table tests 2020-06-23 09:35:12 +02:00
kdeme 4d0a7a46ba Update fuzzing tests now that the helpers have moved to ntu 2020-06-12 18:58:05 +03:00
kdeme ff7bed9555 Add discoveryv5 debugging tool: dcli 2020-06-03 16:08:15 +03:00
kdeme 17586c05d7 Remove waku protocol from the repository 2020-05-07 20:49:00 +03:00
Jacek Sieka 205b57fe71
port kvstore from nim-beacon-chain (#230)
* port kvstore from nim-beacon-chain
* remove old database backends
* use kvstore in trie database
* add sqlite dep
* avoid template param double evaluation
* clean up heterogenous lookup todo
2020-04-27 15:16:11 +02:00
Jacek Sieka 1646d78d83
cleanups (#226) 2020-04-18 10:17:59 +02:00
Jacek Sieka e9b25b5309
Result rocks (#225)
* rocksdb: update
2020-04-18 07:21:13 +02:00