@lodestar/builder 1.48.0-dev.e9c9b8835d → 1.48.0-dev.fd70e5fc15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/lib/builder.d.ts +1 -11
  2. package/lib/builder.d.ts.map +1 -1
  3. package/lib/builder.js +2 -30
  4. package/lib/builder.js.map +1 -1
  5. package/lib/identity.d.ts +1 -0
  6. package/lib/identity.d.ts.map +1 -1
  7. package/lib/identity.js +4 -11
  8. package/lib/identity.js.map +1 -1
  9. package/package.json +10 -10
  10. package/src/builder.ts +3 -45
  11. package/src/identity.ts +6 -13
  12. package/lib/services/bidLedger.d.ts +0 -61
  13. package/lib/services/bidLedger.d.ts.map +0 -1
  14. package/lib/services/bidLedger.js +0 -154
  15. package/lib/services/bidLedger.js.map +0 -1
  16. package/lib/services/bidPolicy.d.ts +0 -30
  17. package/lib/services/bidPolicy.d.ts.map +0 -1
  18. package/lib/services/bidPolicy.js +0 -37
  19. package/lib/services/bidPolicy.js.map +0 -1
  20. package/lib/services/blockObserver.d.ts +0 -48
  21. package/lib/services/blockObserver.d.ts.map +0 -1
  22. package/lib/services/blockObserver.js +0 -172
  23. package/lib/services/blockObserver.js.map +0 -1
  24. package/lib/services/payloadStore.d.ts +0 -25
  25. package/lib/services/payloadStore.d.ts.map +0 -1
  26. package/lib/services/payloadStore.js +0 -25
  27. package/lib/services/payloadStore.js.map +0 -1
  28. package/lib/services/proposerPreferencesTracker.d.ts +0 -15
  29. package/lib/services/proposerPreferencesTracker.d.ts.map +0 -1
  30. package/lib/services/proposerPreferencesTracker.js +0 -68
  31. package/lib/services/proposerPreferencesTracker.js.map +0 -1
  32. package/src/services/bidLedger.ts +0 -245
  33. package/src/services/bidPolicy.ts +0 -65
  34. package/src/services/blockObserver.ts +0 -231
  35. package/src/services/payloadStore.ts +0 -51
  36. package/src/services/proposerPreferencesTracker.ts +0 -74
