Commit Graph

24 Commits

Author SHA1 Message Date
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
jangko 917888356e
no more wild constants and rename ecdhSecret to ecdhSharedSecret 2023-04-21 16:08:57 +07:00
jangko 9bf2e1786b
remove ecdhRaw usage and replace it with ecdh+custom hash function 2023-04-20 15:45:23 +07:00
Jacek Sieka 1b516682bd
bearssl: use split api (#510) 2022-06-17 22:45:37 +02: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
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
Jacek Sieka 484fbcab1b
use bearssl rng throughout (#265)
* use bearssl rng throughout

* seeder can fail

* imports and exports

* modules, sigh

* one more try

* move var

* even fewer thread vars

* remove out-of-date genrated files
2020-07-07 10:56:26 +02:00
Jacek Sieka 61feae0f21
secp: requiresInit updates (#258)
* secp: requiresInit updates

* fixup!

* clean up mapconverts
2020-06-22 18:07:48 +02: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 7c709551a5
secp: use upstream convenience API (#224) 2020-04-17 13:13:08 +02:00
Jacek Sieka ac5bbe4d3d
keys: get rid of deprecated calls (#213) 2020-04-04 18:44:01 +02:00
Jacek Sieka 42b36d1aef
secp: handle invalid keys better (#210)
* secp: handle invalid keys better

we can't guarantee with the type system that invalid keys don't exist,
so we have to introduce error handling for it
2020-04-04 11:40:47 +02:00
Jacek Sieka 02d661503f
refactor secp interface (#203)
* avoid mix of exceptions and return codes
* introduce result
* use deprecated compatibility API to avoid big-bang refactoring
* loosely based on nim-libp2p secp as well as the rust-secp256k1 wrapper
* oh, boy does our secp256k1 wrapper need updating - we're _far_
behind...
2020-04-02 14:40:29 +02:00
Zahary Karadjov 5ca1a21ecd
Enable the public-private key consistency test 2020-02-19 11:21:23 +02:00
Zahary Karadjov 6ef16785ce
Add equals operator for keys 2020-02-19 11:11:45 +02:00
Jacek Sieka 4c6878343c tighten a few imports 2019-12-09 14:37:21 +02:00
Yuriy Glukhov 10e35d3def Support for compressed public key format 2019-11-21 11:50:12 +02:00
kdeme 44400ee549 Fix nim v1.0.2 compile issues 2019-10-29 14:44:26 +02:00
Ștefan Talpalaru 9146e8e2f0
assert() -> doAssert() 2019-03-13 23:15:26 +01:00
Yuriy Glukhov e75a00f86e Moved eth-p2p to eth 2019-02-05 17:40:29 +02:00
Yuriy Glukhov 260cf706e9 Fixed test configs 2019-02-05 13:06:22 +02:00
Yuriy Glukhov 621293c8d2 Added config.nims to keys tests 2019-02-05 12:33:41 +02:00
Yuriy Glukhov 4c89f9e270 Moved eth-keys to eth 2019-02-05 12:32:22 +02:00