mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-23 03:38:21 +00:00
fix output of proposer slashing test fixture (#1780)
* fix output of proposer slashing test fixture * run make test * a few more v0.12.3 spec refs
This commit is contained in:
parent
9f104d4344
commit
7eaaab908c
@ -130,10 +130,22 @@ OK: 6/6 Fail: 0/6 Skip: 0/6
|
||||
OK: 11/11 Fail: 0/11 Skip: 0/11
|
||||
## Official - Operations - Proposer slashing [Preset: mainnet]
|
||||
```diff
|
||||
+ [Invalid] identifier OK
|
||||
+ [Valid] identifier OK
|
||||
+ [Invalid] epochs_are_different OK
|
||||
+ [Invalid] headers_are_same_sigs_are_different OK
|
||||
+ [Invalid] headers_are_same_sigs_are_same OK
|
||||
+ [Invalid] invalid_different_proposer_indices OK
|
||||
+ [Invalid] invalid_proposer_index OK
|
||||
+ [Invalid] invalid_sig_1 OK
|
||||
+ [Invalid] invalid_sig_1_and_2 OK
|
||||
+ [Invalid] invalid_sig_1_and_2_swap OK
|
||||
+ [Invalid] invalid_sig_2 OK
|
||||
+ [Invalid] proposer_is_not_activated OK
|
||||
+ [Invalid] proposer_is_slashed OK
|
||||
+ [Invalid] proposer_is_withdrawn OK
|
||||
+ [Valid] success OK
|
||||
+ [Valid] success_slashed_and_proposer_index_the_same OK
|
||||
```
|
||||
OK: 2/2 Fail: 0/2 Skip: 0/2
|
||||
OK: 14/14 Fail: 0/14 Skip: 0/14
|
||||
## Official - Operations - Voluntary exit [Preset: mainnet]
|
||||
```diff
|
||||
+ [Invalid] invalid_signature OK
|
||||
@ -242,4 +254,4 @@ OK: 32/32 Fail: 0/32 Skip: 0/32
|
||||
OK: 5/5 Fail: 0/5 Skip: 0/5
|
||||
|
||||
---TOTAL---
|
||||
OK: 184/184 Fail: 0/184 Skip: 0/184
|
||||
OK: 196/196 Fail: 0/196 Skip: 0/196
|
||||
|
@ -185,7 +185,7 @@ func isAncestorOf*(a, b: BlockRef): bool =
|
||||
b = b.parent
|
||||
|
||||
func get_ancestor*(blck: BlockRef, slot: Slot): BlockRef =
|
||||
## https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/fork-choice.md#get_ancestor
|
||||
## https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/specs/phase0/fork-choice.md#get_ancestor
|
||||
## Return the most recent block as of the time at `slot` that not more recent
|
||||
## than `blck` itself
|
||||
doAssert not blck.isNil
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
# This module contains the parts necessary to create a merkle hash from the core
|
||||
# SSZ types outlined in the spec:
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/ssz/simple-serialize.md#merkleization
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/ssz/simple-serialize.md#merkleization
|
||||
|
||||
{.push raises: [Defect].}
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
# {.push raises: [Defect].}
|
||||
{.pragma: raisesssz, raises: [Defect, MalformedSszError, SszSizeMismatchError].}
|
||||
|
||||
## SSZ serialiazation for core SSZ types, as specified in:
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/ssz/simple-serialize.md#serialization
|
||||
## SSZ serialization for core SSZ types, as specified in:
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/ssz/simple-serialize.md#serialization
|
||||
|
||||
import
|
||||
typetraits, options,
|
||||
|
@ -16,7 +16,7 @@ type
|
||||
## which blocks are valid - in particular, blocks are not valid if they
|
||||
## come from the future as seen from the local clock.
|
||||
##
|
||||
## https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/fork-choice.md#fork-choice
|
||||
## https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/specs/phase0/fork-choice.md#fork-choice
|
||||
##
|
||||
# TODO replace time in chronos with a proper unit type, then this code can
|
||||
# follow:
|
||||
|
@ -5,7 +5,7 @@ The Nimbus beacon chain is a research implementation of the Beacon Chain – the
|
||||
|
||||
- Open sourced at [github.com/status-im/nim-beacon-chain](https://github.com/status-im/nim-beacon-chain/tree/master)
|
||||
|
||||
- Specification described at [ethereum/eth2.0-specs](https://github.com/ethereum/eth2.0-specs/tree/v0.12.2#phase-0)
|
||||
- Specification described at [ethereum/eth2.0-specs](https://github.com/ethereum/eth2.0-specs/tree/v0.12.3#phase-0)
|
||||
|
||||
|
||||
### Helpful resources
|
||||
|
@ -4,7 +4,7 @@ import testutils/fuzzing_engines
|
||||
|
||||
const
|
||||
gitRoot = thisDir() / ".."
|
||||
fixturesDir = gitRoot / "vendor" / "nim-eth2-scenarios" / "tests-v0.12.2" / "mainnet" / "phase0" / "ssz_static"
|
||||
fixturesDir = gitRoot / "vendor" / "nim-eth2-scenarios" / "tests-v0.12.3" / "mainnet" / "phase0" / "ssz_static"
|
||||
|
||||
fuzzingTestsDir = gitRoot / "tests" / "fuzzing"
|
||||
fuzzingCorpusesDir = fuzzingTestsDir / "corpus"
|
||||
|
@ -38,7 +38,7 @@ proc runTest(identifier: string) =
|
||||
else:
|
||||
prefix = "[Invalid] "
|
||||
|
||||
timedTest prefix & astToStr(identifier):
|
||||
timedTest prefix & identifier:
|
||||
let proposerSlashing = parseTest(testDir/"proposer_slashing.ssz", SSZ, ProposerSlashing)
|
||||
var preState = newClone(parseTest(testDir/"pre.ssz", SSZ, BeaconState))
|
||||
|
||||
|
@ -25,7 +25,7 @@ const
|
||||
RewardsDirLeak = RewardsDirBase/"leak"/"pyspec_tests"
|
||||
RewardsDirRandom = RewardsDirBase/"random"/"pyspec_tests"
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/tree/v0.12.2/tests/formats/rewards#rewards-tests
|
||||
# https://github.com/ethereum/eth2.0-specs/tree/v0.12.3/tests/formats/rewards#rewards-tests
|
||||
type Deltas = object
|
||||
rewards: List[uint64, Limit VALIDATOR_REGISTRY_LIMIT]
|
||||
penalties: List[uint64, Limit VALIDATOR_REGISTRY_LIMIT]
|
||||
|
Loading…
x
Reference in New Issue
Block a user