mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 05:44:44 +00:00
exchangeCapabilities & Capella Readiness Logging (#3918)
* Undo Passing Spec to Engine API * Utilize engine_exchangeCapabilities * Add Logging to Indicate Capella Readiness * Add exchangeCapabilities to mock_execution_layer * Send Nested Array for engine_exchangeCapabilities * Use Mutex Instead of RwLock for EngineCapabilities * Improve Locking to Avoid Deadlock * Prettier logic for get_engine_capabilities * Improve Comments * Update beacon_node/beacon_chain/src/capella_readiness.rs Co-authored-by: Michael Sproul <micsproul@gmail.com> * Update beacon_node/beacon_chain/src/capella_readiness.rs Co-authored-by: Michael Sproul <micsproul@gmail.com> * Update beacon_node/beacon_chain/src/capella_readiness.rs Co-authored-by: Michael Sproul <micsproul@gmail.com> * Update beacon_node/beacon_chain/src/capella_readiness.rs Co-authored-by: Michael Sproul <micsproul@gmail.com> * Update beacon_node/beacon_chain/src/capella_readiness.rs Co-authored-by: Michael Sproul <micsproul@gmail.com> * Update beacon_node/client/src/notifier.rs Co-authored-by: Michael Sproul <micsproul@gmail.com> * Update beacon_node/execution_layer/src/engine_api/http.rs Co-authored-by: Michael Sproul <micsproul@gmail.com> * Addressed Michael's Comments --------- Co-authored-by: Michael Sproul <micsproul@gmail.com>
This commit is contained in:
@@ -122,7 +122,7 @@ impl SszEth1Cache {
|
||||
cache: self.deposit_cache.to_deposit_cache()?,
|
||||
last_processed_block: self.last_processed_block,
|
||||
}),
|
||||
endpoint: endpoint_from_config(&config, &spec)
|
||||
endpoint: endpoint_from_config(&config)
|
||||
.map_err(|e| format!("Failed to create endpoint: {:?}", e))?,
|
||||
to_finalize: RwLock::new(None),
|
||||
// Set the remote head_block zero when creating a new instance. We only care about
|
||||
|
||||
@@ -363,7 +363,7 @@ impl Default for Config {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn endpoint_from_config(config: &Config, spec: &ChainSpec) -> Result<HttpJsonRpc, String> {
|
||||
pub fn endpoint_from_config(config: &Config) -> Result<HttpJsonRpc, String> {
|
||||
match config.endpoint.clone() {
|
||||
Eth1Endpoint::Auth {
|
||||
endpoint,
|
||||
@@ -373,16 +373,11 @@ pub fn endpoint_from_config(config: &Config, spec: &ChainSpec) -> Result<HttpJso
|
||||
} => {
|
||||
let auth = Auth::new_with_path(jwt_path, jwt_id, jwt_version)
|
||||
.map_err(|e| format!("Failed to initialize jwt auth: {:?}", e))?;
|
||||
HttpJsonRpc::new_with_auth(
|
||||
endpoint,
|
||||
auth,
|
||||
Some(config.execution_timeout_multiplier),
|
||||
spec,
|
||||
)
|
||||
.map_err(|e| format!("Failed to create eth1 json rpc client: {:?}", e))
|
||||
HttpJsonRpc::new_with_auth(endpoint, auth, Some(config.execution_timeout_multiplier))
|
||||
.map_err(|e| format!("Failed to create eth1 json rpc client: {:?}", e))
|
||||
}
|
||||
Eth1Endpoint::NoAuth(endpoint) => {
|
||||
HttpJsonRpc::new(endpoint, Some(config.execution_timeout_multiplier), spec)
|
||||
HttpJsonRpc::new(endpoint, Some(config.execution_timeout_multiplier))
|
||||
.map_err(|e| format!("Failed to create eth1 json rpc client: {:?}", e))
|
||||
}
|
||||
}
|
||||
@@ -409,7 +404,7 @@ impl Service {
|
||||
deposit_cache: RwLock::new(DepositUpdater::new(
|
||||
config.deposit_contract_deploy_block,
|
||||
)),
|
||||
endpoint: endpoint_from_config(&config, &spec)?,
|
||||
endpoint: endpoint_from_config(&config)?,
|
||||
to_finalize: RwLock::new(None),
|
||||
remote_head_block: RwLock::new(None),
|
||||
config: RwLock::new(config),
|
||||
@@ -438,7 +433,7 @@ impl Service {
|
||||
inner: Arc::new(Inner {
|
||||
block_cache: <_>::default(),
|
||||
deposit_cache: RwLock::new(deposit_cache),
|
||||
endpoint: endpoint_from_config(&config, &spec)
|
||||
endpoint: endpoint_from_config(&config)
|
||||
.map_err(Error::FailedToInitializeFromSnapshot)?,
|
||||
to_finalize: RwLock::new(None),
|
||||
remote_head_block: RwLock::new(None),
|
||||
|
||||
@@ -494,8 +494,7 @@ mod deposit_tree {
|
||||
let mut deposit_counts = vec![];
|
||||
|
||||
let client =
|
||||
HttpJsonRpc::new(SensitiveUrl::parse(ð1.endpoint()).unwrap(), None, spec)
|
||||
.unwrap();
|
||||
HttpJsonRpc::new(SensitiveUrl::parse(ð1.endpoint()).unwrap(), None).unwrap();
|
||||
|
||||
// Perform deposits to the smart contract, recording it's state along the way.
|
||||
for deposit in &deposits {
|
||||
@@ -599,12 +598,8 @@ mod http {
|
||||
.expect("should start eth1 environment");
|
||||
let deposit_contract = ð1.deposit_contract;
|
||||
let web3 = eth1.web3();
|
||||
let client = HttpJsonRpc::new(
|
||||
SensitiveUrl::parse(ð1.endpoint()).unwrap(),
|
||||
None,
|
||||
&MainnetEthSpec::default_spec(),
|
||||
)
|
||||
.unwrap();
|
||||
let client =
|
||||
HttpJsonRpc::new(SensitiveUrl::parse(ð1.endpoint()).unwrap(), None).unwrap();
|
||||
|
||||
let block_number = get_block_number(&web3).await;
|
||||
let logs = blocking_deposit_logs(&client, ð1, 0..block_number).await;
|
||||
@@ -720,8 +715,7 @@ mod fast {
|
||||
)
|
||||
.unwrap();
|
||||
let client =
|
||||
HttpJsonRpc::new(SensitiveUrl::parse(ð1.endpoint()).unwrap(), None, &spec)
|
||||
.unwrap();
|
||||
HttpJsonRpc::new(SensitiveUrl::parse(ð1.endpoint()).unwrap(), None).unwrap();
|
||||
let n = 10;
|
||||
let deposits: Vec<_> = (0..n).map(|_| random_deposit_data()).collect();
|
||||
for deposit in &deposits {
|
||||
|
||||
Reference in New Issue
Block a user