Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot have a zeroed Signature #374

Closed
mratsim opened this issue Sep 3, 2019 · 4 comments
Closed

Cannot have a zeroed Signature #374

mratsim opened this issue Sep 3, 2019 · 4 comments

Comments

@mratsim
Copy link
Contributor

mratsim commented Sep 3, 2019

The spec relies on zero signature in process_block_header: https://github.com/ethereum/eth2.0-specs/blob/v0.8.3/specs/core/0_beacon-chain.md#block-header.

which we diligently copied in our implementation: https://github.com/status-im/nim-beacon-chain/blob/297e9079d47f6070e06f425e8999eb46546029c8/beacon_chain/spec/state_transition_block.nim#L60-L67

However we can't have zero signatures:

import
  ../beacon_chain/spec/[crypto, datatypes],
  typetraits,
  blscurve

let x = BeaconBlockHeader()

echo x.signature.blsValue.type.name
echo x.signature.blsValue
echo x.signature.blsValue.getBytes
Signature
c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
[192, 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, 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, 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, 0, 0]
@mratsim
Copy link
Contributor Author

mratsim commented Sep 3, 2019

Actually already raised here: ethereum/eth2.0-tests#27.

It doesn't participate in hash_tree_root, isn't serialized or later so a workaround in the test vectors should be enough.

Edit: it is hashed

@mratsim
Copy link
Contributor Author

mratsim commented Sep 3, 2019

Very annoying for #375
as 3 tests fail due to needing to build on the workaround.

tersec pushed a commit that referenced this issue Sep 3, 2019
* Add sanity check for slot processing (also impacted by #373)

* use reportDiff also for all state tests vs EF

* initial sanity checks for blocks - workaround zero signature in block headers: #374

* Remove generic object variant compare commented code

* Add the one block state transition sanity checks

* generalize blocks test to multiple blocks

* simplify slots test runner

* Add official epoch transitions, sanity blocks, sanity slots to the test suite

* Fix index out-of-bounds in initiate_validator_exit - enable proposer slashings unittest
@mratsim
Copy link
Contributor Author

mratsim commented Sep 4, 2019

upstreamed: ethereum/consensus-specs#1396

@arnetheduck
Copy link
Member

see BlsValue in code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants