@lodestar/state-transition 1.46.0-dev.ba5ee9aff0 → 1.46.0-dev.cae84b66d5
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/block/index.d.ts.map +1 -1
- package/lib/block/index.js +3 -2
- package/lib/block/index.js.map +1 -1
- package/lib/block/processAttestations.d.ts +2 -2
- package/lib/block/processAttestations.d.ts.map +1 -1
- package/lib/block/processAttestations.js +2 -2
- package/lib/block/processAttestations.js.map +1 -1
- package/lib/block/processAttestationsAltair.d.ts +3 -3
- package/lib/block/processAttestationsAltair.d.ts.map +1 -1
- package/lib/block/processAttestationsAltair.js +7 -4
- package/lib/block/processAttestationsAltair.js.map +1 -1
- package/lib/block/processExecutionPayloadBid.d.ts +2 -2
- package/lib/block/processExecutionPayloadBid.d.ts.map +1 -1
- package/lib/block/processExecutionPayloadBid.js +2 -0
- package/lib/block/processExecutionPayloadBid.js.map +1 -1
- package/lib/block/processOperations.d.ts +2 -2
- package/lib/block/processOperations.d.ts.map +1 -1
- package/lib/block/processOperations.js +2 -2
- package/lib/block/processOperations.js.map +1 -1
- package/lib/rewards/blockRewards.d.ts.map +1 -1
- package/lib/rewards/blockRewards.js +7 -4
- package/lib/rewards/blockRewards.js.map +1 -1
- package/lib/slot/upgradeStateToAltair.js +1 -1
- package/lib/slot/upgradeStateToAltair.js.map +1 -1
- package/lib/slot/upgradeStateToGloas.js +1 -1
- package/lib/slot/upgradeStateToGloas.js.map +1 -1
- package/lib/util/clock.d.ts +55 -0
- package/lib/util/clock.d.ts.map +1 -0
- package/lib/util/clock.js +142 -0
- package/lib/util/clock.js.map +1 -0
- package/lib/util/index.d.ts +1 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -0
- package/lib/util/index.js.map +1 -1
- package/package.json +13 -13
- package/src/block/index.ts +4 -3
- package/src/block/processAttestations.ts +10 -2
- package/src/block/processAttestationsAltair.ts +10 -4
- package/src/block/processExecutionPayloadBid.ts +5 -2
- package/src/block/processOperations.ts +3 -2
- package/src/rewards/blockRewards.ts +20 -5
- package/src/slot/upgradeStateToAltair.ts +1 -0
- package/src/slot/upgradeStateToGloas.ts +1 -1
- package/src/util/clock.ts +183 -0
- package/src/util/index.ts +1 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { GENESIS_SLOT, SLOTS_PER_EPOCH } from "@lodestar/params";
|
|
2
|
+
import { ErrorAborted, isErrorAborted, sleep } from "@lodestar/utils";
|
|
3
|
+
import { computeEpochAtSlot } from "./epoch.js";
|
|
4
|
+
import { computeTimeAtSlot, getCurrentSlot } from "./slot.js";
|
|
5
|
+
export { TimeItem };
|
|
6
|
+
var TimeItem;
|
|
7
|
+
(function (TimeItem) {
|
|
8
|
+
TimeItem[TimeItem["Slot"] = 0] = "Slot";
|
|
9
|
+
TimeItem[TimeItem["Epoch"] = 1] = "Epoch";
|
|
10
|
+
})(TimeItem || (TimeItem = {}));
|
|
11
|
+
export class Clock {
|
|
12
|
+
opts;
|
|
13
|
+
genesisTime;
|
|
14
|
+
secondsPerSlot;
|
|
15
|
+
config;
|
|
16
|
+
logger;
|
|
17
|
+
fns = [];
|
|
18
|
+
constructor(config, logger, opts) {
|
|
19
|
+
this.opts = opts;
|
|
20
|
+
this.genesisTime = opts.genesisTime;
|
|
21
|
+
this.secondsPerSlot = config.SLOT_DURATION_MS / 1000;
|
|
22
|
+
this.config = config;
|
|
23
|
+
this.logger = logger;
|
|
24
|
+
}
|
|
25
|
+
get currentEpoch() {
|
|
26
|
+
return computeEpochAtSlot(getCurrentSlot(this.config, this.genesisTime));
|
|
27
|
+
}
|
|
28
|
+
start(signal) {
|
|
29
|
+
for (const { timeItem, fn } of this.fns) {
|
|
30
|
+
this.runAtMostEvery(timeItem, signal, fn).catch((e) => {
|
|
31
|
+
if (!isErrorAborted(e)) {
|
|
32
|
+
this.logger.error("runAtMostEvery", {}, e);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
getCurrentSlot() {
|
|
38
|
+
return getCurrentSlot(this.config, this.genesisTime);
|
|
39
|
+
}
|
|
40
|
+
getCurrentEpoch() {
|
|
41
|
+
return computeEpochAtSlot(getCurrentSlot(this.config, this.genesisTime));
|
|
42
|
+
}
|
|
43
|
+
runEverySlot(fn) {
|
|
44
|
+
this.fns.push({ timeItem: TimeItem.Slot, fn });
|
|
45
|
+
}
|
|
46
|
+
runEveryEpoch(fn) {
|
|
47
|
+
this.fns.push({ timeItem: TimeItem.Epoch, fn });
|
|
48
|
+
}
|
|
49
|
+
/** Milliseconds from now to a specific slot */
|
|
50
|
+
msToSlot(slot) {
|
|
51
|
+
return computeTimeAtSlot(this.config, slot, this.genesisTime) * 1000 - Date.now();
|
|
52
|
+
}
|
|
53
|
+
/** Milliseconds elapsed from a specific slot to now */
|
|
54
|
+
msFromSlot(slot) {
|
|
55
|
+
return Date.now() - computeTimeAtSlot(this.config, slot, this.genesisTime) * 1000;
|
|
56
|
+
}
|
|
57
|
+
/** Seconds elapsed from a specific slot to now */
|
|
58
|
+
secFromSlot(slot) {
|
|
59
|
+
return Date.now() / 1000 - computeTimeAtSlot(this.config, slot, this.genesisTime);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* If a task happens to take more than one slot to run, we might skip a slot. This is unfortunate,
|
|
63
|
+
* however the alternative is to *always* process every slot, which has the chance of creating a
|
|
64
|
+
* theoretically unlimited backlog of tasks. It was a conscious decision to choose to drop tasks
|
|
65
|
+
* on an overloaded/latent system rather than overload it even more.
|
|
66
|
+
*/
|
|
67
|
+
async runAtMostEvery(timeItem, signal, fn) {
|
|
68
|
+
// Run immediately first
|
|
69
|
+
let slot = getCurrentSlot(this.config, this.genesisTime);
|
|
70
|
+
let slotOrEpoch = timeItem === TimeItem.Slot ? slot : computeEpochAtSlot(slot);
|
|
71
|
+
while (!signal.aborted) {
|
|
72
|
+
// Must catch fn() to ensure `sleep()` is awaited both for resolve and reject
|
|
73
|
+
const task = fn(slotOrEpoch, signal).catch((e) => {
|
|
74
|
+
if (!isErrorAborted(e))
|
|
75
|
+
this.logger.error("Error on runEvery fn", {}, e);
|
|
76
|
+
});
|
|
77
|
+
if (timeItem !== TimeItem.Slot || this.opts.skipSlots !== false) {
|
|
78
|
+
// await response to only continue with next task if current task finished within slot
|
|
79
|
+
await task;
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
await sleep(this.timeUntilNext(timeItem), signal);
|
|
83
|
+
// calling getCurrentSlot here may not be correct when we're close to the next slot
|
|
84
|
+
// it's safe to call getCurrentSlotAround after we sleep
|
|
85
|
+
const nextSlot = getCurrentSlotAround(this.config, this.genesisTime);
|
|
86
|
+
if (timeItem === TimeItem.Slot) {
|
|
87
|
+
if (nextSlot > slot + 1) {
|
|
88
|
+
// It's not very likely that we skip more than one slot as HTTP timeout is set
|
|
89
|
+
// to SLOT_DURATION_MS so we will fail task before skipping another slot.
|
|
90
|
+
this.logger.warn("Skipped slot due to task taking more than one slot to run", {
|
|
91
|
+
skippedSlot: slot + 1,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
slotOrEpoch = nextSlot;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
slotOrEpoch = computeEpochAtSlot(nextSlot);
|
|
98
|
+
}
|
|
99
|
+
slot = nextSlot;
|
|
100
|
+
}
|
|
101
|
+
catch (e) {
|
|
102
|
+
if (e instanceof ErrorAborted) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
throw e;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
timeUntilNext(timeItem) {
|
|
110
|
+
const milliSecondsPerSlot = this.config.SLOT_DURATION_MS;
|
|
111
|
+
const msFromGenesis = Date.now() - this.genesisTime * 1000;
|
|
112
|
+
if (timeItem === TimeItem.Slot) {
|
|
113
|
+
if (msFromGenesis >= 0) {
|
|
114
|
+
return milliSecondsPerSlot - (msFromGenesis % milliSecondsPerSlot);
|
|
115
|
+
}
|
|
116
|
+
return Math.abs(msFromGenesis) % milliSecondsPerSlot;
|
|
117
|
+
}
|
|
118
|
+
const milliSecondsPerEpoch = SLOTS_PER_EPOCH * milliSecondsPerSlot;
|
|
119
|
+
if (msFromGenesis >= 0) {
|
|
120
|
+
return milliSecondsPerEpoch - (msFromGenesis % milliSecondsPerEpoch);
|
|
121
|
+
}
|
|
122
|
+
return Math.abs(msFromGenesis) % milliSecondsPerEpoch;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Same to the spec but we use Math.round instead of Math.floor.
|
|
127
|
+
*/
|
|
128
|
+
export function getCurrentSlotAround(config, genesisTime) {
|
|
129
|
+
const diffInSeconds = Date.now() / 1000 - genesisTime;
|
|
130
|
+
const slotsSinceGenesis = Math.round((diffInSeconds * 1000) / config.SLOT_DURATION_MS);
|
|
131
|
+
return GENESIS_SLOT + slotsSinceGenesis;
|
|
132
|
+
}
|
|
133
|
+
// function useEventStream() {
|
|
134
|
+
// this.stream = this.events.getEventStream([BeaconEventType.BLOCK, BeaconEventType.HEAD, BeaconEventType.CHAIN_REORG]);
|
|
135
|
+
// pipeToEmitter(this.stream, this).catch((e: Error) => {
|
|
136
|
+
// this.logger.error("Error on stream pipe", {}, e);
|
|
137
|
+
// });
|
|
138
|
+
// // On stop
|
|
139
|
+
// this.stream.stop();
|
|
140
|
+
// this.stream = null;
|
|
141
|
+
// }
|
|
142
|
+
//# sourceMappingURL=clock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock.js","sourceRoot":"","sources":["../../src/util/clock.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAE,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAC,YAAY,EAAU,cAAc,EAAE,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAC,kBAAkB,EAAC,MAAM,YAAY,CAAC;AA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,GAAG,iBAAiB,CAAC;AAAA,CACzC;AAED,8BAA8B;AAC9B,0HAA0H;AAC1H,2DAA2D;AAC3D,wDAAwD;AACxD,QAAQ;AAER,eAAe;AACf,wBAAwB;AACxB,wBAAwB;AACxB,IAAI"}
|
package/lib/util/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./balance.js";
|
|
|
6
6
|
export * from "./blindedBlock.js";
|
|
7
7
|
export * from "./blockRoot.js";
|
|
8
8
|
export * from "./capella.js";
|
|
9
|
+
export * from "./clock.js";
|
|
9
10
|
export * from "./computeAnchorCheckpoint.js";
|
|
10
11
|
export * from "./deposit.js";
|
|
11
12
|
export * from "./domain.js";
|
package/lib/util/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
|
package/lib/util/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./balance.js";
|
|
|
6
6
|
export * from "./blindedBlock.js";
|
|
7
7
|
export * from "./blockRoot.js";
|
|
8
8
|
export * from "./capella.js";
|
|
9
|
+
export * from "./clock.js";
|
|
9
10
|
export * from "./computeAnchorCheckpoint.js";
|
|
10
11
|
export * from "./deposit.js";
|
|
11
12
|
export * from "./domain.js";
|
package/lib/util/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -11,36 +11,36 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.46.0-dev.
|
|
14
|
+
"version": "1.46.0-dev.cae84b66d5",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
|
-
"
|
|
18
|
+
"typescript": "./src/index.ts",
|
|
19
19
|
"types": "./lib/index.d.ts",
|
|
20
20
|
"import": "./lib/index.js"
|
|
21
21
|
},
|
|
22
22
|
"./block": {
|
|
23
|
-
"
|
|
23
|
+
"typescript": "./src/block/index.ts",
|
|
24
24
|
"types": "./lib/block/index.d.ts",
|
|
25
25
|
"import": "./lib/block/index.js"
|
|
26
26
|
},
|
|
27
27
|
"./epoch": {
|
|
28
|
-
"
|
|
28
|
+
"typescript": "./src/epoch/index.ts",
|
|
29
29
|
"types": "./lib/epoch/index.d.ts",
|
|
30
30
|
"import": "./lib/epoch/index.js"
|
|
31
31
|
},
|
|
32
32
|
"./slot": {
|
|
33
|
-
"
|
|
33
|
+
"typescript": "./src/slot/index.ts",
|
|
34
34
|
"types": "./lib/slot/index.d.ts",
|
|
35
35
|
"import": "./lib/slot/index.js"
|
|
36
36
|
},
|
|
37
37
|
"./light-client": {
|
|
38
|
-
"
|
|
38
|
+
"typescript": "./src/lightClient/spec/index.ts",
|
|
39
39
|
"types": "./lib/lightClient/spec/index.d.ts",
|
|
40
40
|
"import": "./lib/lightClient/spec/index.js"
|
|
41
41
|
},
|
|
42
42
|
"./test-utils": {
|
|
43
|
-
"
|
|
43
|
+
"typescript": "./src/testUtils/index.ts",
|
|
44
44
|
"types": "./lib/testUtils/index.d.ts",
|
|
45
45
|
"import": "./lib/testUtils/index.js"
|
|
46
46
|
}
|
|
@@ -71,14 +71,14 @@
|
|
|
71
71
|
"@chainsafe/pubkey-index-map": "^3.0.0",
|
|
72
72
|
"@chainsafe/ssz": "^1.6.2",
|
|
73
73
|
"@chainsafe/swap-or-not-shuffle": "^1.2.1",
|
|
74
|
-
"@lodestar/config": "^1.46.0-dev.
|
|
75
|
-
"@lodestar/params": "^1.46.0-dev.
|
|
76
|
-
"@lodestar/types": "^1.46.0-dev.
|
|
77
|
-
"@lodestar/utils": "^1.46.0-dev.
|
|
74
|
+
"@lodestar/config": "^1.46.0-dev.cae84b66d5",
|
|
75
|
+
"@lodestar/params": "^1.46.0-dev.cae84b66d5",
|
|
76
|
+
"@lodestar/types": "^1.46.0-dev.cae84b66d5",
|
|
77
|
+
"@lodestar/utils": "^1.46.0-dev.cae84b66d5",
|
|
78
78
|
"@vekexasia/bigint-buffer2": "^1.1.1"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@lodestar/api": "^1.46.0-dev.
|
|
81
|
+
"@lodestar/api": "^1.46.0-dev.cae84b66d5"
|
|
82
82
|
},
|
|
83
83
|
"keywords": [
|
|
84
84
|
"ethereum",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"beacon",
|
|
87
87
|
"blockchain"
|
|
88
88
|
],
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "7164c24ba58f9114c02126b9e040c4b6e49135eb"
|
|
90
90
|
}
|
package/src/block/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {ForkPostGloas, ForkSeq} from "@lodestar/params";
|
|
2
|
-
import {BeaconBlock, BlindedBeaconBlock, altair, capella} from "@lodestar/types";
|
|
2
|
+
import {BeaconBlock, BlindedBeaconBlock, Slot, altair, capella} from "@lodestar/types";
|
|
3
3
|
import {BeaconStateTransitionMetrics} from "../metrics.js";
|
|
4
4
|
import {
|
|
5
5
|
CachedBeaconStateAllForks,
|
|
@@ -86,8 +86,9 @@ export function processBlock(
|
|
|
86
86
|
processExecutionPayload(fork, state as CachedBeaconStateBellatrix, block.body, externalData);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
let parentSlot: Slot | null = null;
|
|
89
90
|
if (fork >= ForkSeq.gloas) {
|
|
90
|
-
processExecutionPayloadBid(
|
|
91
|
+
parentSlot = processExecutionPayloadBid(
|
|
91
92
|
state as CachedBeaconStateGloas,
|
|
92
93
|
(block as BeaconBlock<ForkPostGloas>).body.signedExecutionPayloadBid
|
|
93
94
|
);
|
|
@@ -95,7 +96,7 @@ export function processBlock(
|
|
|
95
96
|
|
|
96
97
|
processRandao(state, block, verifySignatures);
|
|
97
98
|
processEth1Data(state, block.body.eth1Data);
|
|
98
|
-
processOperations(fork, state, block.body, opts, metrics);
|
|
99
|
+
processOperations(fork, state, block.body, parentSlot, opts, metrics);
|
|
99
100
|
if (fork >= ForkSeq.altair) {
|
|
100
101
|
processSyncAggregate(state, block as altair.BeaconBlock, verifySignatures);
|
|
101
102
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {ForkSeq} from "@lodestar/params";
|
|
2
|
-
import {Attestation} from "@lodestar/types";
|
|
2
|
+
import {Attestation, Slot} from "@lodestar/types";
|
|
3
3
|
import {BeaconStateTransitionMetrics} from "../metrics.js";
|
|
4
4
|
import {CachedBeaconStateAllForks, CachedBeaconStateAltair, CachedBeaconStatePhase0} from "../types.js";
|
|
5
5
|
import {processAttestationPhase0} from "./processAttestationPhase0.js";
|
|
@@ -12,6 +12,7 @@ export function processAttestations(
|
|
|
12
12
|
fork: ForkSeq,
|
|
13
13
|
state: CachedBeaconStateAllForks,
|
|
14
14
|
attestations: Attestation[],
|
|
15
|
+
parentSlot: Slot | null,
|
|
15
16
|
verifySignatures = true,
|
|
16
17
|
metrics?: BeaconStateTransitionMetrics | null
|
|
17
18
|
): void {
|
|
@@ -20,6 +21,13 @@ export function processAttestations(
|
|
|
20
21
|
processAttestationPhase0(state as CachedBeaconStatePhase0, attestation, verifySignatures);
|
|
21
22
|
}
|
|
22
23
|
} else {
|
|
23
|
-
processAttestationsAltair(
|
|
24
|
+
processAttestationsAltair(
|
|
25
|
+
fork,
|
|
26
|
+
state as CachedBeaconStateAltair,
|
|
27
|
+
attestations,
|
|
28
|
+
parentSlot,
|
|
29
|
+
verifySignatures,
|
|
30
|
+
metrics
|
|
31
|
+
);
|
|
24
32
|
}
|
|
25
33
|
}
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
TIMELY_TARGET_WEIGHT,
|
|
15
15
|
WEIGHT_DENOMINATOR,
|
|
16
16
|
} from "@lodestar/params";
|
|
17
|
-
import {Attestation, Epoch, phase0} from "@lodestar/types";
|
|
17
|
+
import {Attestation, Epoch, Slot, phase0} from "@lodestar/types";
|
|
18
18
|
import {byteArrayEquals, intSqrt} from "@lodestar/utils";
|
|
19
19
|
import {BeaconStateTransitionMetrics} from "../metrics.js";
|
|
20
20
|
import {getAttestationWithIndicesSignatureSet} from "../signatureSets/indexedAttestation.js";
|
|
@@ -37,6 +37,7 @@ export function processAttestationsAltair(
|
|
|
37
37
|
fork: ForkSeq,
|
|
38
38
|
state: CachedBeaconStateAltair | CachedBeaconStateGloas,
|
|
39
39
|
attestations: Attestation[],
|
|
40
|
+
parentSlot: Slot | null,
|
|
40
41
|
verifySignature = true,
|
|
41
42
|
metrics?: BeaconStateTransitionMetrics | null
|
|
42
43
|
): void {
|
|
@@ -82,7 +83,8 @@ export function processAttestationsAltair(
|
|
|
82
83
|
stateSlot - data.slot,
|
|
83
84
|
epochCtx.epoch,
|
|
84
85
|
rootCache,
|
|
85
|
-
fork >= ForkSeq.gloas ? (state as CachedBeaconStateGloas).executionPayloadAvailability : null
|
|
86
|
+
fork >= ForkSeq.gloas ? (state as CachedBeaconStateGloas).executionPayloadAvailability : null,
|
|
87
|
+
parentSlot
|
|
86
88
|
);
|
|
87
89
|
|
|
88
90
|
// For each participant, update their participation
|
|
@@ -179,7 +181,8 @@ export function getAttestationParticipationStatus(
|
|
|
179
181
|
inclusionDelay: number,
|
|
180
182
|
currentEpoch: Epoch,
|
|
181
183
|
rootCache: RootCache,
|
|
182
|
-
executionPayloadAvailability: BitArray | null
|
|
184
|
+
executionPayloadAvailability: BitArray | null,
|
|
185
|
+
parentSlot: Slot | null
|
|
183
186
|
): {flags: number; isSameSlotAttestation: boolean} {
|
|
184
187
|
const justifiedCheckpoint =
|
|
185
188
|
data.target.epoch === currentEpoch ? rootCache.currentJustifiedCheckpoint : rootCache.previousJustifiedCheckpoint;
|
|
@@ -221,13 +224,16 @@ export function getAttestationParticipationStatus(
|
|
|
221
224
|
if (executionPayloadAvailability === null) {
|
|
222
225
|
throw new Error("Must supply executionPayloadAvailability post-gloas");
|
|
223
226
|
}
|
|
227
|
+
if (parentSlot === null) {
|
|
228
|
+
throw new Error("Must supply parentSlot post-gloas");
|
|
229
|
+
}
|
|
224
230
|
|
|
225
231
|
if (data.index !== 0 && data.index !== 1) {
|
|
226
232
|
throw new Error(`data index must be 0 or 1 index=${data.index}`);
|
|
227
233
|
}
|
|
228
234
|
|
|
229
235
|
isMatchingPayload =
|
|
230
|
-
Boolean(data.index) === executionPayloadAvailability.get(
|
|
236
|
+
Boolean(data.index) === executionPayloadAvailability.get(parentSlot % SLOTS_PER_HISTORICAL_ROOT);
|
|
231
237
|
}
|
|
232
238
|
|
|
233
239
|
isMatchingHead = isMatchingHead && isMatchingPayload;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {PublicKey, Signature, verify} from "@chainsafe/blst";
|
|
2
2
|
import {BUILDER_INDEX_SELF_BUILD, GENESIS_SLOT, PAYLOAD_BUILDER_VERSION, SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
3
|
-
import {gloas, ssz} from "@lodestar/types";
|
|
3
|
+
import {Slot, gloas, ssz} from "@lodestar/types";
|
|
4
4
|
import {byteArrayEquals, toHex, toRootHex} from "@lodestar/utils";
|
|
5
5
|
import {G2_POINT_AT_INFINITY} from "../constants/constants.js";
|
|
6
6
|
import {getExecutionPayloadBidSigningRoot} from "../signatureSets/executionPayloadBid.js";
|
|
@@ -11,7 +11,7 @@ import {getBlockRootAtSlot, getCurrentEpoch, getRandaoMix} from "../util/index.j
|
|
|
11
11
|
export function processExecutionPayloadBid(
|
|
12
12
|
state: CachedBeaconStateGloas,
|
|
13
13
|
signedBid: gloas.SignedExecutionPayloadBid
|
|
14
|
-
):
|
|
14
|
+
): Slot {
|
|
15
15
|
const bid = signedBid.message;
|
|
16
16
|
const {builderIndex, value: amount} = bid;
|
|
17
17
|
|
|
@@ -99,7 +99,10 @@ export function processExecutionPayloadBid(
|
|
|
99
99
|
state.builderPendingPayments.set(SLOTS_PER_EPOCH + (bid.slot % SLOTS_PER_EPOCH), pendingPaymentView);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
const parentSlot = state.latestExecutionPayloadBid.slot;
|
|
102
103
|
state.latestExecutionPayloadBid = ssz.gloas.ExecutionPayloadBid.toViewDU(bid);
|
|
104
|
+
|
|
105
|
+
return parentSlot;
|
|
103
106
|
}
|
|
104
107
|
|
|
105
108
|
function verifyExecutionPayloadBidSignature(
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
MAX_PROPOSER_SLASHINGS,
|
|
8
8
|
MAX_VOLUNTARY_EXITS,
|
|
9
9
|
} from "@lodestar/params";
|
|
10
|
-
import {BeaconBlockBody, capella, electra, gloas} from "@lodestar/types";
|
|
10
|
+
import {BeaconBlockBody, Slot, capella, electra, gloas} from "@lodestar/types";
|
|
11
11
|
import {BeaconStateTransitionMetrics} from "../metrics.js";
|
|
12
12
|
import {
|
|
13
13
|
CachedBeaconStateAllForks,
|
|
@@ -44,6 +44,7 @@ export function processOperations(
|
|
|
44
44
|
fork: ForkSeq,
|
|
45
45
|
state: CachedBeaconStateAllForks,
|
|
46
46
|
body: BeaconBlockBody,
|
|
47
|
+
parentSlot: Slot | null,
|
|
47
48
|
opts: ProcessBlockOpts = {verifySignatures: true},
|
|
48
49
|
metrics?: BeaconStateTransitionMetrics | null
|
|
49
50
|
): void {
|
|
@@ -67,7 +68,7 @@ export function processOperations(
|
|
|
67
68
|
processAttesterSlashing(fork, state, attesterSlashing, opts.verifySignatures);
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
processAttestations(fork, state, body.attestations, opts.verifySignatures, metrics);
|
|
71
|
+
processAttestations(fork, state, body.attestations, parentSlot, opts.verifySignatures, metrics);
|
|
71
72
|
|
|
72
73
|
for (const deposit of body.deposits) {
|
|
73
74
|
processDeposit(fork, state, deposit);
|
|
@@ -4,11 +4,17 @@ import {
|
|
|
4
4
|
WHISTLEBLOWER_REWARD_QUOTIENT,
|
|
5
5
|
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA,
|
|
6
6
|
isForkPostElectra,
|
|
7
|
+
isForkPostGloas,
|
|
7
8
|
} from "@lodestar/params";
|
|
8
|
-
import {BeaconBlock, altair, phase0, rewards} from "@lodestar/types";
|
|
9
|
+
import {BeaconBlock, Slot, altair, phase0, rewards} from "@lodestar/types";
|
|
9
10
|
import {processAttestationsAltair} from "../block/processAttestationsAltair.js";
|
|
10
11
|
import {RewardCache} from "../cache/rewardCache.js";
|
|
11
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
CachedBeaconStateAllForks,
|
|
14
|
+
CachedBeaconStateAltair,
|
|
15
|
+
CachedBeaconStateGloas,
|
|
16
|
+
CachedBeaconStatePhase0,
|
|
17
|
+
} from "../cache/stateCache.js";
|
|
12
18
|
import {getAttesterSlashableIndices} from "../util/attestation.js";
|
|
13
19
|
|
|
14
20
|
type SubRewardValue = number; // All reward values should be integer
|
|
@@ -36,10 +42,18 @@ export async function computeBlockRewards(
|
|
|
36
42
|
let syncAggregateReward = cachedSyncAggregateReward;
|
|
37
43
|
|
|
38
44
|
if (blockAttestationReward === 0) {
|
|
45
|
+
const parentSlot = isForkPostGloas(fork)
|
|
46
|
+
? (preState as CachedBeaconStateGloas).latestExecutionPayloadBid.slot
|
|
47
|
+
: null;
|
|
39
48
|
blockAttestationReward =
|
|
40
49
|
fork === ForkName.phase0
|
|
41
50
|
? computeBlockAttestationRewardPhase0(block as phase0.BeaconBlock, preState as CachedBeaconStatePhase0)
|
|
42
|
-
: computeBlockAttestationRewardAltair(
|
|
51
|
+
: computeBlockAttestationRewardAltair(
|
|
52
|
+
config,
|
|
53
|
+
block as altair.BeaconBlock,
|
|
54
|
+
preState as CachedBeaconStateAltair,
|
|
55
|
+
parentSlot
|
|
56
|
+
);
|
|
43
57
|
}
|
|
44
58
|
|
|
45
59
|
if (syncAggregateReward === 0) {
|
|
@@ -79,12 +93,13 @@ function computeBlockAttestationRewardPhase0(
|
|
|
79
93
|
function computeBlockAttestationRewardAltair(
|
|
80
94
|
config: BeaconConfig,
|
|
81
95
|
block: altair.BeaconBlock,
|
|
82
|
-
preState: CachedBeaconStateAltair
|
|
96
|
+
preState: CachedBeaconStateAltair,
|
|
97
|
+
parentSlot: Slot | null
|
|
83
98
|
): SubRewardValue {
|
|
84
99
|
const fork = config.getForkSeq(block.slot);
|
|
85
100
|
const {attestations} = block.body;
|
|
86
101
|
|
|
87
|
-
processAttestationsAltair(fork, preState, attestations, false);
|
|
102
|
+
processAttestationsAltair(fork, preState, attestations, parentSlot, false);
|
|
88
103
|
|
|
89
104
|
return preState.proposerRewards.attestations;
|
|
90
105
|
}
|
|
@@ -70,7 +70,7 @@ export function upgradeStateToGloas(stateFulu: CachedBeaconStateFulu): CachedBea
|
|
|
70
70
|
stateGloasView.currentSyncCommittee = stateGloasCloned.currentSyncCommittee;
|
|
71
71
|
stateGloasView.nextSyncCommittee = stateGloasCloned.nextSyncCommittee;
|
|
72
72
|
stateGloasView.latestExecutionPayloadBid.blockHash = stateFulu.latestExecutionPayloadHeader.blockHash;
|
|
73
|
-
stateGloasView.latestExecutionPayloadBid.gasLimit = stateFulu.latestExecutionPayloadHeader.gasLimit;
|
|
73
|
+
stateGloasView.latestExecutionPayloadBid.gasLimit = BigInt(stateFulu.latestExecutionPayloadHeader.gasLimit);
|
|
74
74
|
stateGloasView.latestExecutionPayloadBid.executionRequestsRoot = ssz.gloas.ExecutionRequests.hashTreeRoot(
|
|
75
75
|
ssz.gloas.ExecutionRequests.defaultValue()
|
|
76
76
|
);
|