feat: adapt proof-engine client to zkboost v0.9.0 API#40
Conversation
00da738 to
0f583de
Compare
0f583de to
6634874
Compare
| let beacon_chain_builder = if let Some(execution_config) = config.execution_layer.clone() { | ||
| let genesis_time = beacon_chain_builder | ||
| .genesis_time | ||
| .ok_or("execution layer requires a genesis time")?; | ||
| let execution_layer = ExecutionLayer::from_config( | ||
| execution_config, | ||
| context.executor.clone(), | ||
| &spec, | ||
| genesis_time, | ||
| ) | ||
| .map_err(|e| format!("unable to start execution layer endpoints: {:?}", e))?; | ||
| beacon_chain_builder.execution_layer(Some(execution_layer)) | ||
| } else { | ||
| beacon_chain_builder | ||
| }; |
There was a problem hiding this comment.
Move after the ExecutionLayer construction a bit in order to get genesis_time
| /// Execution fork identifier, encoded as a `u64` discriminant. | ||
| /// | ||
| /// Only the forks a consensus client can resolve are listed. | ||
| #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] | ||
| #[repr(u64)] | ||
| pub enum ProtocolFork { | ||
| Paris = 14, | ||
| Shanghai = 15, | ||
| Cancun = 16, | ||
| Prague = 17, | ||
| Osaka = 18, | ||
| Bpo1 = 19, | ||
| Bpo2 = 20, | ||
| // Skipping Bpo3, Bpo4 and Bpo5 which will be removed in next spec release. | ||
| Amsterdam = 24, | ||
| } |
There was a problem hiding this comment.
It only includes the forks after the merge here (the whole list can be found here, and note that in next update of spec the enum is also updated, so we'd need to bump the values here).
| blob_max.map(|max| BlobSchedule { | ||
| max, | ||
| // `target` and `base_fee_update_fraction` left `0` to be filled | ||
| // by proof node. Eventually `BlobSchedule` will be removed. | ||
| target: 0, | ||
| base_fee_update_fraction: 0, | ||
| }), |
There was a problem hiding this comment.
Note: the blob_schedule will be removed for the next release of spec
| pub request_root: Hash256, | ||
| pub parent_hash: ExecutionBlockHash, | ||
| pub block_number: u64, | ||
| pub block_timestamp: u64, |
There was a problem hiding this comment.
Added block_timestamp so when verification we can resolve the correct activated ChainConfig, not sure if there is simpler way to get timestamp without storing it.
| ssz_body: Vec<u8>, | ||
| proof_attributes: ProofAttributes, | ||
| ) -> Result<Hash256, ProofEngineError>; | ||
| async fn request_proofs(&self, ssz_body: Vec<u8>) -> Result<Hash256, ProofEngineError>; |
There was a problem hiding this comment.
Takes SSZ-encoded ProofRequestBody to avoid EthSpec generic, same for verify_proof below
| pub enum ProofType { | ||
| EthrexRisc0 = 0, | ||
| EthrexOpenVM = 0, | ||
| EthrexSP1 = 1, | ||
| EthrexZisk = 2, | ||
| RethOpenVM = 3, | ||
| RethRisc0 = 4, | ||
| RethSP1 = 5, | ||
| RethZisk = 6, | ||
| RethSP1 = 4, | ||
| RethZisk = 5, | ||
| } |
There was a problem hiding this comment.
Updated the ProofType enum accordinng to ere-guests released guests
| @@ -18,10 +18,10 @@ participants: | |||
| cl_extra_params: | |||
There was a problem hiding this comment.
Update the kurtosis network file to use latest zkboost and ere images (and update --proof-types)
ProofRequestBodyandProofVerificationBodyChainConfigto proof request and verification endpoints.ChainSpecand the blocktimestampHttpProofEngineconstructor now takes extra(spec, genesis_time, slots_per_epoch)so we can resolve by comparing thetimestamp(henceExecutionLayer::from_confignow takes extra(spec, genesis_time))