TODOs for proper verification of BEEFY commitments
Closed this issue · 1 comments
denalimarsh commented
In #314 proper verification steps are commented out in order to mock the complete BEEFY commitment relay lifecycle. In order for the verified relay of BEEFY commitments, the following verification steps must be re-integrated:
- The
relayerchain
's Listener needs to query the current BEEFY authorities directly from the chain. MethodgetBeefyAuthorities
contains most of the required functionality, but the data must be properly parsed and validated. The authority addresses are currently hardcoded. In order to pass the contract's validation check, the address must be included in the latest validator set (validated against the latestroot
).
In store/beefy.go
:
- Method
BuildNewSignatureCommitmentMessage
must properly update the signature format (Polkadot uses recovery IDs 0 or 1, Eth uses 27 or 28, so we need to add 27). - Method
BuildNewSignatureCommitmentMessage
must correctly add bitfield information. The bitfield information is currently hardcoded to a random value. - Method
GenerateMerkleProofOffchain
needs to generate a valid MerkleProof for the signing validator. The proof is considered valid if it is accepted by the smart contract's validation check. Currently, the generated MerkleProof passed verification in the method fails in the contract. - Method
BuildCompleteSignatureCommitmentMessage
must use theSeed
i.e. Ethereum block hash to select a set of validator positions to be used in the final transaction. Validator signatures and public keys must be selected according to the validator positons relayed to the contract in the transaction.
musnit commented
all completed in recent PRs