Skip to content

Commit cd55c79

Browse files
committed
Resolved merge problems
1 parent b9b3f78 commit cd55c79

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

packages/sequencer/src/protocol/production/sequencing/BlockProducerModule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export class BlockProducerModule extends SequencerModule<BlockConfig> {
109109

110110
public async generateMetadata(block: Block): Promise<BlockResult> {
111111
const { result, blockHashTreeStore, treeStore } =
112-
await this.executionService.generateMetadataForNextBlock(
112+
await this.resultService.generateMetadataForNextBlock(
113113
block,
114114
this.unprovenMerkleStore,
115115
this.blockTreeStore

packages/sequencer/src/protocol/production/sequencing/BlockResultService.ts

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ export class BlockResultService {
7272
merkleTreeStore: AsyncMerkleTreeStore,
7373
blockHashTreeStore: AsyncMerkleTreeStore,
7474
modifyTreeStore = true
75-
): Promise<BlockResult> {
75+
): Promise<{
76+
result: BlockResult;
77+
treeStore: CachedMerkleTreeStore;
78+
blockHashTreeStore: CachedMerkleTreeStore;
79+
}> {
7680
const combinedDiff = createCombinedStateDiff(block.transactions);
7781

7882
const inMemoryStore = new CachedMerkleTreeStore(merkleTreeStore);
@@ -138,22 +142,21 @@ export class BlockResultService {
138142
);
139143
const blockHashWitness = blockHashTree.getWitness(block.height.toBigInt());
140144
const newBlockHashRoot = blockHashTree.getRoot();
141-
await blockHashInMemoryStore.mergeIntoParent();
142-
143-
if (modifyTreeStore) {
144-
await inMemoryStore.mergeIntoParent();
145-
}
146145

147146
return {
148-
afterNetworkState: methodResult,
149-
stateRoot: stateRoot.toBigInt(),
150-
blockHashRoot: newBlockHashRoot.toBigInt(),
151-
blockHashWitness,
152-
153-
blockStateTransitions: stateTransitions.map((st) =>
154-
UntypedStateTransition.fromStateTransition(st)
155-
),
156-
blockHash: block.hash.toBigInt(),
147+
result: {
148+
afterNetworkState: methodResult,
149+
stateRoot: stateRoot.toBigInt(),
150+
blockHashRoot: newBlockHashRoot.toBigInt(),
151+
blockHashWitness,
152+
153+
blockStateTransitions: stateTransitions.map((st) =>
154+
UntypedStateTransition.fromStateTransition(st)
155+
),
156+
blockHash: block.hash.toBigInt(),
157+
},
158+
treeStore: inMemoryStore,
159+
blockHashTreeStore: blockHashInMemoryStore,
157160
};
158161
}
159162
}

0 commit comments

Comments
 (0)