From 3136bd24b375a0d2588c412b72d0b055f69153b3 Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Fri, 4 Oct 2024 02:41:49 +0200 Subject: [PATCH] t8n: do not create empty coinbase account from SpuriousDragon on state.reward == 0 (#3720) * t8n: do not create empty coinbase account from SpuriousDragon on state.reward == 0 * update t8ntool releated readmes * make cspell happy * await cleanup --- packages/vm/DEVELOPER.md | 4 ++++ packages/vm/test/t8n/README.md | 4 ++++ packages/vm/test/t8n/t8ntool.ts | 1 + 3 files changed, 9 insertions(+) diff --git a/packages/vm/DEVELOPER.md b/packages/vm/DEVELOPER.md index 874afc761c..f2e9da6ac5 100644 --- a/packages/vm/DEVELOPER.md +++ b/packages/vm/DEVELOPER.md @@ -217,3 +217,7 @@ npm run profiling -- mainnetBlocks:10 and open the link it generates. For a high-level introduction on flame graphs see e.g. [this](https://blog.codecentric.de/en/2017/09/jvm-fire-using-flame-graphs-analyse-performance/) blog article (the non-Java part). + +## T8NTool: fill `execution-spec-tests` tests and write those + +The VM has t8ntool (transition-tool) support, see: . This tool can be used to create fixtures from the `execution-spec-tests` repo. These fixtures can be consumed by other clients in their test runner (similar to running `npm run test:blockchain` or `npm run test:state` in the VM package). The t8ntool readme also links to a guide on how to write tests to contribute to `execution-spec-tests`. diff --git a/packages/vm/test/t8n/README.md b/packages/vm/test/t8n/README.md index 30ec38e9f3..f98a486d23 100644 --- a/packages/vm/test/t8n/README.md +++ b/packages/vm/test/t8n/README.md @@ -38,3 +38,7 @@ Processing new transaction... address: '0x0000000000000000000000000000000000001000' } ``` + +## Writing a test in execution-spec-test + +This issue comment is a good reference to write tests, together with an example: diff --git a/packages/vm/test/t8n/t8ntool.ts b/packages/vm/test/t8n/t8ntool.ts index 6696da5b17..52d9cae6cb 100644 --- a/packages/vm/test/t8n/t8ntool.ts +++ b/packages/vm/test/t8n/t8ntool.ts @@ -113,6 +113,7 @@ export class TransitionTool { if (args.state.reward !== BigInt(-1)) { await rewardAccount(this.vm.evm, block.header.coinbase, args.state.reward, this.vm.common) + await this.vm.evm.journal.cleanup() } const result = await builder.build()