@chainsafe/lodestar-api
Advanced tools
Comparing version 0.39.0-dev.851d6985dc to 0.39.0-dev.8dfc8258ed
import { Epoch, phase0, Slot, RootHex, altair, UintNum64 } from "@chainsafe/lodestar-types"; | ||
import { Type } from "@chainsafe/ssz"; | ||
import { RouteDef } from "../../utils/index.js"; | ||
export declare type LightclientHeaderUpdate = { | ||
export declare type LightclientOptimisticHeaderUpdate = { | ||
syncAggregate: altair.SyncAggregate; | ||
@@ -32,6 +32,6 @@ attestedHeader: phase0.BeaconBlockHeader; | ||
chainReorg = "chain_reorg", | ||
/** New or better header update available */ | ||
lightclientHeaderUpdate = "lightclient_header_update", | ||
/** New or better optimistic header update available */ | ||
lightclientOptimisticUpdate = "light_client_optimistic_update", | ||
/** New or better finalized update available */ | ||
lightclientFinalizedUpdate = "lightclient_finalized_update" | ||
lightclientFinalizedUpdate = "light_client_finalized_update" | ||
} | ||
@@ -67,3 +67,3 @@ export declare type EventData = { | ||
}; | ||
[EventType.lightclientHeaderUpdate]: LightclientHeaderUpdate; | ||
[EventType.lightclientOptimisticUpdate]: LightclientOptimisticHeaderUpdate; | ||
[EventType.lightclientFinalizedUpdate]: LightclientFinalizedUpdate; | ||
@@ -70,0 +70,0 @@ }; |
@@ -23,6 +23,6 @@ import { ssz, StringType } from "@chainsafe/lodestar-types"; | ||
EventType["chainReorg"] = "chain_reorg"; | ||
/** New or better header update available */ | ||
EventType["lightclientHeaderUpdate"] = "lightclient_header_update"; | ||
/** New or better optimistic header update available */ | ||
EventType["lightclientOptimisticUpdate"] = "light_client_optimistic_update"; | ||
/** New or better finalized update available */ | ||
EventType["lightclientFinalizedUpdate"] = "lightclient_finalized_update"; | ||
EventType["lightclientFinalizedUpdate"] = "light_client_finalized_update"; | ||
})(EventType || (EventType = {})); | ||
@@ -65,3 +65,3 @@ export const routesData = { | ||
}, { jsonCase: "eth2" }), | ||
[EventType.lightclientHeaderUpdate]: new ContainerType({ | ||
[EventType.lightclientOptimisticUpdate]: new ContainerType({ | ||
syncAggregate: ssz.altair.SyncAggregate, | ||
@@ -68,0 +68,0 @@ attestedHeader: ssz.phase0.BeaconBlockHeader, |
@@ -5,4 +5,4 @@ import { JsonPath } from "@chainsafe/ssz"; | ||
import { ReturnTypes, RoutesData, ReqSerializers, ReqEmpty } from "../../utils/index.js"; | ||
import { LightclientHeaderUpdate, LightclientFinalizedUpdate } from "./events.js"; | ||
export { LightclientHeaderUpdate, LightclientFinalizedUpdate }; | ||
import { LightclientOptimisticHeaderUpdate, LightclientFinalizedUpdate } from "./events.js"; | ||
export { LightclientOptimisticHeaderUpdate, LightclientFinalizedUpdate }; | ||
export declare type LightclientSnapshotWithProof = { | ||
@@ -23,3 +23,3 @@ header: phase0.BeaconBlockHeader; | ||
/** | ||
* Returns an array of best updates in the requested periods within the inclusive range `from` - `to`. | ||
* Returns an array of best updates given a `startPeriod` and `count` number of sync committee period to return. | ||
* Best is defined by (in order of priority): | ||
@@ -30,21 +30,21 @@ * - Is finalized update | ||
*/ | ||
getCommitteeUpdates(from: SyncPeriod, to: SyncPeriod): Promise<{ | ||
getUpdates(startPeriod: SyncPeriod, count: number): Promise<{ | ||
data: altair.LightClientUpdate[]; | ||
}>; | ||
/** | ||
* Returns the latest best head update available. Clients should use the SSE type `lightclient_header_update` | ||
* Returns the latest optimistic head update available. Clients should use the SSE type `light_client_optimistic_update` | ||
* unless to get the very first head update after syncing, or if SSE are not supported by the server. | ||
*/ | ||
getLatestHeadUpdate(): Promise<{ | ||
data: LightclientHeaderUpdate; | ||
getOptimisticUpdate(): Promise<{ | ||
data: LightclientOptimisticHeaderUpdate; | ||
}>; | ||
getLatestFinalizedHeadUpdate(): Promise<{ | ||
getFinalityUpdate(): Promise<{ | ||
data: LightclientFinalizedUpdate; | ||
}>; | ||
/** | ||
* Fetch a snapshot with a proof to a trusted block root. | ||
* Fetch a bootstrapping state with a proof to a trusted block root. | ||
* The trusted block root should be fetched with similar means to a weak subjectivity checkpoint. | ||
* Only block roots for checkpoints are guaranteed to be available. | ||
*/ | ||
getSnapshot(blockRoot: string): Promise<{ | ||
getBootstrap(blockRoot: string): Promise<{ | ||
data: LightclientSnapshotWithProof; | ||
@@ -66,11 +66,11 @@ }>; | ||
}; | ||
getCommitteeUpdates: { | ||
getUpdates: { | ||
query: { | ||
from: number; | ||
to: number; | ||
start_period: number; | ||
count: number; | ||
}; | ||
}; | ||
getLatestHeadUpdate: ReqEmpty; | ||
getLatestFinalizedHeadUpdate: ReqEmpty; | ||
getSnapshot: { | ||
getOptimisticUpdate: ReqEmpty; | ||
getFinalityUpdate: ReqEmpty; | ||
getBootstrap: { | ||
params: { | ||
@@ -77,0 +77,0 @@ blockRoot: string; |
@@ -10,7 +10,7 @@ import { ContainerType, VectorCompositeType } from "@chainsafe/ssz"; | ||
export const routesData = { | ||
getStateProof: { url: "/eth/v1/lightclient/proof/:stateId", method: "GET" }, | ||
getCommitteeUpdates: { url: "/eth/v1/lightclient/committee_updates", method: "GET" }, | ||
getLatestHeadUpdate: { url: "/eth/v1/lightclient/latest_head_update/", method: "GET" }, | ||
getLatestFinalizedHeadUpdate: { url: "/eth/v1/lightclient/latest_finalized_head_update/", method: "GET" }, | ||
getSnapshot: { url: "/eth/v1/lightclient/snapshot/:blockRoot", method: "GET" }, | ||
getStateProof: { url: "/eth/v1/light_client/proof/:stateId", method: "GET" }, | ||
getUpdates: { url: "/eth/v1/light_client/updates", method: "GET" }, | ||
getOptimisticUpdate: { url: "/eth/v1/light_client/optimistic_update/", method: "GET" }, | ||
getFinalityUpdate: { url: "/eth/v1/light_client/finality_update/", method: "GET" }, | ||
getBootstrap: { url: "/eth/v1/light_client/bootstrap/:blockRoot", method: "GET" }, | ||
}; | ||
@@ -24,10 +24,10 @@ export function getReqSerializers() { | ||
}, | ||
getCommitteeUpdates: { | ||
writeReq: (from, to) => ({ query: { from, to } }), | ||
parseReq: ({ query }) => [query.from, query.to], | ||
schema: { query: { from: Schema.UintRequired, to: Schema.UintRequired } }, | ||
getUpdates: { | ||
writeReq: (start_period, count) => ({ query: { start_period, count } }), | ||
parseReq: ({ query }) => [query.start_period, query.count], | ||
schema: { query: { start_period: Schema.UintRequired, count: Schema.UintRequired } }, | ||
}, | ||
getLatestHeadUpdate: reqEmpty, | ||
getLatestFinalizedHeadUpdate: reqEmpty, | ||
getSnapshot: { | ||
getOptimisticUpdate: reqEmpty, | ||
getFinalityUpdate: reqEmpty, | ||
getBootstrap: { | ||
writeReq: (blockRoot) => ({ params: { blockRoot } }), | ||
@@ -58,8 +58,8 @@ parseReq: ({ params }) => [params.blockRoot], | ||
getStateProof: sameType(), | ||
getCommitteeUpdates: ContainerData(ArrayOf(ssz.altair.LightClientUpdate)), | ||
getLatestHeadUpdate: ContainerData(lightclientHeaderUpdate), | ||
getLatestFinalizedHeadUpdate: ContainerData(lightclientFinalizedUpdate), | ||
getSnapshot: ContainerData(lightclientSnapshotWithProofType), | ||
getUpdates: ContainerData(ArrayOf(ssz.altair.LightClientUpdate)), | ||
getOptimisticUpdate: ContainerData(lightclientHeaderUpdate), | ||
getFinalityUpdate: ContainerData(lightclientFinalizedUpdate), | ||
getBootstrap: ContainerData(lightclientSnapshotWithProofType), | ||
}; | ||
} | ||
//# sourceMappingURL=lightclient.js.map |
@@ -14,3 +14,3 @@ { | ||
}, | ||
"version": "0.39.0-dev.851d6985dc", | ||
"version": "0.39.0-dev.8dfc8258ed", | ||
"type": "module", | ||
@@ -73,6 +73,6 @@ "exports": { | ||
"dependencies": { | ||
"@chainsafe/lodestar-config": "0.39.0-dev.851d6985dc", | ||
"@chainsafe/lodestar-params": "0.39.0-dev.851d6985dc", | ||
"@chainsafe/lodestar-types": "0.39.0-dev.851d6985dc", | ||
"@chainsafe/lodestar-utils": "0.39.0-dev.851d6985dc", | ||
"@chainsafe/lodestar-config": "0.39.0-dev.8dfc8258ed", | ||
"@chainsafe/lodestar-params": "0.39.0-dev.8dfc8258ed", | ||
"@chainsafe/lodestar-types": "0.39.0-dev.8dfc8258ed", | ||
"@chainsafe/lodestar-utils": "0.39.0-dev.8dfc8258ed", | ||
"@chainsafe/persistent-merkle-tree": "^0.4.2", | ||
@@ -82,3 +82,2 @@ "@chainsafe/ssz": "^0.9.2", | ||
"eventsource": "^2.0.2", | ||
"fastify": "3.15.1", | ||
"qs": "^6.10.1" | ||
@@ -88,3 +87,4 @@ }, | ||
"@types/eventsource": "^1.1.5", | ||
"@types/qs": "^6.9.6" | ||
"@types/qs": "^6.9.6", | ||
"fastify": "3.15.1" | ||
}, | ||
@@ -101,3 +101,3 @@ "peerDependencies": { | ||
], | ||
"gitHead": "c932a89e7eaf0a3074208b422f9d7e04569b9267" | ||
"gitHead": "93799634583f1885e4f950af9530716754d948f4" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
261776
10
1
3
+ Added@chainsafe/lodestar-config@0.39.0-dev.8dfc8258ed(transitive)
+ Added@chainsafe/lodestar-params@0.39.0-dev.8dfc8258ed(transitive)
+ Added@chainsafe/lodestar-types@0.39.0-dev.8dfc8258ed(transitive)
+ Added@chainsafe/lodestar-utils@0.39.0-dev.8dfc8258ed(transitive)
- Removedfastify@3.15.1
- Removed@chainsafe/lodestar-config@0.39.0-dev.851d6985dc(transitive)
- Removed@chainsafe/lodestar-params@0.39.0-dev.851d6985dc(transitive)
- Removed@chainsafe/lodestar-types@0.39.0-dev.851d6985dc(transitive)
- Removed@chainsafe/lodestar-utils@0.39.0-dev.851d6985dc(transitive)