@aztec/archiver 0.0.1-commit.e588bc7e5 → 0.0.1-commit.e5a3663dd
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/archiver.d.ts +19 -11
- package/dest/archiver.d.ts.map +1 -1
- package/dest/archiver.js +96 -53
- package/dest/config.d.ts +3 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +14 -3
- package/dest/errors.d.ts +32 -5
- package/dest/errors.d.ts.map +1 -1
- package/dest/errors.js +51 -6
- package/dest/factory.d.ts +4 -4
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +13 -10
- package/dest/index.d.ts +10 -3
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +9 -2
- package/dest/l1/calldata_retriever.d.ts +2 -1
- package/dest/l1/calldata_retriever.d.ts.map +1 -1
- package/dest/l1/calldata_retriever.js +9 -4
- package/dest/l1/data_retrieval.d.ts +18 -9
- package/dest/l1/data_retrieval.d.ts.map +1 -1
- package/dest/l1/data_retrieval.js +13 -19
- package/dest/l1/validate_historical_logs.d.ts +23 -0
- package/dest/l1/validate_historical_logs.d.ts.map +1 -0
- package/dest/l1/validate_historical_logs.js +108 -0
- package/dest/modules/contract_data_source_adapter.d.ts +25 -0
- package/dest/modules/contract_data_source_adapter.d.ts.map +1 -0
- package/dest/modules/contract_data_source_adapter.js +42 -0
- package/dest/modules/data_source_base.d.ts +16 -10
- package/dest/modules/data_source_base.d.ts.map +1 -1
- package/dest/modules/data_source_base.js +71 -60
- package/dest/modules/data_store_updater.d.ts +16 -9
- package/dest/modules/data_store_updater.d.ts.map +1 -1
- package/dest/modules/data_store_updater.js +52 -40
- package/dest/modules/instrumentation.d.ts +7 -2
- package/dest/modules/instrumentation.d.ts.map +1 -1
- package/dest/modules/instrumentation.js +22 -6
- package/dest/modules/l1_synchronizer.d.ts +8 -4
- package/dest/modules/l1_synchronizer.d.ts.map +1 -1
- package/dest/modules/l1_synchronizer.js +212 -79
- package/dest/modules/validation.d.ts +4 -3
- package/dest/modules/validation.d.ts.map +1 -1
- package/dest/modules/validation.js +4 -4
- package/dest/store/block_store.d.ts +60 -21
- package/dest/store/block_store.d.ts.map +1 -1
- package/dest/store/block_store.js +229 -70
- package/dest/store/contract_class_store.d.ts +17 -3
- package/dest/store/contract_class_store.d.ts.map +1 -1
- package/dest/store/contract_class_store.js +17 -1
- package/dest/store/contract_instance_store.d.ts +28 -1
- package/dest/store/contract_instance_store.d.ts.map +1 -1
- package/dest/store/contract_instance_store.js +31 -0
- package/dest/store/data_stores.d.ts +68 -0
- package/dest/store/data_stores.d.ts.map +1 -0
- package/dest/store/data_stores.js +50 -0
- package/dest/store/function_names_cache.d.ts +17 -0
- package/dest/store/function_names_cache.d.ts.map +1 -0
- package/dest/store/function_names_cache.js +30 -0
- package/dest/store/l2_tips_cache.d.ts +1 -1
- package/dest/store/l2_tips_cache.d.ts.map +1 -1
- package/dest/store/l2_tips_cache.js +3 -3
- package/dest/store/log_store.d.ts +1 -1
- package/dest/store/log_store.d.ts.map +1 -1
- package/dest/store/log_store.js +2 -4
- package/dest/store/message_store.d.ts +9 -3
- package/dest/store/message_store.d.ts.map +1 -1
- package/dest/store/message_store.js +31 -1
- package/dest/test/fake_l1_state.d.ts +14 -3
- package/dest/test/fake_l1_state.d.ts.map +1 -1
- package/dest/test/fake_l1_state.js +55 -15
- package/dest/test/mock_l2_block_source.d.ts +12 -3
- package/dest/test/mock_l2_block_source.d.ts.map +1 -1
- package/dest/test/mock_l2_block_source.js +24 -2
- package/dest/test/noop_l1_archiver.d.ts +4 -4
- package/dest/test/noop_l1_archiver.d.ts.map +1 -1
- package/dest/test/noop_l1_archiver.js +9 -7
- package/package.json +13 -13
- package/src/archiver.ts +113 -52
- package/src/config.ts +15 -1
- package/src/errors.ts +75 -8
- package/src/factory.ts +11 -10
- package/src/index.ts +17 -2
- package/src/l1/calldata_retriever.ts +15 -4
- package/src/l1/data_retrieval.ts +30 -35
- package/src/l1/validate_historical_logs.ts +140 -0
- package/src/modules/contract_data_source_adapter.ts +59 -0
- package/src/modules/data_source_base.ts +75 -57
- package/src/modules/data_store_updater.ts +71 -39
- package/src/modules/instrumentation.ts +27 -7
- package/src/modules/l1_synchronizer.ts +301 -83
- package/src/modules/validation.ts +8 -7
- package/src/store/block_store.ts +264 -77
- package/src/store/contract_class_store.ts +28 -2
- package/src/store/contract_instance_store.ts +43 -0
- package/src/store/data_stores.ts +108 -0
- package/src/store/function_names_cache.ts +37 -0
- package/src/store/l2_tips_cache.ts +9 -3
- package/src/store/log_store.ts +2 -5
- package/src/store/message_store.ts +35 -2
- package/src/test/fake_l1_state.ts +62 -24
- package/src/test/mock_l2_block_source.ts +23 -2
- package/src/test/noop_l1_archiver.ts +9 -7
- package/dest/store/kv_archiver_store.d.ts +0 -377
- package/dest/store/kv_archiver_store.d.ts.map +0 -1
- package/dest/store/kv_archiver_store.js +0 -494
- package/src/store/kv_archiver_store.ts +0 -713
|
@@ -32,6 +32,7 @@ export class ArchiverInstrumentation {
|
|
|
32
32
|
private pruneCount: UpDownCounter;
|
|
33
33
|
|
|
34
34
|
private syncDurationPerBlock: Histogram;
|
|
35
|
+
private syncDurationPerCheckpoint: Histogram;
|
|
35
36
|
private syncBlockCount: UpDownCounter;
|
|
36
37
|
private manaPerBlock: Histogram;
|
|
37
38
|
private txsPerBlock: Histogram;
|
|
@@ -42,6 +43,7 @@ export class ArchiverInstrumentation {
|
|
|
42
43
|
private blockProposalTxTargetCount: UpDownCounter;
|
|
43
44
|
|
|
44
45
|
private checkpointL1InclusionDelay: Histogram;
|
|
46
|
+
private checkpointPromotedCount: UpDownCounter;
|
|
45
47
|
|
|
46
48
|
private log = createLogger('archiver:instrumentation');
|
|
47
49
|
|
|
@@ -68,6 +70,8 @@ export class ArchiverInstrumentation {
|
|
|
68
70
|
|
|
69
71
|
this.syncDurationPerBlock = meter.createHistogram(Metrics.ARCHIVER_SYNC_PER_BLOCK);
|
|
70
72
|
|
|
73
|
+
this.syncDurationPerCheckpoint = meter.createHistogram(Metrics.ARCHIVER_SYNC_PER_CHECKPOINT);
|
|
74
|
+
|
|
71
75
|
this.syncBlockCount = createUpDownCounterWithDefault(meter, Metrics.ARCHIVER_SYNC_BLOCK_COUNT);
|
|
72
76
|
|
|
73
77
|
this.manaPerBlock = meter.createHistogram(Metrics.ARCHIVER_MANA_PER_BLOCK);
|
|
@@ -92,6 +96,8 @@ export class ArchiverInstrumentation {
|
|
|
92
96
|
|
|
93
97
|
this.checkpointL1InclusionDelay = meter.createHistogram(Metrics.ARCHIVER_CHECKPOINT_L1_INCLUSION_DELAY);
|
|
94
98
|
|
|
99
|
+
this.checkpointPromotedCount = createUpDownCounterWithDefault(meter, Metrics.ARCHIVER_CHECKPOINT_PROMOTED_COUNT);
|
|
100
|
+
|
|
95
101
|
this.dbMetrics = new LmdbMetrics(
|
|
96
102
|
meter,
|
|
97
103
|
{
|
|
@@ -113,17 +119,26 @@ export class ArchiverInstrumentation {
|
|
|
113
119
|
return this.telemetry.isEnabled();
|
|
114
120
|
}
|
|
115
121
|
|
|
116
|
-
public
|
|
122
|
+
public processNewProposedBlock(syncTimePerBlock: number, block: L2Block) {
|
|
123
|
+
const attrs = { [Attributes.STATUS]: 'proposed' };
|
|
124
|
+
this.blockHeight.record(block.number, attrs);
|
|
117
125
|
this.syncDurationPerBlock.record(Math.ceil(syncTimePerBlock));
|
|
126
|
+
|
|
127
|
+
// Per block metrics
|
|
128
|
+
this.txCount.add(block.body.txEffects.length);
|
|
129
|
+
this.txsPerBlock.record(block.body.txEffects.length);
|
|
130
|
+
this.manaPerBlock.record(block.header.totalManaUsed.toNumber() / 1e6);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
public processNewCheckpointedBlocks(syncTimePerCheckpoint: number, blocks: L2Block[]) {
|
|
134
|
+
if (blocks.length === 0) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
this.syncDurationPerCheckpoint.record(Math.ceil(syncTimePerCheckpoint));
|
|
118
139
|
this.blockHeight.record(Math.max(...blocks.map(b => b.number)));
|
|
119
140
|
this.checkpointHeight.record(Math.max(...blocks.map(b => b.checkpointNumber)));
|
|
120
141
|
this.syncBlockCount.add(blocks.length);
|
|
121
|
-
|
|
122
|
-
for (const block of blocks) {
|
|
123
|
-
this.txCount.add(block.body.txEffects.length);
|
|
124
|
-
this.txsPerBlock.record(block.body.txEffects.length);
|
|
125
|
-
this.manaPerBlock.record(block.header.totalManaUsed.toNumber() / 1e6);
|
|
126
|
-
}
|
|
127
142
|
}
|
|
128
143
|
|
|
129
144
|
public processNewMessages(count: number, syncPerMessageMs: number) {
|
|
@@ -169,6 +184,11 @@ export class ArchiverInstrumentation {
|
|
|
169
184
|
});
|
|
170
185
|
}
|
|
171
186
|
|
|
187
|
+
/** Records a checkpoint promoted from proposed (blob fetch skipped). */
|
|
188
|
+
public processCheckpointPromoted() {
|
|
189
|
+
this.checkpointPromotedCount.add(1);
|
|
190
|
+
}
|
|
191
|
+
|
|
172
192
|
/**
|
|
173
193
|
* Records L1 inclusion timing for a checkpoint observed on L1 (seconds into the L2 slot).
|
|
174
194
|
*/
|