-
Notifications
You must be signed in to change notification settings - Fork 97
Pharos Network Integration #593
Description
Pharos is an upcoming EVM-compatible L1.
This describes the implementation details for integrating Pharos network with Hyperbridge.
Network Info
- The active validator set for the network is stored on-chain in a system contract at address
0x4100000000000000000000000000000000000000. More information in the link
https://silken-muskox-24e.notion.site/Pharos-Staking-Contract-2b18ec314f7580c1b885e2fa8d8a70e9
Mainnet Epoch length: 4 hours
Testnet Epoch Length: 0.5 hours
The validator set is updated in the last block of each epoch, and these changes take effect in the next block, that is, the first block of the new epoch.
A proof for a block can be fetched using the debug_getBlockProof api https://docs.pharosnetwork.xyz/api-and-sdk/json-rpc-api-methods#debug_getblockproof
The response contains the aggregated BLS signature for the block and the public keys of participating validators.
Authority set rotation:
Authority-set rotations occur at the last block of an epoch, so a consensus update for that block must be submitted to the consensus client.
The consensus update for the last block in an epoch should be accompanied by a state proof of the new validator set as recorded in the staking contract described above.
You can check how the Pharos blocks should be verified here
https://github.com/PharosNetwork/examples/blob/main/block-bls-verification/main.go
- Pharos prover
Fetch block proofs from the debug_BlockProof Api
For the last block in an epoch fetch a state proof of the new validator set - Pharos verifier
Verify bls signature of the block
Vwerify authority set state proof if the block is an epoch boundary block - Pharos Ismp Consensus Client
- Pharos tesseract Consensus Client