@@ -1,30 +0,0 @@
1
- export type BidContext = {
2
- /** Value of the payload to the builder's fee recipient, as reported by the execution client */
3
- payloadValueGwei: number;
4
- /** Builder balance that can back a bid, excess over the minimum and unsettled payments */
5
- coverableGwei: number;
6
- };
7
- /** Decides how much to pay the proposer for a payload, null means do not bid */
8
- export interface BidPolicy {
9
- computeValue(ctx: BidContext): number | null;
10
- }
11
- export type ProportionalBidPolicyOpts = {
12
- /** Share of the payload value offered to the proposer, in basis points */
13
- shareBps: number;
14
- /** Fixed amount deducted from the share, e.g. to cover operating cost */
15
- fixedCostGwei: number;
16
- /** Never bid below this value */
17
- minValueGwei: number;
18
- /** Never bid above this value */
19
- maxValueGwei?: number;
20
- };
21
- /**
22
- * Offers a fixed share of the payload value, bounded by the configured limits and the
23
- * builder's coverable balance. Independent of competing bids.
24
- */
25
- export declare class ProportionalBidPolicy implements BidPolicy {
26
- private readonly opts;
27
- constructor(opts: ProportionalBidPolicyOpts);
28
- computeValue({ payloadValueGwei, coverableGwei }: BidContext): number | null;
29
- }
30
- //# sourceMappingURL=bidPolicy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bidPolicy.d.ts","sourceRoot":"","sources":["../../src/services/bidPolicy.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,+FAA+F;IAC/F,gBAAgB,EAAE,MAAM,CAAC;IACzB,0FAA0F;IAC1F,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,gFAAgF;AAChF,MAAM,WAAW,SAAS;IACxB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC;CAC9C;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,aAAa,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,qBAAa,qBAAsB,YAAW,SAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAjC,YAA6B,IAAI,EAAE,yBAAyB,EAqB3D;IAED,YAAY,CAAC,EAAC,gBAAgB,EAAE,aAAa,EAAC,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAYzE;CACF"}
@@ -1,37 +0,0 @@
1
- /**
2
- * Offers a fixed share of the payload value, bounded by the configured limits and the
3
- * builder's coverable balance. Independent of competing bids.
4
- */
5
- export class ProportionalBidPolicy {
6
- opts;
7
- constructor(opts) {
8
- this.opts = opts;
9
- if (!Number.isSafeInteger(opts.shareBps) || opts.shareBps < 0 || opts.shareBps > 10_000) {
10
- throw Error(`Invalid shareBps=${opts.shareBps}, must be an integer within [0, 10000]`);
11
- }
12
- if (!Number.isSafeInteger(opts.fixedCostGwei) || opts.fixedCostGwei < 0) {
13
- throw Error(`Invalid fixedCostGwei=${opts.fixedCostGwei}, must be a non-negative safe integer`);
14
- }
15
- if (!Number.isSafeInteger(opts.minValueGwei) || opts.minValueGwei < 0) {
16
- throw Error(`Invalid minValueGwei=${opts.minValueGwei}, must be a non-negative safe integer`);
17
- }
18
- if (opts.maxValueGwei !== undefined &&
19
- (!Number.isSafeInteger(opts.maxValueGwei) || opts.maxValueGwei < opts.minValueGwei)) {
20
- throw Error(`Invalid maxValueGwei=${opts.maxValueGwei}, must be a safe integer greater than or equal to minValueGwei=${opts.minValueGwei}`);
21
- }
22
- }
23
- computeValue({ payloadValueGwei, coverableGwei }) {
24
- const proportionalValue = Number((BigInt(payloadValueGwei) * BigInt(this.opts.shareBps)) / 10000n);
25
- const share = proportionalValue - this.opts.fixedCostGwei;
26
- // This will override `fixedCostGwei` for the sake of fulfilling `minValueGwei`
27
- let value = Math.max(this.opts.minValueGwei, share);
28
- if (this.opts.maxValueGwei !== undefined) {
29
- value = Math.min(value, this.opts.maxValueGwei);
30
- }
31
- if (value > coverableGwei) {
32
- return null;
33
- }
34
- return value;
35
-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C,MAAM,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,MAAO,CAAC,CAAC;QACpG,MAAM,KAAK,GAAG,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;QAC1D,+EAA+E;QAC/E,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QACpD,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACzC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,KAAK,GAAG,aAAa,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
@@ -1,48 +0,0 @@
1
- import { ApiClient, routes } from "@lodestar/api";
2
- import { ChainForkConfig } from "@lodestar/config";
3
- import { ForkPostGloas } from "@lodestar/params";
4
- import { RootHex, SignedBeaconBlock, Slot } from "@lodestar/types";
5
- import { Logger } from "@lodestar/utils";
6
- declare const EventType: typeof routes.events.EventType;
7
- type BlockEvent = routes.events.EventData[typeof EventType.block];
8
- type BlockObserverOptions = {
9
- retries?: number;
10
- retryDelay?: number;
11
- maxSeenBlockRoots?: number;
12
- };
13
- export type ObservedBlock = {
14
- blockRoot: RootHex;
15
- slot: Slot;
16
- executionOptimistic: boolean;
17
- version: ForkPostGloas;
18
- block: SignedBeaconBlock<ForkPostGloas>;
19
- signedBid: SignedBeaconBlock<ForkPostGloas>["message"]["body"]["signedExecutionPayloadBid"];
20
- };
21
- type RunOnBlockFn = (block: ObservedBlock) => Promise<void>;
22
- /**
23
- * Observes imported beacon blocks through the source beacon node API.
24
- *
25
- * Each block root is evaluated at most once while retained in the bounded seen set. Terminal failures remain consumed
26
- * until normal FIFO eviction; reconnect, replay, and recovery policies are handled separately.
27
- */
28
- export declare class BlockObserver {
29
- private readonly config;
30
- private readonly logger;
31
- private readonly api;
32
- private readonly fns;
33
- private readonly seenBlockRoots;
34
- private readonly retries;
35
- private readonly retryDelay;
36
- private readonly maxSeenBlockRoots;
37
- constructor(config: ChainForkConfig, logger: Logger, api: ApiClient, { retries, retryDelay, maxSeenBlockRoots }?: BlockObserverOptions);
38
- /**
39
- * Register a block consumer. Consumers that require complete observation must register before {@link start}, because
40
- * roots observed before registration remain consumed until normal FIFO eviction.
41
- */
42
- runOnBlock(fn: RunOnBlockFn): void;
43
- start(signal: AbortSignal): void;
44
- processBlockEvent(event: BlockEvent, signal: AbortSignal): Promise<void>;
45
- }
46
- export declare function isRetryableBlockRetrievalError(error: Error): boolean;
47
- export {};
48
- //# sourceMappingURL=blockObserver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blockObserver.d.ts","sourceRoot":"","sources":["../../src/services/blockObserver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAY,MAAM,EAAC,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAC,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAqB,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAC,MAAM,EAA8E,MAAM,iBAAiB,CAAC;AAEpH,QAAA,MAAO,SAAS,gCAAiB,CAAC;AAElC,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;AAElE,KAAK,oBAAoB,GAAG;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,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 +0,0 @@
1
- import { ApiError, routes } from "@lodestar/api";
2
- import { isForkPostGloas } from "@lodestar/params";
3
- import { isGloasBeaconBlock } from "@lodestar/types";
4
- import { TimeoutError, isErrorAborted, isFetchError, pruneSetToMax, retry, toRootHex } from "@lodestar/utils";
5
- const { EventType } = routes.events;
6
- /**
7
- * Observes imported beacon blocks through the source beacon node API.
8
- *
9
- * Each block root is evaluated at most once while retained in the bounded seen set. Terminal failures remain consumed
10
- * until normal FIFO eviction; reconnect, replay, and recovery policies are handled separately.
11
- */
12
- export class BlockObserver {
13
- config;
14
- logger;
15
- api;
16
- fns = [];
17
- seenBlockRoots = new Set();
18
- retries;
19
- retryDelay;
20
- maxSeenBlockRoots;
21
- constructor(config, logger, api, { retries = 5, retryDelay = 200, maxSeenBlockRoots = 256 } = {}) {
22
- this.config = config;
23
- this.logger = logger;
24
- this.api = api;
25
- this.retries = retries;
26
- this.retryDelay = retryDelay;
27
- this.maxSeenBlockRoots = maxSeenBlockRoots;
28
- }
29
- /**
30
- * Register a block consumer. Consumers that require complete observation must register before {@link start}, because
31
- * roots observed before registration remain consumed until normal FIFO eviction.
32
- */
33
- runOnBlock(fn) {
34
- this.fns.push(fn);
35
- }
36
- start(signal) {
37
- this.logger.info("Subscribing to block events", {
38
- retries: this.retries,
39
- retryDelay: this.retryDelay,
40
- maxSeenBlockRoots: this.maxSeenBlockRoots,
41
- });
42
- this.api.events
43
- .eventstream({
44
- topics: [EventType.block],
45
- signal,
46
- onEvent: (event) => {
47
- if (event.type !== EventType.block) {
48
- this.logger.debug("Ignoring unexpected beacon event", { eventType: event.type });
49
- return;
50
- }
51
- void this.processBlockEvent(event.message, signal);
52
- },
53
- onError: (error) => {
54
- this.logger.error("Failed to receive block event", {}, error);
55
- },
56
- onClose: () => {
57
- if (signal.aborted) {
58
- this.logger.debug("Closed stream for block events");
59
- }
60
- else {
61
- this.logger.error("Block event stream closed unexpectedly", {});
62
- }
63
- },
64
- })
65
- .catch((error) => {
66
- this.logger.error("Failed to subscribe to block events", {}, error instanceof Error ? error : Error(String(error)));
67
- });
68
- }
69
- async processBlockEvent(event, signal) {
70
- try {
71
- const { slot, block: blockRoot, executionOptimistic } = event;
72
- if (this.seenBlockRoots.has(blockRoot)) {
73
- this.logger.debug("Ignoring duplicate block event", { slot, blockRoot });
74
- return;
75
- }
76
- this.seenBlockRoots.add(blockRoot);
77
- pruneSetToMax(this.seenBlockRoots, this.maxSeenBlockRoots);
78
- if (!isForkPostGloas(this.config.getForkName(slot))) {
79
- this.logger.debug("Ignoring pre-Gloas block event", { slot, blockRoot });
80
- return;
81
- }
82
- const response = await retry(async () => {
83
- // TODO GLOAS: Remove this lookup once bid-selection notifications provide the required data.
84
- const result = await this.api.beacon.getBlockV2({ blockId: blockRoot }, { signal });
85
- result.assertOk();
86
- return result;
87
- }, {
88
- retries: this.retries,
89
- retryDelay: this.retryDelay,
90
- signal,
91
- shouldRetry: isRetryableBlockRetrievalError,
92
- onRetry: (error, attempt) => {
93
- this.logger.debug("Retrying block retrieval", {
94
- slot,
95
- blockRoot,
96
- attempt,
97
- error: error.message,
98
- });
99
- },
100
- }).catch((error) => {
101
- if (!isErrorAborted(error)) {
102
- this.logger.error("Failed to retrieve block referenced by block event", { slot, blockRoot }, error instanceof Error ? error : Error(String(error)));
103
- }
104
- return null;
105
- });
106
- if (response === null) {
107
- return;
108
- }
109
- const { version } = response.meta();
110
- if (!isForkPostGloas(version)) {
111
- this.logger.warn("Ignoring block with unsupported fork version", { slot, blockRoot, fork: version });
112
- return;
113
- }
114
- const block = response.value();
115
- if (!isGloasBeaconBlock(block.message)) {
116
- this.logger.warn("Block response version and body do not agree", { slot, blockRoot, fork: version });
117
- return;
118
- }
119
- if (block.message.slot !== slot) {
120
- this.logger.warn("Block response slot does not match block event", {
121
- slot,
122
- blockRoot,
123
- blockSlot: block.message.slot,
124
- });
125
- return;
126
- }
127
- const postGloasBlock = block;
128
- const signedBid = postGloasBlock.message.body.signedExecutionPayloadBid;
129
- const observedBlock = {
130
- blockRoot,
131
- slot,
132
- executionOptimistic,
133
- version,
134
- block: postGloasBlock,
135
- signedBid,
136
- };
137
- this.logger.debug("Observed post-Gloas block", {
138
- slot,
139
- blockRoot,
140
- fork: version,
141
- builderIndex: signedBid.message.builderIndex,
142
- value: signedBid.message.value,
143
- blockHash: toRootHex(signedBid.message.blockHash),
144
- parentBlockHash: toRootHex(signedBid.message.parentBlockHash),
145
- });
146
- await Promise.all(this.fns.map(async (fn) => {
147
- try {
148
- await fn(observedBlock);
149
- }
150
- catch (error) {
151
- if (isErrorAborted(error)) {
152
- return;
153
- }
154
- this.logger.error("Failed to process observed block", { slot, blockRoot }, error instanceof Error ? error : Error(String(error)));
155
- }
156
- }));
157
- }
158
- catch (error) {
159
- if (isErrorAborted(error)) {
160
- return;
161
- }
162
- this.logger.error("Failed to process block event", { slot: event.slot, blockRoot: event.block }, error instanceof Error ? error : Error(String(error)));
163
- }
164
- }
165
- }
166
- export function isRetryableBlockRetrievalError(error) {
167
- if (error instanceof ApiError) {
168
- return error.status === 404 || error.status >= 500;
169
- }
170
- return error instanceof TimeoutError || (isFetchError(error) && error.type !== "input");
171
- }
172
- //# sourceMappingURL=blockObserver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blockObserver.js","sourceRoot":"","sources":["../../src/services/blockObserver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAgB,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAmC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAS,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAEpH,MAAM,EAAC,SAAS,EAAC,GAAG,MAAM,CAAC,MAAM,CAAC;AAqBlC;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IAQL,MAAM;IACN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AAC,MAAM,IAAI,GAAG,CAAC;IACrD,CAAC;IAED,OAAO,KAAK,YAAY,YAAY,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;AAC1F,CAAC"}
@@ -1,25 +0,0 @@
1
- import { ForkPostGloas } from "@lodestar/params";
2
- import { BlobsBundle, ExecutionPayload, Root, RootHex, Slot, gloas } from "@lodestar/types";
3
- export type BuiltPayload = {
4
- sourceId: string;
5
- executionPayload: ExecutionPayload<ForkPostGloas>;
6
- executionRequests: gloas.ExecutionRequests;
7
- blobsBundle: BlobsBundle<ForkPostGloas>;
8
- /** Value of the payload to the fee recipient in wei, as reported by the execution client */
9
- executionPayloadValue: bigint;
10
- };
11
- export type StoredPayload = {
12
- slot: Slot;
13
- parentBlockRoot: Root;
14
- blockHash: RootHex;
15
- payload: BuiltPayload;
16
- };
17
- export declare class PayloadStore {
18
- private readonly byBlockHash;
19
- add(payload: StoredPayload): void;
20
- get(blockHash: RootHex): StoredPayload | null;
21
- has(blockHash: RootHex): boolean;
22
- prune(currentSlot: Slot): void;
23
- get size(): number;
24
- }
25
- //# sourceMappingURL=payloadStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"payloadStore.d.ts","sourceRoot":"","sources":["../../src/services/payloadStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAC,WAAW,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAI1F,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAClD,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAC3C,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IACxC,4FAA4F;IAC5F,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,IAAI,CAAC;IACX,eAAe,EAAE,IAAI,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AAKF,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqC;IAEjE,GAAG,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAEhC;IAED,GAAG,CAAC,SAAS,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAE5C;IAED,GAAG,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAE/B;IAED,KAAK,CAAC,WAAW,EAAE,IAAI,GAAG,IAAI,CAM7B;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
@@ -1,25 +0,0 @@
1
- /** Keep payloads for this many slots after their target slot, late blocks may still commit to them */
2
- const KEEP_SLOTS = 2;
3
- export class PayloadStore {
4
- byBlockHash = new Map();
5
- add(payload) {
6
- this.byBlockHash.set(payload.blockHash, payload);
7
- }
8
- get(blockHash) {
9
- return this.byBlockHash.get(blockHash) ?? null;
10
- }
11
- has(blockHash) {
12
- return this.byBlockHash.has(blockHash);
13
- }
14
- prune(currentSlot) {
15
- for (const [blockHash, { slot }] of this.byBlockHash) {
16
- if (slot + KEEP_SLOTS < currentSlot) {
17
- this.byBlockHash.delete(blockHash);
18
- }
19
- }
20
- }
21
- get size() {
22
- return this.byBlockHash.size;
23
- }
24
- }
25
- //# sourceMappingURL=payloadStore.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"payloadStore.js","sourceRoot":"","sources":["../../src/services/payloadStore.ts"],"names":[],"mappings":"AAqBA,sGAAsG;AACtG,MAAM,UAAU,GAAG,CAAC,CAAC;AAErB,MAAM,OAAO,YAAY;IACN,WAAW,GAAG,IAAI,GAAG,EAA0B,CAAC;IAEjE,GAAG,CAAC,OAAsB;QACxB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAED,GAAG,CAAC,SAAkB;QACpB,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC;IACjD,CAAC;IAED,GAAG,CAAC,SAAkB;QACpB,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,WAAiB;QACrB,KAAK,MAAM,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACnD,IAAI,IAAI,GAAG,UAAU,GAAG,WAAW,EAAE,CAAC;gBACpC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACrC,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;CACF"}
@@ -1,15 +0,0 @@
1
- import { ApiClient } from "@lodestar/api";
2
- import type { RootHex, Slot, gloas } from "@lodestar/types";
3
- import { Logger } from "@lodestar/utils";
4
- /** Retains validated proposer preferences by the branch-specific identity used for bid validation. */
5
- export declare class ProposerPreferencesTracker {
6
- private readonly api;
7
- private readonly logger;
8
- private readonly byDependentRootBySlot;
9
- constructor(api: ApiClient, logger: Logger);
10
- start(signal: AbortSignal): void;
11
- onProposerPreferences(signedProposerPreferences: gloas.SignedProposerPreferences): boolean;
12
- get(slot: Slot, dependentRoot: RootHex): gloas.SignedProposerPreferences | null;
13
- prune(currentSlot: Slot): number;
14
- }
15
- //# sourceMappingURL=proposerPreferencesTracker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proposerPreferencesTracker.d.ts","sourceRoot":"","sources":["../../src/services/proposerPreferencesTracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAS,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAC,MAAM,EAAoB,MAAM,iBAAiB,CAAC;AAE1D,sGAAsG;AACtG,qBAAa,0BAA0B;IAMnC,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM;IANzB,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAEpC;IAEF,YACmB,GAAG,EAAE,SAAS,EACd,MAAM,EAAE,MAAM,EAC7B;IAEJ,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CA2B/B;IAED,qBAAqB,CAAC,yBAAyB,EAAE,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAWzF;IAED,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,GAAG,KAAK,CAAC,yBAAyB,GAAG,IAAI,CAE9E;IAED,KAAK,CAAC,WAAW,EAAE,IAAI,GAAG,MAAM,CAW/B;CACF"}
@@ -1,68 +0,0 @@
1
- import { routes } from "@lodestar/api";
2
- import { MapDef, toRootHex } from "@lodestar/utils";
3
- /** Retains validated proposer preferences by the branch-specific identity used for bid validation. */
4
- export class ProposerPreferencesTracker {
5
- api;
6
- logger;
7
- byDependentRootBySlot = new MapDef(() => new Map());
8
- constructor(api, logger) {
9
- this.api = api;
10
- this.logger = logger;
11
- }
12
- start(signal) {
13
- if (signal.aborted)
14
- return;
15
- this.logger.verbose("Subscribing to proposer preferences");
16
- this.api.events
17
- .eventstream({
18
- topics: [routes.events.EventType.proposerPreferences],
19
- signal,
20
- onEvent: (event) => {
21
- if (!signal.aborted && event.type === routes.events.EventType.proposerPreferences) {
22
- this.onProposerPreferences(event.message.data);
23
- }
24
- },
25
- onError: (error) => {
26
- if (!signal.aborted)
27
- this.logger.error("Failed to receive proposer preferences", {}, error);
28
- },
29
- onClose: () => {
30
- if (signal.aborted) {
31
- this.logger.verbose("Closed proposer preferences stream");
32
- }
33
- else {
34
- this.logger.error("Proposer preferences stream closed unexpectedly", {});
35
- }
36
- },
37
- })
38
- .catch((error) => {
39
- if (!signal.aborted)
40
- this.logger.error("Failed to subscribe to proposer preferences", {}, error);
41
- });
42
- }
43
- onProposerPreferences(signedProposerPreferences) {
44
- const { proposalSlot, dependentRoot } = signedProposerPreferences.message;
45
- const dependentRootHex = toRootHex(dependentRoot);
46
- const byDependentRoot = this.byDependentRootBySlot.getOrDefault(proposalSlot);
47
- if (byDependentRoot.has(dependentRootHex)) {
48
- return false;
49
- }
50
- byDependentRoot.set(dependentRootHex, signedProposerPreferences);
51
- return true;
52
- }
53
- get(slot, dependentRoot) {
54
- return this.byDependentRootBySlot.get(slot)?.get(dependentRoot) ?? null;
55
- }
56
- prune(currentSlot) {
57
- let removed = 0;
58
- for (const [slot, byDependentRoot] of this.byDependentRootBySlot) {
59
- if (slot >= currentSlot) {
60
- continue;
61
- }
62
- removed += byDependentRoot.size;
63
- this.byDependentRootBySlot.delete(slot);
64
- }
65
- return removed;
66
- }
67
- }
68
- //# sourceMappingURL=proposerPreferencesTracker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proposerPreferencesTracker.js","sourceRoot":"","sources":["../../src/services/proposerPreferencesTracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAC,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAS,MAAM,EAAE,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAE1D,sGAAsG;AACtG,MAAM,OAAO,0BAA0B;IAMlB,GAAG;IACH,MAAM;IANR,qBAAqB,GAAG,IAAI,MAAM,CACjD,GAAG,EAAE,CAAC,IAAI,GAAG,EAAE,CAChB,CAAC;IAEF,YACmB,GAAc,EACd,MAAc;mBADd,GAAG;sBACH,MAAM;IACtB,CAAC;IAEJ,KAAK,CAAC,MAAmB;QACvB,IAAI,MAAM,CAAC,OAAO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