Bump Portal test vectors and re-activate skipped tests (#2515)

This commit is contained in:
Kim De Mey 2024-07-23 11:59:59 +02:00 committed by GitHub
parent 08bbb0079f
commit 84ce0c912e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 33 additions and 39 deletions

View File

@ -247,8 +247,7 @@ procSuite "Portal testnet tests":
headerFile =
"./vendor/portal-spec-tests/tests/mainnet/history/headers/1000001-1000010.e2s"
accumulatorFile =
"./vendor/portal-spec-tests/tests/mainnet/history/accumulator/epoch-accumulator-00122.ssz"
# TODO: rename
"./vendor/portal-spec-tests/tests/mainnet/history/accumulator/epoch-record-00122.ssz"
blockDataFile = "./fluffy/tests/blocks/mainnet_blocks_1000001_1000010.json"
let

View File

@ -26,21 +26,19 @@ suite "History Block Proofs - Bellatrix":
"./vendor/portal-spec-tests/tests/mainnet/history/headers_with_proof/block_proofs_bellatrix/"
historicalRoots = loadHistoricalRoots()
# TODO: reactivate when test vectors PR gets merged
skip()
# for kind, path in walkDir(testsPath):
# if kind == pcFile and path.splitFile.ext == ".yaml":
# let
# testProof = YamlTestProofBellatrix.loadFromYaml(path).valueOr:
# raiseAssert "Cannot read test vector: " & error
for kind, path in walkDir(testsPath):
if kind == pcFile and path.splitFile.ext == ".yaml":
let
testProof = YamlTestProofBellatrix.loadFromYaml(path).valueOr:
raiseAssert "Cannot read test vector: " & error
# blockHash = BlockHash.fromHex(testProof.execution_block_header)
# blockProof = BeaconChainBlockProof(
# beaconBlockProof: array[11, Digest].fromHex(testProof.beacon_block_proof),
# beaconBlockRoot: Digest.fromHex(testProof.beacon_block_root),
# historicalRootsProof:
# array[14, Digest].fromHex(testProof.historical_roots_proof),
# slot: Slot(testProof.slot),
# )
blockHash = BlockHash.fromHex(testProof.execution_block_header)
blockProof = BeaconChainBlockProof(
beaconBlockProof: array[11, Digest].fromHex(testProof.beacon_block_proof),
beaconBlockRoot: Digest.fromHex(testProof.beacon_block_root),
historicalRootsProof:
array[14, Digest].fromHex(testProof.historical_roots_proof),
slot: Slot(testProof.slot),
)
# check verifyProof(historicalRoots, blockProof, blockHash)
check verifyProof(historicalRoots, blockProof, blockHash)

View File

@ -55,23 +55,21 @@ suite "History Block Proofs - Capella":
historicalSummaries = readHistoricalSummaries(historicalSummaries_path).valueOr:
raiseAssert "Cannot read historical summaries: " & error
# TODO: reactivate when test vectors PR gets merged
skip()
# for kind, path in walkDir(testsPath):
# if kind == pcFile and path.splitFile.ext == ".yaml":
# let
# testProof = YamlTestProof.loadFromYaml(path).valueOr:
# raiseAssert "Cannot read test vector: " & error
for kind, path in walkDir(testsPath):
if kind == pcFile and path.splitFile.ext == ".yaml":
let
testProof = YamlTestProof.loadFromYaml(path).valueOr:
raiseAssert "Cannot read test vector: " & error
# blockHash = BlockHash.fromHex(testProof.execution_block_header)
# blockProof = BeaconChainBlockProof(
# beaconBlockProof: array[11, Digest].fromHex(testProof.beacon_block_proof),
# beaconBlockRoot: Digest.fromHex(testProof.beacon_block_root),
# historicalSummariesProof:
# array[13, Digest].fromHex(testProof.historical_summaries_proof),
# slot: Slot(testProof.slot),
# )
blockHash = BlockHash.fromHex(testProof.execution_block_header)
blockProof = BeaconChainBlockProof(
beaconBlockProof: array[11, Digest].fromHex(testProof.beacon_block_proof),
beaconBlockRoot: Digest.fromHex(testProof.beacon_block_root),
historicalSummariesProof:
array[13, Digest].fromHex(testProof.historical_summaries_proof),
slot: Slot(testProof.slot),
)
# check verifyProof(
# historicalSummaries, blockProof, blockHash, networkData.metadata.cfg
# )
check verifyProof(
historicalSummaries, blockProof, blockHash, networkData.metadata.cfg
)

View File

@ -27,8 +27,7 @@ suite "History Content Encodings":
headerFile =
"./vendor/portal-spec-tests/tests/mainnet/history/headers/1000001-1000010.e2s"
accumulatorFile =
"./vendor/portal-spec-tests/tests/mainnet/history/accumulator/epoch-accumulator-00122.ssz"
# TODO: rename
"./vendor/portal-spec-tests/tests/mainnet/history/accumulator/epoch-record-00122.ssz"
headersWithProofFile =
"./vendor/portal-spec-tests/tests/mainnet/history/headers_with_proof/1000001-1000010.json"

@ -1 +1 @@
Subproject commit af2360565c4ed5342bb5533bace4e2b9712e0d1b
Subproject commit 4254dac8ce1cbe28fc4704d92aa6809c73451c20