Run all_tests instead of seperate parts tests#831
Conversation
|
As in, the status quo triggers this? or the changes here trigger this? It's worth looking into the runtime error. |
The changes trigger it locally for me, I want to see if the same occurs in CI. |
|
Better stacktrace: |
|
I tried gcc version is |
I tried the same for a standalone nim-eth repo and there was no crash either on my machine. I hit the crash originally by running the tests from inside a This means either used vendor modules differences or nim configs should be causing this difference in behaviour. I did not see an immediate suspect on the vendor modules, so I played around with the nimbus-eth1 Note that this put is done twice in that config file so one needs to be removed or overwritten. I'll remove one of those in the nimbus-eth1 repo. |
Can reproduce this now with Nim v2.2.4, v2.2.6, |
|
Replace import
std/[net, sequtils],
unittest2,
../common/keys,
../common/hashes,
../trie/[hexary, db, hexary_proof_verification]
discard PrivateKey.fromHex("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
suite "MPT trie proof verification":
test "Validate proof for existing value":
block:
var db = newMemoryDB()
var trie = initHexaryTrie(db)
const bytes = @[0'u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
trie.put(bytes, bytes)
for _ in [0]:
let
proof = @[@[248'u8, 67, 161, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]] # trie.getBranch(bytes)
root = Hash32([0x04'u8, 0xf4, 0xd4, 0x00, 0x43, 0x78, 0xc7, 0x62, 0xb2, 0xd8, 0xe0, 0x8f, 0x4b, 0x7c, 0xd6, 0xf2, 0xce, 0x43, 0x98, 0xb5, 0x7f, 0x3c, 0x62, 0xf4, 0x49, 0x0f, 0xc7, 0x3b, 0x7a, 0x0b, 0x2f, 0x4c]) # trie.rootHash()
res = verifyMptProof(proof, root, bytes, bytes)
doAssert res.isValid()
check: res.value == bytes
block:
var db = newMemoryDB()
var trie = initHexaryTrie(db)
const bytes = @[0'u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
trie.put(bytes, bytes)
let
nonExistingKey = toSeq([0'u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2])
proof = trie.getBranch(nonExistingKey)
# proof = @[@[248'u8, 67, 161, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]] # trie.getBranch(nonExistingKey)
root = Hash32([0x04'u8, 0xf4, 0xd4, 0x00, 0x43, 0x78, 0xc7, 0x62, 0xb2, 0xd8, 0xe0, 0x8f, 0x4b, 0x7c, 0xd6, 0xf2, 0xce, 0x43, 0x98, 0xb5, 0x7f, 0x3c, 0x62, 0xf4, 0x49, 0x0f, 0xc7, 0x3b, 0x7a, 0x0b, 0x2f, 0x4c]) # trie.rootHash()
res = verifyMptProof(proof, root, nonExistingKey, nonExistingKey)
doAssert res.isMissing()and switch("passL", "-Wno-stringop-overflow")
switch("passC", "-flto")
switch("passL", "-flto")
put("secp256k1.always", "-fno-lto")And then results in Using with any of Running It looks almost exactly like:
and I'd note that secp256k1 is the exact same library I had to keep I've already with mixed success tracked this one down to somewhere between 1-2k lines of C code. One difference with this one is that this one doesn't seem to depend on |
|
with |
|
-O2 seems to help with this one |
Triggers locally a runtime error on the orc build