Skip to content

Commit

Permalink
t8n: do not create empty coinbase account from SpuriousDragon on stat…
Browse files Browse the repository at this point in the history
…e.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
  • Loading branch information
jochem-brouwer authored Oct 4, 2024
1 parent b3ff2bc commit 3136bd2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vm/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/test/t8n/README.md>. 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`.
4 changes: 4 additions & 0 deletions packages/vm/test/t8n/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://github.com/ethereumjs/ethereumjs-monorepo/issues/3666#issuecomment-2349611424>
1 change: 1 addition & 0 deletions packages/vm/test/t8n/t8ntool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3136bd2

Please sign in to comment.