-
Notifications
You must be signed in to change notification settings - Fork 131
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
feat: update beacon jsonrpc endpoints #1604
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
trin-beacon/src/jsonrpc.rs
Outdated
Some(client) => { | ||
let update = client.get_finality_update().await; | ||
match update { | ||
Ok(update) => Ok(json!((update))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok(update) => Ok(json!((update))), | |
Ok(update) => Ok(json!(update)), |
isn't this extra bracket redundent?
trin-beacon/src/jsonrpc.rs
Outdated
Some(client) => { | ||
let update = client.get_optimistic_update().await; | ||
match update { | ||
Ok(update) => Ok(json!((update))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok(update) => Ok(json!((update))), | |
Ok(update) => Ok(json!(update)), |
isn't this extra bracket redundent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
ethportal-api/src/beacon.rs
Outdated
@@ -60,6 +64,14 @@ pub trait BeaconNetworkApi { | |||
#[method(name = "beaconFinalizedHeader")] | |||
async fn finalized_header(&self) -> RpcResult<BeaconBlockHeader>; | |||
|
|||
/// Get the finality update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Get the finality update | |
/// Get the latest finality update |
ethportal-api/src/beacon.rs
Outdated
#[method(name = "beaconFinalityUpdate")] | ||
async fn finality_update(&self) -> RpcResult<LightClientFinalityUpdate>; | ||
|
||
/// Get the optimistic update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Get the optimistic update | |
/// Get the latest optimistic update |
rpc/src/beacon_rpc.rs
Outdated
@@ -116,6 +120,18 @@ impl BeaconNetworkApiServer for BeaconNetworkApi { | |||
Ok(proxy_to_subnet(&self.network, endpoint).await?) | |||
} | |||
|
|||
/// Get the optimistic update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Get the optimistic update. | |
/// Get the latest optimistic update. |
rpc/src/beacon_rpc.rs
Outdated
Ok(proxy_to_subnet(&self.network, endpoint).await?) | ||
} | ||
|
||
/// Get the finality update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Get the finality update. | |
/// Get the latest finality update. |
1de23c3
to
ba4bd23
Compare
The only change is the new beacon endpoints merged in e18427e via ethereum#1604
What was wrong?
Exposing the updates rather than the headers themselves is more useful for displaying information in
trin-desktop
.How was it fixed?
To-Do