Skip to content

Commit 6f321b0

Browse files
committed
sim-rs: small change to save a lot of space in the traces
1 parent 49e1edd commit 6f321b0

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

sim-rs/sim-cli/src/events/aggregate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ impl TraceAggregator {
203203
praos_tx_on_chain: self.praos_txs.len() as u64,
204204
leios_tx_on_chain: self.leios_txs.len() as u64,
205205
},
206-
blocks: self.rbs.clone(),
206+
blocks: std::mem::take(&mut self.rbs),
207207
last_nodes_updated: nodes_updated.into_iter().collect(),
208208
}
209209
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:3b0813a4d25ac058094aef29f239516d630e6102ad2110dd804da20baa5ab130
3-
size 41411375
2+
oid sha256:1281503935998e956789bec2e61118220295f3adb2739042dbd83477480ad6a0
3+
size 14666871
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:3116671101c4931ff5751f0c78d7e21b42f017cfe8cb117fdb08ec70abe290af
3-
size 17066881
2+
oid sha256:5d759f81fccbf40834de524276ac54d2745c5d22ee011bcedc8fc17a70732300
3+
size 12704902
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:05fa7960e2a4c61e2ba15a0dd63542347308db6dcecd6204090aca6fc2be78d8
3-
size 10128398
2+
oid sha256:3f5a2c6ebf733d1a73e871f011b2925de39a98a38e3e7f0cfba645eb3070b563
3+
size 8610186

ui/src/components/Sim/hooks/worker.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ISimulationAggregatedDataState, ISimulationIntermediateDataState } from '@/contexts/SimContext/types';
1+
import { ISimulationAggregatedDataState, ISimulationBlock, ISimulationIntermediateDataState } from '@/contexts/SimContext/types';
22
import * as cbor from 'cborg';
33
import type { ReadableStream } from 'stream/web';
44
import { IServerMessage } from '../types';
@@ -140,12 +140,15 @@ const consumeAggregateStream = async (
140140
speedMultiplier: number,
141141
) => {
142142
let lastTimestamp = 0;
143+
let blocks: ISimulationBlock[] = [];
143144
for await (const aggregatedData of stream) {
144145
const nodes = new Map();
145146
for (const [id, stats] of Object.entries(aggregatedData.nodes)) {
146147
nodes.set(id, stats);
147148
}
148149
aggregatedData.nodes = nodes;
150+
blocks.push(...aggregatedData.blocks);
151+
aggregatedData.blocks = blocks;
149152

150153
const elapsedMs = (aggregatedData.progress - lastTimestamp) * 1000;
151154
lastTimestamp = aggregatedData.progress;

0 commit comments

Comments
 (0)