@lodestar/validator 1.45.0-dev.0c3761f06f → 1.45.0-dev.2e1d834bb9
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.
|
@@ -10,7 +10,10 @@ import { ValidatorStore } from "./validatorStore.js";
|
|
|
10
10
|
* dependent root for an epoch shifts (e.g. after a reorg) — detected by comparing the cached
|
|
11
11
|
* `dependentRoot` reported by `BlockDutiesService` against the one we last submitted under.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* Proposers should broadcast their preferences before the fork so the proposer preference caches
|
|
14
|
+
* of beacon nodes and builders are warm for the first Gloas slots. We start submitting
|
|
15
|
+
* as soon as a duty's proposal slot is in Gloas, which is up to `SUBMIT_BEFORE_PROPOSAL_SLOTS`
|
|
16
|
+
* before the fork, so only the first few Gloas slots are affected by this pre-fork submission.
|
|
14
17
|
*/
|
|
15
18
|
export declare class ProposerPreferencesService {
|
|
16
19
|
private readonly config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposerPreferences.d.ts","sourceRoot":"","sources":["../../src/services/proposerPreferences.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAKjD,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAgBnD
|
|
1
|
+
{"version":3,"file":"proposerPreferences.d.ts","sourceRoot":"","sources":["../../src/services/proposerPreferences.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAKjD,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAgBnD;;;;;;;;;;GAUG;AACH,qBAAa,0BAA0B;IAInC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAEpB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IARrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAsC;IAEhE,YACmB,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,QAAQ,EAChB,GAAG,EAAE,SAAS,EAC/B,KAAK,EAAE,MAAM,EACI,cAAc,EAAE,cAAc,EAC9B,kBAAkB,EAAE,kBAAkB,EACvD,QAAQ,EAAE,OAAO,GAAG,IAAI,EAGzB;IAED,OAAO,CAAC,0BAA0B,CA8EhC;CACH"}
|
|
@@ -17,7 +17,10 @@ const SUBMIT_BEFORE_PROPOSAL_SLOTS = Math.floor(SLOTS_PER_EPOCH / 4);
|
|
|
17
17
|
* dependent root for an epoch shifts (e.g. after a reorg) — detected by comparing the cached
|
|
18
18
|
* `dependentRoot` reported by `BlockDutiesService` against the one we last submitted under.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
20
|
+
* Proposers should broadcast their preferences before the fork so the proposer preference caches
|
|
21
|
+
* of beacon nodes and builders are warm for the first Gloas slots. We start submitting
|
|
22
|
+
* as soon as a duty's proposal slot is in Gloas, which is up to `SUBMIT_BEFORE_PROPOSAL_SLOTS`
|
|
23
|
+
* before the fork, so only the first few Gloas slots are affected by this pre-fork submission.
|
|
21
24
|
*/
|
|
22
25
|
export class ProposerPreferencesService {
|
|
23
26
|
config;
|
|
@@ -35,7 +38,10 @@ export class ProposerPreferencesService {
|
|
|
35
38
|
clock.runEverySlot(this.runProposerPreferencesTask);
|
|
36
39
|
}
|
|
37
40
|
runProposerPreferencesTask = async (slot) => {
|
|
38
|
-
|
|
41
|
+
// Start running once the submission window (`slot + SUBMIT_BEFORE_PROPOSAL_SLOTS`) reaches
|
|
42
|
+
// Gloas, i.e. already in the epoch before the fork. This allows builders to prepare and
|
|
43
|
+
// submit bids for the first Gloas slots.
|
|
44
|
+
if (!isForkPostGloas(this.config.getForkName(slot + SUBMIT_BEFORE_PROPOSAL_SLOTS))) {
|
|
39
45
|
return;
|
|
40
46
|
}
|
|
41
47
|
const currentEpoch = computeEpochAtSlot(slot);
|
|
@@ -68,6 +74,8 @@ export class ProposerPreferencesService {
|
|
|
68
74
|
continue;
|
|
69
75
|
if (duty.slot > slot + SUBMIT_BEFORE_PROPOSAL_SLOTS)
|
|
70
76
|
continue;
|
|
77
|
+
if (!isForkPostGloas(this.config.getForkName(duty.slot)))
|
|
78
|
+
continue;
|
|
71
79
|
if (submission.slots.has(duty.slot))
|
|
72
80
|
continue;
|
|
73
81
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposerPreferences.js","sourceRoot":"","sources":["../../src/services/proposerPreferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,eAAe,EAAE,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAC,OAAO,EAAE,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAMrD;;;;;;;;GAQG;AACH,MAAM,4BAA4B,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;AAKrE
|
|
1
|
+
{"version":3,"file":"proposerPreferences.js","sourceRoot":"","sources":["../../src/services/proposerPreferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,eAAe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CAAC;QACvG,CAAC;IAAA,CACF,CAAC;CACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lodestar/validator",
|
|
3
|
-
"version": "1.45.0-dev.
|
|
3
|
+
"version": "1.45.0-dev.2e1d834bb9",
|
|
4
4
|
"description": "A Typescript implementation of the validator client",
|
|
5
5
|
"author": "ChainSafe Systems",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -50,21 +50,21 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@chainsafe/blst": "^2.2.0",
|
|
52
52
|
"@chainsafe/ssz": "^1.4.0",
|
|
53
|
-
"@lodestar/api": "^1.45.0-dev.
|
|
54
|
-
"@lodestar/config": "^1.45.0-dev.
|
|
55
|
-
"@lodestar/db": "^1.45.0-dev.
|
|
56
|
-
"@lodestar/params": "^1.45.0-dev.
|
|
57
|
-
"@lodestar/state-transition": "^1.45.0-dev.
|
|
58
|
-
"@lodestar/types": "^1.45.0-dev.
|
|
59
|
-
"@lodestar/utils": "^1.45.0-dev.
|
|
53
|
+
"@lodestar/api": "^1.45.0-dev.2e1d834bb9",
|
|
54
|
+
"@lodestar/config": "^1.45.0-dev.2e1d834bb9",
|
|
55
|
+
"@lodestar/db": "^1.45.0-dev.2e1d834bb9",
|
|
56
|
+
"@lodestar/params": "^1.45.0-dev.2e1d834bb9",
|
|
57
|
+
"@lodestar/state-transition": "^1.45.0-dev.2e1d834bb9",
|
|
58
|
+
"@lodestar/types": "^1.45.0-dev.2e1d834bb9",
|
|
59
|
+
"@lodestar/utils": "^1.45.0-dev.2e1d834bb9",
|
|
60
60
|
"strict-event-emitter-types": "^2.0.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@lodestar/logger": "^1.45.0-dev.
|
|
64
|
-
"@lodestar/spec-test-util": "^1.45.0-dev.
|
|
65
|
-
"@lodestar/test-utils": "^1.45.0-dev.
|
|
63
|
+
"@lodestar/logger": "^1.45.0-dev.2e1d834bb9",
|
|
64
|
+
"@lodestar/spec-test-util": "^1.45.0-dev.2e1d834bb9",
|
|
65
|
+
"@lodestar/test-utils": "^1.45.0-dev.2e1d834bb9",
|
|
66
66
|
"@vekexasia/bigint-buffer2": "^1.1.1",
|
|
67
67
|
"rimraf": "^4.4.1"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "4bd0feebb55734a1ca3af92343f1cdf93d78fced"
|
|
70
70
|
}
|
|
@@ -29,7 +29,10 @@ type SubmittedAtEpoch = {dependentRoot: RootHex; slots: Set<Slot>};
|
|
|
29
29
|
* dependent root for an epoch shifts (e.g. after a reorg) — detected by comparing the cached
|
|
30
30
|
* `dependentRoot` reported by `BlockDutiesService` against the one we last submitted under.
|
|
31
31
|
*
|
|
32
|
-
*
|
|
32
|
+
* Proposers should broadcast their preferences before the fork so the proposer preference caches
|
|
33
|
+
* of beacon nodes and builders are warm for the first Gloas slots. We start submitting
|
|
34
|
+
* as soon as a duty's proposal slot is in Gloas, which is up to `SUBMIT_BEFORE_PROPOSAL_SLOTS`
|
|
35
|
+
* before the fork, so only the first few Gloas slots are affected by this pre-fork submission.
|
|
33
36
|
*/
|
|
34
37
|
export class ProposerPreferencesService {
|
|
35
38
|
private readonly submitted = new Map<Epoch, SubmittedAtEpoch>();
|
|
@@ -47,7 +50,10 @@ export class ProposerPreferencesService {
|
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
private runProposerPreferencesTask = async (slot: Slot): Promise<void> => {
|
|
50
|
-
|
|
53
|
+
// Start running once the submission window (`slot + SUBMIT_BEFORE_PROPOSAL_SLOTS`) reaches
|
|
54
|
+
// Gloas, i.e. already in the epoch before the fork. This allows builders to prepare and
|
|
55
|
+
// submit bids for the first Gloas slots.
|
|
56
|
+
if (!isForkPostGloas(this.config.getForkName(slot + SUBMIT_BEFORE_PROPOSAL_SLOTS))) {
|
|
51
57
|
return;
|
|
52
58
|
}
|
|
53
59
|
|
|
@@ -82,6 +88,7 @@ export class ProposerPreferencesService {
|
|
|
82
88
|
for (const duty of dutiesAtEpoch.data) {
|
|
83
89
|
if (duty.slot <= slot) continue;
|
|
84
90
|
if (duty.slot > slot + SUBMIT_BEFORE_PROPOSAL_SLOTS) continue;
|
|
91
|
+
if (!isForkPostGloas(this.config.getForkName(duty.slot))) continue;
|
|
85
92
|
if (submission.slots.has(duty.slot)) continue;
|
|
86
93
|
|
|
87
94
|
try {
|