@lodestar/builder 1.50.0-dev.1f38fe79fb → 1.50.0-dev.2e668c516f
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.
- package/lib/services/bidLedger.d.ts +0 -7
- package/lib/services/bidLedger.d.ts.map +1 -1
- package/lib/services/bidLedger.js +10 -15
- package/lib/services/bidLedger.js.map +1 -1
- package/lib/services/builderSigner.d.ts +1 -2
- package/lib/services/builderSigner.d.ts.map +1 -1
- package/lib/services/builderSigner.js.map +1 -1
- package/package.json +10 -10
- package/src/services/bidLedger.ts +14 -28
- package/src/services/builderSigner.ts +1 -3
- package/lib/services/bidPublisher.d.ts +0 -43
- package/lib/services/bidPublisher.d.ts.map +0 -1
- package/lib/services/bidPublisher.js +0 -50
- package/lib/services/bidPublisher.js.map +0 -1
- package/lib/services/executionPayloadBid.d.ts +0 -57
- package/lib/services/executionPayloadBid.d.ts.map +0 -1
- package/lib/services/executionPayloadBid.js +0 -69
- package/lib/services/executionPayloadBid.js.map +0 -1
- package/src/services/bidPublisher.ts +0 -95
- package/src/services/executionPayloadBid.ts +0 -125
|
@@ -15,7 +15,6 @@ export type BidLedgerRecord = SubmittedBid & {
|
|
|
15
15
|
export declare enum BidLedgerErrorCode {
|
|
16
16
|
INVALID_BID_VALUE = "BID_LEDGER_ERROR_INVALID_BID_VALUE",
|
|
17
17
|
DUPLICATE_BID = "BID_LEDGER_ERROR_DUPLICATE_BID",
|
|
18
|
-
BID_TOO_OLD = "BID_LEDGER_ERROR_BID_TOO_OLD",
|
|
19
18
|
REVEAL_CONFLICT = "BID_LEDGER_ERROR_REVEAL_CONFLICT",
|
|
20
19
|
UNSETTLED_VALUE_OVERFLOW = "BID_LEDGER_ERROR_UNSETTLED_VALUE_OVERFLOW"
|
|
21
20
|
}
|
|
@@ -27,10 +26,6 @@ export type BidLedgerErrorType = {
|
|
|
27
26
|
slot: Slot;
|
|
28
27
|
parentBlockHash: RootHex;
|
|
29
28
|
parentBlockRoot: RootHex;
|
|
30
|
-
} | {
|
|
31
|
-
code: BidLedgerErrorCode.BID_TOO_OLD;
|
|
32
|
-
slot: Slot;
|
|
33
|
-
pruneCutoffSlot: Slot;
|
|
34
29
|
} | {
|
|
35
30
|
code: BidLedgerErrorCode.REVEAL_CONFLICT;
|
|
36
31
|
blockRoot: RootHex;
|
|
@@ -48,9 +43,7 @@ export declare class BidLedgerError extends LodestarError<BidLedgerErrorType> {
|
|
|
48
43
|
export declare class BidLedger {
|
|
49
44
|
private readonly bidsBySlot;
|
|
50
45
|
private readonly revealedPayloadByBlockRoot;
|
|
51
|
-
private pruneCutoffSlot;
|
|
52
46
|
hasSubmitted(slot: Slot, parentBlockHash: RootHex, parentBlockRoot: RootHex): boolean;
|
|
53
|
-
assertCanRecordBid({ slot, parentBlockHash, parentBlockRoot, }: Pick<SubmittedBid, "slot" | "parentBlockHash" | "parentBlockRoot">): void;
|
|
54
47
|
recordBid(bid: SubmittedBid): BidLedgerRecord;
|
|
55
48
|
recordWin(identity: BidIdentity & Pick<SubmittedBid, "signedBidRoot">, blockRoot: RootHex): BidLedgerRecord | null;
|
|
56
49
|
/** Release a winning bid liability only after its payment is known to be reflected in Builder balance. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bidLedger.d.ts","sourceRoot":"","sources":["../../src/services/bidLedger.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAC,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,IAAI,CAAC;IACX,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,WA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AAO,GAAG,IAAI,CAoB5F;IAED,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,GAAG,IAAI,CAMrG;IAED,qBAAqB,CAAC,YAAY,EAAE,KAAK,GAAG,MAAM,CAkBjD;IAED,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,eAAe,EAAE,CAE5C;IAED,KAAK,CAAC,WAAW,EAAE,IAAI,GAAG,MAAM,CAwB/B;IAED,OAAO,CAAC,MAAM;CAGf"}
|
|
@@ -4,7 +4,6 @@ export var BidLedgerErrorCode;
|
|
|
4
4
|
(function (BidLedgerErrorCode) {
|
|
5
5
|
BidLedgerErrorCode["INVALID_BID_VALUE"] = "BID_LEDGER_ERROR_INVALID_BID_VALUE";
|
|
6
6
|
BidLedgerErrorCode["DUPLICATE_BID"] = "BID_LEDGER_ERROR_DUPLICATE_BID";
|
|
7
|
-
BidLedgerErrorCode["BID_TOO_OLD"] = "BID_LEDGER_ERROR_BID_TOO_OLD";
|
|
8
7
|
BidLedgerErrorCode["REVEAL_CONFLICT"] = "BID_LEDGER_ERROR_REVEAL_CONFLICT";
|
|
9
8
|
BidLedgerErrorCode["UNSETTLED_VALUE_OVERFLOW"] = "BID_LEDGER_ERROR_UNSETTLED_VALUE_OVERFLOW";
|
|
10
9
|
})(BidLedgerErrorCode || (BidLedgerErrorCode = {}));
|
|
@@ -16,29 +15,27 @@ const KEEP_SLOTS = RECORD_RETENTION_EPOCHS * SLOTS_PER_EPOCH;
|
|
|
16
15
|
export class BidLedger {
|
|
17
16
|
bidsBySlot = new Map();
|
|
18
17
|
revealedPayloadByBlockRoot = new Map();
|
|
19
|
-
pruneCutoffSlot = 0;
|
|
20
18
|
hasSubmitted(slot, parentBlockHash, parentBlockRoot) {
|
|
21
19
|
return this.bidsBySlot.get(slot)?.has(tupleKey(parentBlockHash, parentBlockRoot)) ?? false;
|
|
22
20
|
}
|
|
23
|
-
assertCanRecordBid({ slot, parentBlockHash, parentBlockRoot, }) {
|
|
24
|
-
if (slot < this.pruneCutoffSlot) {
|
|
25
|
-
throw new BidLedgerError({ code: BidLedgerErrorCode.BID_TOO_OLD, slot, pruneCutoffSlot: this.pruneCutoffSlot });
|
|
26
|
-
}
|
|
27
|
-
if (this.hasSubmitted(slot, parentBlockHash, parentBlockRoot)) {
|
|
28
|
-
throw new BidLedgerError({ code: BidLedgerErrorCode.DUPLICATE_BID, slot, parentBlockHash, parentBlockRoot }, `Bid already recorded slot=${slot} parentBlockHash=${parentBlockHash} parentBlockRoot=${parentBlockRoot}`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
21
|
recordBid(bid) {
|
|
32
22
|
if (!Number.isSafeInteger(bid.valueGwei) || bid.valueGwei < 0) {
|
|
33
23
|
throw new BidLedgerError({ code: BidLedgerErrorCode.INVALID_BID_VALUE, valueGwei: bid.valueGwei }, `Invalid bid value valueGwei=${bid.valueGwei}`);
|
|
34
24
|
}
|
|
35
|
-
this.assertCanRecordBid(bid);
|
|
36
25
|
let bidsForSlot = this.bidsBySlot.get(bid.slot);
|
|
37
26
|
if (bidsForSlot === undefined) {
|
|
38
27
|
bidsForSlot = new Map();
|
|
39
28
|
this.bidsBySlot.set(bid.slot, bidsForSlot);
|
|
40
29
|
}
|
|
41
30
|
const key = tupleKey(bid.parentBlockHash, bid.parentBlockRoot);
|
|
31
|
+
if (bidsForSlot.has(key)) {
|
|
32
|
+
throw new BidLedgerError({
|
|
33
|
+
code: BidLedgerErrorCode.DUPLICATE_BID,
|
|
34
|
+
slot: bid.slot,
|
|
35
|
+
parentBlockHash: bid.parentBlockHash,
|
|
36
|
+
parentBlockRoot: bid.parentBlockRoot,
|
|
37
|
+
}, `Bid already recorded slot=${bid.slot} parentBlockHash=${bid.parentBlockHash} parentBlockRoot=${bid.parentBlockRoot}`);
|
|
38
|
+
}
|
|
42
39
|
const record = { ...bid, wonBlockRoots: new Set(), paymentSettled: false };
|
|
43
40
|
bidsForSlot.set(key, record);
|
|
44
41
|
return toRecord(record);
|
|
@@ -114,11 +111,9 @@ export class BidLedger {
|
|
|
114
111
|
return Array.from(this.bidsBySlot.get(slot)?.values() ?? [], toRecord);
|
|
115
112
|
}
|
|
116
113
|
prune(currentSlot) {
|
|
117
|
-
// Pruning must not make an expired slot eligible for another submission.
|
|
118
|
-
this.pruneCutoffSlot = Math.max(this.pruneCutoffSlot, currentSlot - KEEP_SLOTS);
|
|
119
114
|
let removed = 0;
|
|
120
115
|
for (const [slot, bidsForSlot] of this.bidsBySlot) {
|
|
121
|
-
if (slot >=
|
|
116
|
+
if (slot >= currentSlot - KEEP_SLOTS) {
|
|
122
117
|
continue;
|
|
123
118
|
}
|
|
124
119
|
for (const [key, record] of bidsForSlot) {
|
|
@@ -132,7 +127,7 @@ export class BidLedger {
|
|
|
132
127
|
}
|
|
133
128
|
}
|
|
134
129
|
for (const [blockRoot, revealedPayload] of this.revealedPayloadByBlockRoot) {
|
|
135
|
-
if (revealedPayload.slot <
|
|
130
|
+
if (revealedPayload.slot < currentSlot - KEEP_SLOTS) {
|
|
136
131
|
this.revealedPayloadByBlockRoot.delete(blockRoot);
|
|
137
132
|
}
|
|
138
133
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bidLedger.js","sourceRoot":"","sources":["../../src/services/bidLedger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AA6B9C,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"bidLedger.js","sourceRoot":"","sources":["../../src/services/bidLedger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AA6B9C,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;I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EAAE,GAAG,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC,IAAI,IAAI,CAAC;IAC5F,CAAC;CACF;AAED,SAAS,QAAQ,CAAC,eAAwB,EAAE,eAAwB;IAClE,OAAO,GAAG,eAAe,IAAI,eAAe,EAAE,CAAC;AACjD,CAAC;AAED,SAAS,QAAQ,CAAC,MAA8B;IAC9C,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;KAChD,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublicKey, SecretKey } from "@chainsafe/lodestar-z/blst";
|
|
2
2
|
import { BeaconConfig } from "@lodestar/config";
|
|
3
|
-
import { gloas
|
|
3
|
+
import { gloas } from "@lodestar/types";
|
|
4
4
|
export type Keypair = {
|
|
5
5
|
publicKey: PublicKey;
|
|
6
6
|
secretKey: SecretKey;
|
|
@@ -10,7 +10,6 @@ export declare class BuilderSigner {
|
|
|
10
10
|
private readonly keypair;
|
|
11
11
|
constructor(config: BeaconConfig, keypair: Keypair);
|
|
12
12
|
signExecutionPayloadEnvelope(envelope: gloas.ExecutionPayloadEnvelope): gloas.SignedExecutionPayloadEnvelope;
|
|
13
|
-
signExecutionPayloadBid(bid: heze.ExecutionPayloadBid): heze.SignedExecutionPayloadBid;
|
|
14
13
|
signExecutionPayloadBid(bid: gloas.ExecutionPayloadBid): gloas.SignedExecutionPayloadBid;
|
|
15
14
|
getPubkeyHex(): string;
|
|
16
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builderSigner.d.ts","sourceRoot":"","sources":["../../src/services/builderSigner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"builderSigner.d.ts","sourceRoot":"","sources":["../../src/services/builderSigner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAEtC,MAAM,MAAM,OAAO,GAAG;IAAC,SAAS,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAC,CAAC;AAEnE,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAElC,YAAY,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAGjD;IAED,4BAA4B,CAAC,QAAQ,EAAE,KAAK,CAAC,wBAAwB,GAAG,KAAK,CAAC,8BAA8B,CAO3G;IAED,uBAAuB,CAAC,GAAG,EAAE,KAAK,CAAC,mBAAmB,GAAG,KAAK,CAAC,yBAAyB,CAOvF;IAED,YAAY,IAAI,MAAM,CAErB;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builderSigner.js","sourceRoot":"","sources":["../../src/services/builderSigner.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,iCAAiC,EAAE,sCAAsC,EAAC,MAAM,4BAA4B,CAAC;AAKrH,MAAM,OAAO,aAAa;IACP,MAAM,CAAe;IACrB,OAAO,CAAU;IAElC,YAAY,MAAoB,EAAE,OAAgB;QAChD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,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S,CAAC,KAAK,EAAE,CAAC;IACxC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lodestar/builder",
|
|
3
|
-
"version": "1.50.0-dev.
|
|
3
|
+
"version": "1.50.0-dev.2e668c516f",
|
|
4
4
|
"description": "A Typescript implementation of the builder client",
|
|
5
5
|
"author": "ChainSafe Systems",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,16 +48,16 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@chainsafe/lodestar-z": "catalog:",
|
|
50
50
|
"@chainsafe/ssz": "^1.8.0",
|
|
51
|
-
"@lodestar/api": "^1.50.0-dev.
|
|
52
|
-
"@lodestar/config": "^1.50.0-dev.
|
|
53
|
-
"@lodestar/params": "^1.50.0-dev.
|
|
54
|
-
"@lodestar/state-transition": "^1.50.0-dev.
|
|
55
|
-
"@lodestar/types": "^1.50.0-dev.
|
|
56
|
-
"@lodestar/utils": "^1.50.0-dev.
|
|
51
|
+
"@lodestar/api": "^1.50.0-dev.2e668c516f",
|
|
52
|
+
"@lodestar/config": "^1.50.0-dev.2e668c516f",
|
|
53
|
+
"@lodestar/params": "^1.50.0-dev.2e668c516f",
|
|
54
|
+
"@lodestar/state-transition": "^1.50.0-dev.2e668c516f",
|
|
55
|
+
"@lodestar/types": "^1.50.0-dev.2e668c516f",
|
|
56
|
+
"@lodestar/utils": "^1.50.0-dev.2e668c516f"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@lodestar/logger": "^1.50.0-dev.
|
|
60
|
-
"@lodestar/test-utils": "^1.50.0-dev.
|
|
59
|
+
"@lodestar/logger": "^1.50.0-dev.2e668c516f",
|
|
60
|
+
"@lodestar/test-utils": "^1.50.0-dev.2e668c516f"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "64f9950e4dda48c3c64de86ad80b01ad8274f696"
|
|
63
63
|
}
|
|
@@ -32,7 +32,6 @@ type MutableBidLedgerRecord = SubmittedBid & {
|
|
|
32
32
|
export enum BidLedgerErrorCode {
|
|
33
33
|
INVALID_BID_VALUE = "BID_LEDGER_ERROR_INVALID_BID_VALUE",
|
|
34
34
|
DUPLICATE_BID = "BID_LEDGER_ERROR_DUPLICATE_BID",
|
|
35
|
-
BID_TOO_OLD = "BID_LEDGER_ERROR_BID_TOO_OLD",
|
|
36
35
|
REVEAL_CONFLICT = "BID_LEDGER_ERROR_REVEAL_CONFLICT",
|
|
37
36
|
UNSETTLED_VALUE_OVERFLOW = "BID_LEDGER_ERROR_UNSETTLED_VALUE_OVERFLOW",
|
|
38
37
|
}
|
|
@@ -48,11 +47,6 @@ export type BidLedgerErrorType =
|
|
|
48
47
|
parentBlockHash: RootHex;
|
|
49
48
|
parentBlockRoot: RootHex;
|
|
50
49
|
}
|
|
51
|
-
| {
|
|
52
|
-
code: BidLedgerErrorCode.BID_TOO_OLD;
|
|
53
|
-
slot: Slot;
|
|
54
|
-
pruneCutoffSlot: Slot;
|
|
55
|
-
}
|
|
56
50
|
| {
|
|
57
51
|
code: BidLedgerErrorCode.REVEAL_CONFLICT;
|
|
58
52
|
blockRoot: RootHex;
|
|
@@ -75,28 +69,11 @@ const KEEP_SLOTS = RECORD_RETENTION_EPOCHS * SLOTS_PER_EPOCH;
|
|
|
75
69
|
export class BidLedger {
|
|
76
70
|
private readonly bidsBySlot = new Map<Slot, Map<string, MutableBidLedgerRecord>>();
|
|
77
71
|
private readonly revealedPayloadByBlockRoot = new Map<RootHex, RevealedPayload>();
|
|
78
|
-
private pruneCutoffSlot = 0;
|
|
79
72
|
|
|
80
73
|
hasSubmitted(slot: Slot, parentBlockHash: RootHex, parentBlockRoot: RootHex): boolean {
|
|
81
74
|
return this.bidsBySlot.get(slot)?.has(tupleKey(parentBlockHash, parentBlockRoot)) ?? false;
|
|
82
75
|
}
|
|
83
76
|
|
|
84
|
-
assertCanRecordBid({
|
|
85
|
-
slot,
|
|
86
|
-
parentBlockHash,
|
|
87
|
-
parentBlockRoot,
|
|
88
|
-
}: Pick<SubmittedBid, "slot" | "parentBlockHash" | "parentBlockRoot">): void {
|
|
89
|
-
if (slot < this.pruneCutoffSlot) {
|
|
90
|
-
throw new BidLedgerError({code: BidLedgerErrorCode.BID_TOO_OLD, slot, pruneCutoffSlot: this.pruneCutoffSlot});
|
|
91
|
-
}
|
|
92
|
-
if (this.hasSubmitted(slot, parentBlockHash, parentBlockRoot)) {
|
|
93
|
-
throw new BidLedgerError(
|
|
94
|
-
{code: BidLedgerErrorCode.DUPLICATE_BID, slot, parentBlockHash, parentBlockRoot},
|
|
95
|
-
`Bid already recorded slot=${slot} parentBlockHash=${parentBlockHash} parentBlockRoot=${parentBlockRoot}`
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
77
|
recordBid(bid: SubmittedBid): BidLedgerRecord {
|
|
101
78
|
if (!Number.isSafeInteger(bid.valueGwei) || bid.valueGwei < 0) {
|
|
102
79
|
throw new BidLedgerError(
|
|
@@ -105,7 +82,6 @@ export class BidLedger {
|
|
|
105
82
|
);
|
|
106
83
|
}
|
|
107
84
|
|
|
108
|
-
this.assertCanRecordBid(bid);
|
|
109
85
|
let bidsForSlot = this.bidsBySlot.get(bid.slot);
|
|
110
86
|
if (bidsForSlot === undefined) {
|
|
111
87
|
bidsForSlot = new Map();
|
|
@@ -113,6 +89,18 @@ export class BidLedger {
|
|
|
113
89
|
}
|
|
114
90
|
|
|
115
91
|
const key = tupleKey(bid.parentBlockHash, bid.parentBlockRoot);
|
|
92
|
+
if (bidsForSlot.has(key)) {
|
|
93
|
+
throw new BidLedgerError(
|
|
94
|
+
{
|
|
95
|
+
code: BidLedgerErrorCode.DUPLICATE_BID,
|
|
96
|
+
slot: bid.slot,
|
|
97
|
+
parentBlockHash: bid.parentBlockHash,
|
|
98
|
+
parentBlockRoot: bid.parentBlockRoot,
|
|
99
|
+
},
|
|
100
|
+
`Bid already recorded slot=${bid.slot} parentBlockHash=${bid.parentBlockHash} parentBlockRoot=${bid.parentBlockRoot}`
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
116
104
|
const record = {...bid, wonBlockRoots: new Set<RootHex>(), paymentSettled: false};
|
|
117
105
|
bidsForSlot.set(key, record);
|
|
118
106
|
return toRecord(record);
|
|
@@ -210,11 +198,9 @@ export class BidLedger {
|
|
|
210
198
|
}
|
|
211
199
|
|
|
212
200
|
prune(currentSlot: Slot): number {
|
|
213
|
-
// Pruning must not make an expired slot eligible for another submission.
|
|
214
|
-
this.pruneCutoffSlot = Math.max(this.pruneCutoffSlot, currentSlot - KEEP_SLOTS);
|
|
215
201
|
let removed = 0;
|
|
216
202
|
for (const [slot, bidsForSlot] of this.bidsBySlot) {
|
|
217
|
-
if (slot >=
|
|
203
|
+
if (slot >= currentSlot - KEEP_SLOTS) {
|
|
218
204
|
continue;
|
|
219
205
|
}
|
|
220
206
|
|
|
@@ -230,7 +216,7 @@ export class BidLedger {
|
|
|
230
216
|
}
|
|
231
217
|
|
|
232
218
|
for (const [blockRoot, revealedPayload] of this.revealedPayloadByBlockRoot) {
|
|
233
|
-
if (revealedPayload.slot <
|
|
219
|
+
if (revealedPayload.slot < currentSlot - KEEP_SLOTS) {
|
|
234
220
|
this.revealedPayloadByBlockRoot.delete(blockRoot);
|
|
235
221
|
}
|
|
236
222
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {PublicKey, SecretKey} from "@chainsafe/lodestar-z/blst";
|
|
2
2
|
import {BeaconConfig} from "@lodestar/config";
|
|
3
3
|
import {getExecutionPayloadBidSigningRoot, getExecutionPayloadEnvelopeSigningRoot} from "@lodestar/state-transition";
|
|
4
|
-
import {gloas
|
|
4
|
+
import {gloas} from "@lodestar/types";
|
|
5
5
|
|
|
6
6
|
export type Keypair = {publicKey: PublicKey; secretKey: SecretKey};
|
|
7
7
|
|
|
@@ -23,8 +23,6 @@ export class BuilderSigner {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
signExecutionPayloadBid(bid: heze.ExecutionPayloadBid): heze.SignedExecutionPayloadBid;
|
|
27
|
-
signExecutionPayloadBid(bid: gloas.ExecutionPayloadBid): gloas.SignedExecutionPayloadBid;
|
|
28
26
|
signExecutionPayloadBid(bid: gloas.ExecutionPayloadBid): gloas.SignedExecutionPayloadBid {
|
|
29
27
|
const signingRoot = getExecutionPayloadBidSigningRoot(this.config, bid);
|
|
30
28
|
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { ApiClient } from "@lodestar/api";
|
|
2
|
-
import type { ChainForkConfig } from "@lodestar/config";
|
|
3
|
-
import type { BuilderIndex, RootHex, Slot, gloas, heze } from "@lodestar/types";
|
|
4
|
-
import { LodestarError } from "@lodestar/utils";
|
|
5
|
-
import type { BidIdentity, BidLedger } from "./bidLedger.js";
|
|
6
|
-
import type { BuilderSigner } from "./builderSigner.js";
|
|
7
|
-
export type BidPublisherModules = {
|
|
8
|
-
api: ApiClient;
|
|
9
|
-
config: ChainForkConfig;
|
|
10
|
-
signer: BuilderSigner;
|
|
11
|
-
ledger: BidLedger;
|
|
12
|
-
builderIndex: BuilderIndex;
|
|
13
|
-
hasPayload: (identity: BidIdentity) => boolean;
|
|
14
|
-
};
|
|
15
|
-
export declare enum BidPublisherErrorCode {
|
|
16
|
-
BUILDER_INDEX_MISMATCH = "BID_PUBLISHER_ERROR_BUILDER_INDEX_MISMATCH",
|
|
17
|
-
PAYLOAD_NOT_RETAINED = "BID_PUBLISHER_ERROR_PAYLOAD_NOT_RETAINED",
|
|
18
|
-
PRE_GLOAS_BID = "BID_PUBLISHER_ERROR_PRE_GLOAS_BID"
|
|
19
|
-
}
|
|
20
|
-
export type BidPublisherErrorType = {
|
|
21
|
-
code: BidPublisherErrorCode.PRE_GLOAS_BID;
|
|
22
|
-
slot: Slot;
|
|
23
|
-
} | {
|
|
24
|
-
code: BidPublisherErrorCode.BUILDER_INDEX_MISMATCH;
|
|
25
|
-
builderIndex: BuilderIndex;
|
|
26
|
-
bidBuilderIndex: BuilderIndex;
|
|
27
|
-
} | {
|
|
28
|
-
code: BidPublisherErrorCode.PAYLOAD_NOT_RETAINED;
|
|
29
|
-
slot: Slot;
|
|
30
|
-
parentBlockHash: RootHex;
|
|
31
|
-
parentBlockRoot: RootHex;
|
|
32
|
-
blockHash: RootHex;
|
|
33
|
-
};
|
|
34
|
-
export declare class BidPublisherError extends LodestarError<BidPublisherErrorType> {
|
|
35
|
-
}
|
|
36
|
-
/** Signs and submits a bid only if its payload is retained locally. */
|
|
37
|
-
export declare class BidPublisher {
|
|
38
|
-
private readonly modules;
|
|
39
|
-
constructor(modules: BidPublisherModules);
|
|
40
|
-
publish(bid: heze.ExecutionPayloadBid, signal: AbortSignal): Promise<heze.SignedExecutionPayloadBid>;
|
|
41
|
-
publish(bid: gloas.ExecutionPayloadBid, signal: AbortSignal): Promise<gloas.SignedExecutionPayloadBid>;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=bidPublisher.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bidPublisher.d.ts","sourceRoot":"","sources":["../../src/services/bidPublisher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAC,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,MAAM,iBAAiB,CAAC;AAE9E,OAAO,EAAC,aAAa,EAAY,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAC,WAAW,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEtD,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,EAA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szTypesFor } from "@lodestar/types";
|
|
3
|
-
import { LodestarError, toRootHex } from "@lodestar/utils";
|
|
4
|
-
export var BidPublisherErrorCode;
|
|
5
|
-
(function (BidPublisherErrorCode) {
|
|
6
|
-
BidPublisherErrorCode["BUILDER_INDEX_MISMATCH"] = "BID_PUBLISHER_ERROR_BUILDER_INDEX_MISMATCH";
|
|
7
|
-
BidPublisherErrorCode["PAYLOAD_NOT_RETAINED"] = "BID_PUBLISHER_ERROR_PAYLOAD_NOT_RETAINED";
|
|
8
|
-
BidPublisherErrorCode["PRE_GLOAS_BID"] = "BID_PUBLISHER_ERROR_PRE_GLOAS_BID";
|
|
9
|
-
})(BidPublisherErrorCode || (BidPublisherErrorCode = {}));
|
|
10
|
-
export class BidPublisherError extends LodestarError {
|
|
11
|
-
}
|
|
12
|
-
/** Signs and submits a bid only if its payload is retained locally. */
|
|
13
|
-
export class BidPublisher {
|
|
14
|
-
modules;
|
|
15
|
-
constructor(modules) {
|
|
16
|
-
this.modules = modules;
|
|
17
|
-
}
|
|
18
|
-
async publish(bid, signal) {
|
|
19
|
-
signal.throwIfAborted();
|
|
20
|
-
const { api, config, builderIndex, hasPayload, ledger, signer } = this.modules;
|
|
21
|
-
const fork = config.getForkName(bid.slot);
|
|
22
|
-
if (!isForkPostGloas(fork)) {
|
|
23
|
-
throw new BidPublisherError({ code: BidPublisherErrorCode.PRE_GLOAS_BID, slot: bid.slot });
|
|
24
|
-
}
|
|
25
|
-
if (bid.builderIndex !== builderIndex) {
|
|
26
|
-
throw new BidPublisherError({
|
|
27
|
-
code: BidPublisherErrorCode.BUILDER_INDEX_MISMATCH,
|
|
28
|
-
builderIndex,
|
|
29
|
-
bidBuilderIndex: bid.builderIndex,
|
|
30
|
-
}, `Bid builder index does not match local builder index builderIndex=${builderIndex} bidBuilderIndex=${bid.builderIndex}`);
|
|
31
|
-
}
|
|
32
|
-
const identity = {
|
|
33
|
-
slot: bid.slot,
|
|
34
|
-
parentBlockHash: toRootHex(bid.parentBlockHash),
|
|
35
|
-
parentBlockRoot: toRootHex(bid.parentBlockRoot),
|
|
36
|
-
blockHash: toRootHex(bid.blockHash),
|
|
37
|
-
};
|
|
38
|
-
if (!hasPayload(identity)) {
|
|
39
|
-
throw new BidPublisherError({ code: BidPublisherErrorCode.PAYLOAD_NOT_RETAINED, ...identity }, `Bid payload is not retained slot=${identity.slot} parentBlockHash=${identity.parentBlockHash} parentBlockRoot=${identity.parentBlockRoot} blockHash=${identity.blockHash}`);
|
|
40
|
-
}
|
|
41
|
-
ledger.assertCanRecordBid(identity);
|
|
42
|
-
const signedExecutionPayloadBid = signer.signExecutionPayloadBid(bid);
|
|
43
|
-
const signedBidRoot = toRootHex(sszTypesFor(fork, "SignedExecutionPayloadBid").hashTreeRoot(signedExecutionPayloadBid));
|
|
44
|
-
ledger.recordBid({ ...identity, valueGwei: bid.value, signedBidRoot });
|
|
45
|
-
const response = await api.beacon.publishExecutionPayloadBid({ signedExecutionPayloadBid }, { signal });
|
|
46
|
-
response.assertOk();
|
|
47
|
-
return signedExecutionPayloadBid;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=bidPublisher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bidPublisher.js","sourceRoot":"","sources":["../../src/services/bidPublisher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAE,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAazD,MAAM,CAAN,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,8FAAqE,CAAA;IACrE,0FAAiE,CAAA;IACjE,4EAAmD,CAAA;AACrD,CAAC,EAJW,qBAAqB,KAArB,qBAAqB,QAIhC;AAoBD,MAAM,OAAO,iBAAkB,SAAQ,aAAoC;CAAG;AAE9E,uEAAuE;AACvE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Q,CAAC,IAAI,oBAAoB,QAAQ,CAAC,eAAe,oBAAoB,QAAQ,CAAC,eAAe,cAAc,QAAQ,CAAC,SAAS,EAAE,CAC5K,CAAC;QACJ,CAAC;QAED,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAEpC,MAAM,yBAAyB,GAAG,MAAM,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;QACtE,MAAM,aAAa,GAAG,SAAS,CAC7B,WAAW,CAAC,IAAI,EAAE,2BAA2B,CAAC,CAAC,YAAY,CAAC,yBAAyB,CAAC,CACvF,CAAC;QACF,MAAM,CAAC,SAAS,CAAC,EAAC,GAAG,QAAQ,EAAE,SAAS,EAAE,GAAG,CAAC,KAAK,EAAE,aAAa,EAAC,CAAC,CAAC;QAErE,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,0BAA0B,CAAC,EAAC,yBAAyB,EAAC,EAAE,EAAC,MAAM,EAAC,CAAC,CAAC;QACpG,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACpB,OAAO,yBAAyB,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { ForkName, type ForkPostGloas } from "@lodestar/params";
|
|
2
|
-
import type { BuilderIndex, Bytes32, ExecutionAddress, ExecutionPayloadBid, Root, RootHex, Slot, gloas, heze } from "@lodestar/types";
|
|
3
|
-
import { LodestarError } from "@lodestar/utils";
|
|
4
|
-
import type { BuiltPayload } from "./payloadSource.js";
|
|
5
|
-
type CommonBidInput<F extends ForkPostGloas> = {
|
|
6
|
-
slot: Slot;
|
|
7
|
-
parentBlockRoot: Root;
|
|
8
|
-
/** Expected value from the BN payload attributes used for this build. */
|
|
9
|
-
prevRandao: Bytes32;
|
|
10
|
-
builderIndex: BuilderIndex;
|
|
11
|
-
feeRecipient: ExecutionAddress;
|
|
12
|
-
/** Bid value in gwei */
|
|
13
|
-
value: number;
|
|
14
|
-
payload: BuiltPayload & {
|
|
15
|
-
fork: F;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export type GloasBidInput = CommonBidInput<ForkName.gloas>;
|
|
19
|
-
export type HezeBidInput = CommonBidInput<ForkName.heze> & {
|
|
20
|
-
inclusionListBits: heze.ExecutionPayloadBid["inclusionListBits"];
|
|
21
|
-
};
|
|
22
|
-
export type ExecutionPayloadBidInput = GloasBidInput | HezeBidInput;
|
|
23
|
-
export declare enum ExecutionPayloadBidErrorCode {
|
|
24
|
-
INVALID_VALUE = "EXECUTION_PAYLOAD_BID_ERROR_INVALID_VALUE",
|
|
25
|
-
INVALID_GAS_LIMIT = "EXECUTION_PAYLOAD_BID_ERROR_INVALID_GAS_LIMIT",
|
|
26
|
-
SLOT_MISMATCH = "EXECUTION_PAYLOAD_BID_ERROR_SLOT_MISMATCH",
|
|
27
|
-
BLOCK_HASH_EQUALS_PARENT = "EXECUTION_PAYLOAD_BID_ERROR_BLOCK_HASH_EQUALS_PARENT",
|
|
28
|
-
INVALID_INCLUSION_LIST_BITS = "EXECUTION_PAYLOAD_BID_ERROR_INVALID_INCLUSION_LIST_BITS",
|
|
29
|
-
PREV_RANDAO_MISMATCH = "EXECUTION_PAYLOAD_BID_ERROR_PREV_RANDAO_MISMATCH"
|
|
30
|
-
}
|
|
31
|
-
export type ExecutionPayloadBidErrorType = {
|
|
32
|
-
code: ExecutionPayloadBidErrorCode.INVALID_GAS_LIMIT;
|
|
33
|
-
gasLimit: number;
|
|
34
|
-
} | {
|
|
35
|
-
code: ExecutionPayloadBidErrorCode.SLOT_MISMATCH;
|
|
36
|
-
slot: Slot;
|
|
37
|
-
payloadSlot: Slot;
|
|
38
|
-
} | {
|
|
39
|
-
code: ExecutionPayloadBidErrorCode.BLOCK_HASH_EQUALS_PARENT;
|
|
40
|
-
} | {
|
|
41
|
-
code: ExecutionPayloadBidErrorCode.INVALID_INCLUSION_LIST_BITS;
|
|
42
|
-
bitLen: number | undefined;
|
|
43
|
-
} | {
|
|
44
|
-
code: ExecutionPayloadBidErrorCode.PREV_RANDAO_MISMATCH;
|
|
45
|
-
expectedPrevRandao: RootHex;
|
|
46
|
-
payloadPrevRandao: RootHex;
|
|
47
|
-
} | {
|
|
48
|
-
code: ExecutionPayloadBidErrorCode.INVALID_VALUE;
|
|
49
|
-
value: number;
|
|
50
|
-
};
|
|
51
|
-
export declare class ExecutionPayloadBidError extends LodestarError<ExecutionPayloadBidErrorType> {
|
|
52
|
-
}
|
|
53
|
-
export declare function createExecutionPayloadBid(input: GloasBidInput): gloas.ExecutionPayloadBid;
|
|
54
|
-
export declare function createExecutionPayloadBid(input: HezeBidInput): heze.ExecutionPayloadBid;
|
|
55
|
-
export declare function createExecutionPayloadBid(input: ExecutionPayloadBidInput): ExecutionPayloadBid;
|
|
56
|
-
export {};
|
|
57
|
-
//# sourceMappingURL=executionPayloadBid.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executionPayloadBid.d.ts","sourceRoot":"","sources":["../../src/services/executionPayloadBid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,KAAK,aAAa,EAAgD,MAAM,kBAAkB,CAAC;AAC7G,OAAO,KAAK,EACV,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,mBAAmB,EACnB,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,KAAK,EACL,IAAI,EACL,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAC,aAAa,EAA6B,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAErD,KAAK,cAAc,CAAC,CAAC,SAAS,aAAa,IAAI;IAC7C,IAAI,EAAE,IAAI,CAAC;IACX,eAAe,EAAE,IAAI,CAAC;IACtB,yEAAyE;IACzE,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,gBAAgB,CAAC;IAC/B,wBAAwB;IACxB,KAAK,EA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,yBAAyB,CAAC,KAAK,EAAE,aAAa,GAAG,KAAK,CAAC,mBAAmB,CAAC;AAC3F,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC,mBAAmB,CAAC;AACzF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,wBAAwB,GAAG,mBAAmB,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { INCLUSION_LIST_COMMITTEE_SIZE, isForkPostHeze } from "@lodestar/params";
|
|
2
|
-
import { sszTypesFor } from "@lodestar/types";
|
|
3
|
-
import { LodestarError, byteArrayEquals, toRootHex } from "@lodestar/utils";
|
|
4
|
-
export var ExecutionPayloadBidErrorCode;
|
|
5
|
-
(function (ExecutionPayloadBidErrorCode) {
|
|
6
|
-
ExecutionPayloadBidErrorCode["INVALID_VALUE"] = "EXECUTION_PAYLOAD_BID_ERROR_INVALID_VALUE";
|
|
7
|
-
ExecutionPayloadBidErrorCode["INVALID_GAS_LIMIT"] = "EXECUTION_PAYLOAD_BID_ERROR_INVALID_GAS_LIMIT";
|
|
8
|
-
ExecutionPayloadBidErrorCode["SLOT_MISMATCH"] = "EXECUTION_PAYLOAD_BID_ERROR_SLOT_MISMATCH";
|
|
9
|
-
ExecutionPayloadBidErrorCode["BLOCK_HASH_EQUALS_PARENT"] = "EXECUTION_PAYLOAD_BID_ERROR_BLOCK_HASH_EQUALS_PARENT";
|
|
10
|
-
ExecutionPayloadBidErrorCode["INVALID_INCLUSION_LIST_BITS"] = "EXECUTION_PAYLOAD_BID_ERROR_INVALID_INCLUSION_LIST_BITS";
|
|
11
|
-
ExecutionPayloadBidErrorCode["PREV_RANDAO_MISMATCH"] = "EXECUTION_PAYLOAD_BID_ERROR_PREV_RANDAO_MISMATCH";
|
|
12
|
-
})(ExecutionPayloadBidErrorCode || (ExecutionPayloadBidErrorCode = {}));
|
|
13
|
-
export class ExecutionPayloadBidError extends LodestarError {
|
|
14
|
-
}
|
|
15
|
-
export function createExecutionPayloadBid(input) {
|
|
16
|
-
if (!Number.isSafeInteger(input.value) || input.value < 0) {
|
|
17
|
-
throw new ExecutionPayloadBidError({ code: ExecutionPayloadBidErrorCode.INVALID_VALUE, value: input.value }, `Invalid bid value value=${input.value}`);
|
|
18
|
-
}
|
|
19
|
-
const { fork, executionPayload, executionRequests, blobsBundle } = input.payload;
|
|
20
|
-
if (executionPayload.gasLimit > Number.MAX_SAFE_INTEGER) {
|
|
21
|
-
throw new ExecutionPayloadBidError({
|
|
22
|
-
code: ExecutionPayloadBidErrorCode.INVALID_GAS_LIMIT,
|
|
23
|
-
gasLimit: executionPayload.gasLimit,
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
if (executionPayload.slotNumber !== input.slot) {
|
|
27
|
-
throw new ExecutionPayloadBidError({
|
|
28
|
-
code: ExecutionPayloadBidErrorCode.SLOT_MISMATCH,
|
|
29
|
-
slot: input.slot,
|
|
30
|
-
payloadSlot: executionPayload.slotNumber,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
if (byteArrayEquals(executionPayload.blockHash, executionPayload.parentHash)) {
|
|
34
|
-
throw new ExecutionPayloadBidError({ code: ExecutionPayloadBidErrorCode.BLOCK_HASH_EQUALS_PARENT });
|
|
35
|
-
}
|
|
36
|
-
if (!byteArrayEquals(executionPayload.prevRandao, input.prevRandao)) {
|
|
37
|
-
throw new ExecutionPayloadBidError({
|
|
38
|
-
code: ExecutionPayloadBidErrorCode.PREV_RANDAO_MISMATCH,
|
|
39
|
-
expectedPrevRandao: toRootHex(input.prevRandao),
|
|
40
|
-
payloadPrevRandao: toRootHex(executionPayload.prevRandao),
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
const bid = {
|
|
44
|
-
parentBlockHash: executionPayload.parentHash,
|
|
45
|
-
parentBlockRoot: input.parentBlockRoot,
|
|
46
|
-
blockHash: executionPayload.blockHash,
|
|
47
|
-
prevRandao: input.prevRandao,
|
|
48
|
-
feeRecipient: input.feeRecipient,
|
|
49
|
-
gasLimit: BigInt(executionPayload.gasLimit),
|
|
50
|
-
builderIndex: input.builderIndex,
|
|
51
|
-
slot: input.slot,
|
|
52
|
-
value: input.value,
|
|
53
|
-
executionPayment: 0n,
|
|
54
|
-
blobKzgCommitments: blobsBundle.commitments,
|
|
55
|
-
executionRequestsRoot: sszTypesFor(fork).ExecutionRequests.hashTreeRoot(executionRequests),
|
|
56
|
-
};
|
|
57
|
-
if (isForkPostHeze(fork)) {
|
|
58
|
-
const inclusionListBits = "inclusionListBits" in input ? input.inclusionListBits : undefined;
|
|
59
|
-
if (inclusionListBits?.bitLen !== INCLUSION_LIST_COMMITTEE_SIZE) {
|
|
60
|
-
throw new ExecutionPayloadBidError({
|
|
61
|
-
code: ExecutionPayloadBidErrorCode.INVALID_INCLUSION_LIST_BITS,
|
|
62
|
-
bitLen: inclusionListBits?.bitLen,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
return { ...bid, inclusionListBits };
|
|
66
|
-
}
|
|
67
|
-
return bid;
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=executionPayloadBid.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executionPayloadBid.js","sourceRoot":"","sources":["../../src/services/executionPayloadBid.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,6BAA6B,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAY7G,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAE,eAAe,EAAE,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAuB1E,MAAM,CAAN,IAAY,4BAOX;AAPD,WAAY,4BAA4B;IACtC,2FAA2D,CAAA;IAC3D,mGAAmE,CAAA;IACnE,2FAA2D,CAAA;IAC3D,iHAAiF,CAAA;IACjF,uHAAuF,CAAA;IACvF,yGAAyE,CAAA;AAC3E,CAAC,EAPW,4BAA4B,KAA5B,4BAA4B,QAOvC;AAi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
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type {ApiClient} from "@lodestar/api";
|
|
2
|
-
import type {ChainForkConfig} from "@lodestar/config";
|
|
3
|
-
import {isForkPostGloas} from "@lodestar/params";
|
|
4
|
-
import type {BuilderIndex, RootHex, Slot, gloas, heze} from "@lodestar/types";
|
|
5
|
-
import {sszTypesFor} from "@lodestar/types";
|
|
6
|
-
import {LodestarError, toRootHex} from "@lodestar/utils";
|
|
7
|
-
import type {BidIdentity, BidLedger} from "./bidLedger.js";
|
|
8
|
-
import type {BuilderSigner} from "./builderSigner.js";
|
|
9
|
-
|
|
10
|
-
export type BidPublisherModules = {
|
|
11
|
-
api: ApiClient;
|
|
12
|
-
config: ChainForkConfig;
|
|
13
|
-
signer: BuilderSigner;
|
|
14
|
-
ledger: BidLedger;
|
|
15
|
-
builderIndex: BuilderIndex;
|
|
16
|
-
hasPayload: (identity: BidIdentity) => boolean;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export enum BidPublisherErrorCode {
|
|
20
|
-
BUILDER_INDEX_MISMATCH = "BID_PUBLISHER_ERROR_BUILDER_INDEX_MISMATCH",
|
|
21
|
-
PAYLOAD_NOT_RETAINED = "BID_PUBLISHER_ERROR_PAYLOAD_NOT_RETAINED",
|
|
22
|
-
PRE_GLOAS_BID = "BID_PUBLISHER_ERROR_PRE_GLOAS_BID",
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export type BidPublisherErrorType =
|
|
26
|
-
| {
|
|
27
|
-
code: BidPublisherErrorCode.PRE_GLOAS_BID;
|
|
28
|
-
slot: Slot;
|
|
29
|
-
}
|
|
30
|
-
| {
|
|
31
|
-
code: BidPublisherErrorCode.BUILDER_INDEX_MISMATCH;
|
|
32
|
-
builderIndex: BuilderIndex;
|
|
33
|
-
bidBuilderIndex: BuilderIndex;
|
|
34
|
-
}
|
|
35
|
-
| {
|
|
36
|
-
code: BidPublisherErrorCode.PAYLOAD_NOT_RETAINED;
|
|
37
|
-
slot: Slot;
|
|
38
|
-
parentBlockHash: RootHex;
|
|
39
|
-
parentBlockRoot: RootHex;
|
|
40
|
-
blockHash: RootHex;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export class BidPublisherError extends LodestarError<BidPublisherErrorType> {}
|
|
44
|
-
|
|
45
|
-
/** Signs and submits a bid only if its payload is retained locally. */
|
|
46
|
-
export class BidPublisher {
|
|
47
|
-
constructor(private readonly modules: BidPublisherModules) {}
|
|
48
|
-
|
|
49
|
-
publish(bid: heze.ExecutionPayloadBid, signal: AbortSignal): Promise<heze.SignedExecutionPayloadBid>;
|
|
50
|
-
publish(bid: gloas.ExecutionPayloadBid, signal: AbortSignal): Promise<gloas.SignedExecutionPayloadBid>;
|
|
51
|
-
async publish(bid: gloas.ExecutionPayloadBid, signal: AbortSignal): Promise<gloas.SignedExecutionPayloadBid> {
|
|
52
|
-
signal.throwIfAborted();
|
|
53
|
-
|
|
54
|
-
const {api, config, builderIndex, hasPayload, ledger, signer} = this.modules;
|
|
55
|
-
const fork = config.getForkName(bid.slot);
|
|
56
|
-
if (!isForkPostGloas(fork)) {
|
|
57
|
-
throw new BidPublisherError({code: BidPublisherErrorCode.PRE_GLOAS_BID, slot: bid.slot});
|
|
58
|
-
}
|
|
59
|
-
if (bid.builderIndex !== builderIndex) {
|
|
60
|
-
throw new BidPublisherError(
|
|
61
|
-
{
|
|
62
|
-
code: BidPublisherErrorCode.BUILDER_INDEX_MISMATCH,
|
|
63
|
-
builderIndex,
|
|
64
|
-
bidBuilderIndex: bid.builderIndex,
|
|
65
|
-
},
|
|
66
|
-
`Bid builder index does not match local builder index builderIndex=${builderIndex} bidBuilderIndex=${bid.builderIndex}`
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const identity: BidIdentity = {
|
|
71
|
-
slot: bid.slot,
|
|
72
|
-
parentBlockHash: toRootHex(bid.parentBlockHash),
|
|
73
|
-
parentBlockRoot: toRootHex(bid.parentBlockRoot),
|
|
74
|
-
blockHash: toRootHex(bid.blockHash),
|
|
75
|
-
};
|
|
76
|
-
if (!hasPayload(identity)) {
|
|
77
|
-
throw new BidPublisherError(
|
|
78
|
-
{code: BidPublisherErrorCode.PAYLOAD_NOT_RETAINED, ...identity},
|
|
79
|
-
`Bid payload is not retained slot=${identity.slot} parentBlockHash=${identity.parentBlockHash} parentBlockRoot=${identity.parentBlockRoot} blockHash=${identity.blockHash}`
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
ledger.assertCanRecordBid(identity);
|
|
84
|
-
|
|
85
|
-
const signedExecutionPayloadBid = signer.signExecutionPayloadBid(bid);
|
|
86
|
-
const signedBidRoot = toRootHex(
|
|
87
|
-
sszTypesFor(fork, "SignedExecutionPayloadBid").hashTreeRoot(signedExecutionPayloadBid)
|
|
88
|
-
);
|
|
89
|
-
ledger.recordBid({...identity, valueGwei: bid.value, signedBidRoot});
|
|
90
|
-
|
|
91
|
-
const response = await api.beacon.publishExecutionPayloadBid({signedExecutionPayloadBid}, {signal});
|
|
92
|
-
response.assertOk();
|
|
93
|
-
return signedExecutionPayloadBid;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import {ForkName, type ForkPostGloas, INCLUSION_LIST_COMMITTEE_SIZE, isForkPostHeze} from "@lodestar/params";
|
|
2
|
-
import type {
|
|
3
|
-
BuilderIndex,
|
|
4
|
-
Bytes32,
|
|
5
|
-
ExecutionAddress,
|
|
6
|
-
ExecutionPayloadBid,
|
|
7
|
-
Root,
|
|
8
|
-
RootHex,
|
|
9
|
-
Slot,
|
|
10
|
-
gloas,
|
|
11
|
-
heze,
|
|
12
|
-
} from "@lodestar/types";
|
|
13
|
-
import {sszTypesFor} from "@lodestar/types";
|
|
14
|
-
import {LodestarError, byteArrayEquals, toRootHex} from "@lodestar/utils";
|
|
15
|
-
import type {BuiltPayload} from "./payloadSource.js";
|
|
16
|
-
|
|
17
|
-
type CommonBidInput<F extends ForkPostGloas> = {
|
|
18
|
-
slot: Slot;
|
|
19
|
-
parentBlockRoot: Root;
|
|
20
|
-
/** Expected value from the BN payload attributes used for this build. */
|
|
21
|
-
prevRandao: Bytes32;
|
|
22
|
-
builderIndex: BuilderIndex;
|
|
23
|
-
feeRecipient: ExecutionAddress;
|
|
24
|
-
/** Bid value in gwei */
|
|
25
|
-
value: number;
|
|
26
|
-
payload: BuiltPayload & {fork: F};
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export type GloasBidInput = CommonBidInput<ForkName.gloas>;
|
|
30
|
-
|
|
31
|
-
export type HezeBidInput = CommonBidInput<ForkName.heze> & {
|
|
32
|
-
inclusionListBits: heze.ExecutionPayloadBid["inclusionListBits"];
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export type ExecutionPayloadBidInput = GloasBidInput | HezeBidInput;
|
|
36
|
-
|
|
37
|
-
export enum ExecutionPayloadBidErrorCode {
|
|
38
|
-
INVALID_VALUE = "EXECUTION_PAYLOAD_BID_ERROR_INVALID_VALUE",
|
|
39
|
-
INVALID_GAS_LIMIT = "EXECUTION_PAYLOAD_BID_ERROR_INVALID_GAS_LIMIT",
|
|
40
|
-
SLOT_MISMATCH = "EXECUTION_PAYLOAD_BID_ERROR_SLOT_MISMATCH",
|
|
41
|
-
BLOCK_HASH_EQUALS_PARENT = "EXECUTION_PAYLOAD_BID_ERROR_BLOCK_HASH_EQUALS_PARENT",
|
|
42
|
-
INVALID_INCLUSION_LIST_BITS = "EXECUTION_PAYLOAD_BID_ERROR_INVALID_INCLUSION_LIST_BITS",
|
|
43
|
-
PREV_RANDAO_MISMATCH = "EXECUTION_PAYLOAD_BID_ERROR_PREV_RANDAO_MISMATCH",
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export type ExecutionPayloadBidErrorType =
|
|
47
|
-
| {code: ExecutionPayloadBidErrorCode.INVALID_GAS_LIMIT; gasLimit: number}
|
|
48
|
-
| {code: ExecutionPayloadBidErrorCode.SLOT_MISMATCH; slot: Slot; payloadSlot: Slot}
|
|
49
|
-
| {code: ExecutionPayloadBidErrorCode.BLOCK_HASH_EQUALS_PARENT}
|
|
50
|
-
| {code: ExecutionPayloadBidErrorCode.INVALID_INCLUSION_LIST_BITS; bitLen: number | undefined}
|
|
51
|
-
| {
|
|
52
|
-
code: ExecutionPayloadBidErrorCode.PREV_RANDAO_MISMATCH;
|
|
53
|
-
expectedPrevRandao: RootHex;
|
|
54
|
-
payloadPrevRandao: RootHex;
|
|
55
|
-
}
|
|
56
|
-
| {
|
|
57
|
-
code: ExecutionPayloadBidErrorCode.INVALID_VALUE;
|
|
58
|
-
value: number;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export class ExecutionPayloadBidError extends LodestarError<ExecutionPayloadBidErrorType> {}
|
|
62
|
-
|
|
63
|
-
export function createExecutionPayloadBid(input: GloasBidInput): gloas.ExecutionPayloadBid;
|
|
64
|
-
export function createExecutionPayloadBid(input: HezeBidInput): heze.ExecutionPayloadBid;
|
|
65
|
-
export function createExecutionPayloadBid(input: ExecutionPayloadBidInput): ExecutionPayloadBid;
|
|
66
|
-
export function createExecutionPayloadBid(input: ExecutionPayloadBidInput): ExecutionPayloadBid {
|
|
67
|
-
if (!Number.isSafeInteger(input.value) || input.value < 0) {
|
|
68
|
-
throw new ExecutionPayloadBidError(
|
|
69
|
-
{code: ExecutionPayloadBidErrorCode.INVALID_VALUE, value: input.value},
|
|
70
|
-
`Invalid bid value value=${input.value}`
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const {fork, executionPayload, executionRequests, blobsBundle} = input.payload;
|
|
75
|
-
if (executionPayload.gasLimit > Number.MAX_SAFE_INTEGER) {
|
|
76
|
-
throw new ExecutionPayloadBidError({
|
|
77
|
-
code: ExecutionPayloadBidErrorCode.INVALID_GAS_LIMIT,
|
|
78
|
-
gasLimit: executionPayload.gasLimit,
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
if (executionPayload.slotNumber !== input.slot) {
|
|
82
|
-
throw new ExecutionPayloadBidError({
|
|
83
|
-
code: ExecutionPayloadBidErrorCode.SLOT_MISMATCH,
|
|
84
|
-
slot: input.slot,
|
|
85
|
-
payloadSlot: executionPayload.slotNumber,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
if (byteArrayEquals(executionPayload.blockHash, executionPayload.parentHash)) {
|
|
89
|
-
throw new ExecutionPayloadBidError({code: ExecutionPayloadBidErrorCode.BLOCK_HASH_EQUALS_PARENT});
|
|
90
|
-
}
|
|
91
|
-
if (!byteArrayEquals(executionPayload.prevRandao, input.prevRandao)) {
|
|
92
|
-
throw new ExecutionPayloadBidError({
|
|
93
|
-
code: ExecutionPayloadBidErrorCode.PREV_RANDAO_MISMATCH,
|
|
94
|
-
expectedPrevRandao: toRootHex(input.prevRandao),
|
|
95
|
-
payloadPrevRandao: toRootHex(executionPayload.prevRandao),
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
const bid: gloas.ExecutionPayloadBid = {
|
|
99
|
-
parentBlockHash: executionPayload.parentHash,
|
|
100
|
-
parentBlockRoot: input.parentBlockRoot,
|
|
101
|
-
blockHash: executionPayload.blockHash,
|
|
102
|
-
prevRandao: input.prevRandao,
|
|
103
|
-
feeRecipient: input.feeRecipient,
|
|
104
|
-
gasLimit: BigInt(executionPayload.gasLimit),
|
|
105
|
-
builderIndex: input.builderIndex,
|
|
106
|
-
slot: input.slot,
|
|
107
|
-
value: input.value,
|
|
108
|
-
executionPayment: 0n,
|
|
109
|
-
blobKzgCommitments: blobsBundle.commitments,
|
|
110
|
-
executionRequestsRoot: sszTypesFor(fork).ExecutionRequests.hashTreeRoot(executionRequests),
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
if (isForkPostHeze(fork)) {
|
|
114
|
-
const inclusionListBits = "inclusionListBits" in input ? input.inclusionListBits : undefined;
|
|
115
|
-
if (inclusionListBits?.bitLen !== INCLUSION_LIST_COMMITTEE_SIZE) {
|
|
116
|
-
throw new ExecutionPayloadBidError({
|
|
117
|
-
code: ExecutionPayloadBidErrorCode.INVALID_INCLUSION_LIST_BITS,
|
|
118
|
-
bitLen: inclusionListBits?.bitLen,
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
return {...bid, inclusionListBits};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return bid;
|
|
125
|
-
}
|