@aztec/world-state 0.0.1-commit.b6e433891 → 0.0.1-commit.b9865e97
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/dest/instrumentation/instrumentation.d.ts +4 -3
- package/dest/instrumentation/instrumentation.d.ts.map +1 -1
- package/dest/instrumentation/instrumentation.js +4 -9
- package/dest/native/ipc_world_state_instance.d.ts +87 -0
- package/dest/native/ipc_world_state_instance.d.ts.map +1 -0
- package/dest/native/ipc_world_state_instance.js +660 -0
- package/dest/native/merkle_trees_facade.d.ts +8 -4
- package/dest/native/merkle_trees_facade.d.ts.map +1 -1
- package/dest/native/merkle_trees_facade.js +60 -115
- package/dest/native/message.d.ts +14 -230
- package/dest/native/message.d.ts.map +1 -1
- package/dest/native/message.js +0 -42
- package/dest/native/native_world_state.d.ts +19 -7
- package/dest/native/native_world_state.d.ts.map +1 -1
- package/dest/native/native_world_state.js +113 -58
- package/dest/native/native_world_state_instance.d.ts +58 -41
- package/dest/native/native_world_state_instance.d.ts.map +1 -1
- package/dest/native/native_world_state_instance.js +5 -202
- package/dest/native/world_state_operation.d.ts +7 -0
- package/dest/native/world_state_operation.d.ts.map +1 -0
- package/dest/native/world_state_operation.js +5 -0
- package/dest/synchronizer/config.d.ts +1 -1
- package/dest/synchronizer/config.d.ts.map +1 -1
- package/dest/synchronizer/config.js +9 -10
- package/dest/synchronizer/factory.d.ts +4 -4
- package/dest/synchronizer/factory.d.ts.map +1 -1
- package/dest/synchronizer/factory.js +7 -6
- package/dest/synchronizer/server_world_state_synchronizer.d.ts +1 -1
- package/dest/synchronizer/server_world_state_synchronizer.d.ts.map +1 -1
- package/dest/synchronizer/server_world_state_synchronizer.js +26 -11
- package/dest/testing.d.ts +4 -3
- package/dest/testing.d.ts.map +1 -1
- package/dest/testing.js +10 -6
- package/package.json +14 -10
- package/src/instrumentation/instrumentation.ts +6 -18
- package/src/native/ipc_world_state_instance.ts +830 -0
- package/src/native/merkle_trees_facade.ts +85 -112
- package/src/native/message.ts +13 -297
- package/src/native/native_world_state.ts +129 -97
- package/src/native/native_world_state_instance.ts +96 -280
- package/src/native/world_state_operation.ts +33 -0
- package/src/synchronizer/config.ts +14 -10
- package/src/synchronizer/factory.ts +11 -10
- package/src/synchronizer/server_world_state_synchronizer.ts +17 -13
- package/src/testing.ts +8 -9
- package/dest/native/world_state_ops_queue.d.ts +0 -19
- package/dest/native/world_state_ops_queue.d.ts.map +0 -1
- package/dest/native/world_state_ops_queue.js +0 -146
- package/src/native/world_state_ops_queue.ts +0 -190
|
@@ -10,24 +10,12 @@ import {
|
|
|
10
10
|
createUpDownCounterWithDefault,
|
|
11
11
|
} from '@aztec/telemetry-client';
|
|
12
12
|
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
type TreeDBStats,
|
|
16
|
-
type TreeMeta,
|
|
17
|
-
WorldStateMessageType,
|
|
18
|
-
type WorldStateStatusFull,
|
|
19
|
-
} from '../native/message.js';
|
|
13
|
+
import type { DBStats, TreeDBStats, TreeMeta, WorldStateStatusFull } from '../native/message.js';
|
|
14
|
+
import type { WorldStateOperationName } from '../native/world_state_operation.js';
|
|
20
15
|
|
|
21
16
|
type DBTypeString = 'leaf_preimage' | 'leaf_indices' | 'nodes' | 'blocks' | 'block_indices';
|
|
22
17
|
|
|
23
|
-
const durationTrackDenylist = new Set<
|
|
24
|
-
WorldStateMessageType.GET_INITIAL_STATE_REFERENCE,
|
|
25
|
-
WorldStateMessageType.CLOSE,
|
|
26
|
-
|
|
27
|
-
// these aren't used anymore, should be removed from the API
|
|
28
|
-
WorldStateMessageType.COMMIT,
|
|
29
|
-
WorldStateMessageType.ROLLBACK,
|
|
30
|
-
]);
|
|
18
|
+
const durationTrackDenylist = new Set<WorldStateOperationName>(['getInitialStateReference']);
|
|
31
19
|
|
|
32
20
|
export class WorldStateInstrumentation {
|
|
33
21
|
private dbMapSize: Gauge;
|
|
@@ -144,10 +132,10 @@ export class WorldStateInstrumentation {
|
|
|
144
132
|
);
|
|
145
133
|
}
|
|
146
134
|
|
|
147
|
-
public recordRoundTrip(timeUs: number,
|
|
148
|
-
if (!durationTrackDenylist.has(
|
|
135
|
+
public recordRoundTrip(timeUs: number, operation: WorldStateOperationName) {
|
|
136
|
+
if (!durationTrackDenylist.has(operation)) {
|
|
149
137
|
this.requestHistogram.record(Math.ceil(timeUs), {
|
|
150
|
-
[Attributes.WORLD_STATE_REQUEST_TYPE]:
|
|
138
|
+
[Attributes.WORLD_STATE_REQUEST_TYPE]: operation,
|
|
151
139
|
});
|
|
152
140
|
}
|
|
153
141
|
}
|