proto-kit / framework

Apache License 2.0
28 stars 10 forks source link

Multiple transactions in single block errors with `MerkleWitness not valid for StateTransition` #51

Closed teddyjfpender closed 1 year ago

teddyjfpender commented 1 year ago

Describe the bug When sending many transactions to an app-chain & then producing a block the test errors with:

test/Balances.test.ts:
Block Production time: 1696 milliseconds
111 |         if (response.taskId !== undefined) {
112 |             const resolveFunction = this.resultsPending[response.taskId];
113 |             if (!this.erroredOut) {
114 |                 if (response.status === "error") {
115 |                     this.erroredOut = true;
116 |                     this.errorFunction?.(new Error(`Error in worker: ${response.payload}`));
                                            ^
error: Error in worker: MerkleWitness not valid for StateTransition (0, type normal)
Bool.assertTrue(): false != true

I came across this error in both bun and npm.

To Reproduce Steps to reproduce the behavior:

  1. Go to bun bug repository or the npm bug repository
  2. Run the tests (bun install && bun test or npm test)
  3. See error

Expected behavior When sending multiple transactions to the app-chain it should produce a block and not error.

Additional context Add any other context about the problem here.

rpanic commented 1 year ago

Thanks for the report and the easy reproduction example!

rpanic commented 1 year ago

Fixed in #54