Merge branch 'main' of github.com:hyperledger/besu into TransactionValidatorService

TransactionValidatorService
Stefan 1 year ago
commit 4d35285ffa
  1. 20
      CHANGELOG.md
  2. 7
      besu/src/test/java/org/hyperledger/besu/ForkIdsNetworkConfigTest.java
  3. 22
      build.gradle
  4. 369
      config/src/main/resources/holesky.json
  5. 36
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/TransactionTracer.java
  6. 14
      ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java
  7. 3
      ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java
  8. 3
      ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nSubCommand.java
  9. 2
      ethereum/referencetests/build.gradle
  10. 45
      ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java
  11. 2
      ethereum/referencetests/src/reference-test/external-resources
  12. 3
      ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/vm/BlockchainReferenceTestTools.java
  13. 57
      evm/src/main/java/org/hyperledger/besu/evm/tracing/StandardJsonTracer.java
  14. 68
      evm/src/test/java/org/hyperledger/besu/evm/StandardJsonTracerTest.java
  15. 9
      evm/src/test/java/org/hyperledger/besu/evm/toy/EvmToyCommand.java
  16. 2
      gradle.properties
  17. 66
      gradle/verification-metadata.xml
  18. 2
      gradle/versions.gradle
  19. 8
      services/kvstore/src/main/java/org/hyperledger/besu/services/kvstore/InMemoryKeyValueStorage.java
  20. 3
      services/kvstore/src/main/java/org/hyperledger/besu/services/kvstore/LayeredKeyValueStorage.java
  21. 16
      services/kvstore/src/main/java/org/hyperledger/besu/services/kvstore/SegmentedInMemoryKeyValueStorage.java

@ -1,8 +1,17 @@
# Changelog
## 23.7.3
## Next release
### Breaking Changes
### Additions and Improvements
- Add access to an immutable world view to start/end transaction hooks in the tracing API[#5836](https://github.com/hyperledger/besu/pull/5836)
### Bug Fixes
### Download Links
## 23.7.3
### Breaking Changes
- Removed support for Kotti network (ETC) [#5816](https://github.com/hyperledger/besu/pull/5816)
@ -11,12 +20,14 @@
- `--Xlayered-tx-pool-layer-max-capacity`, `--Xlayered-tx-pool-max-prioritized` and `--Xlayered-tx-pool-max-future-by-sender` just drop the `X` and keep the same behavior
### Additions and Improvements
- Add access to an immutable world view to start/end transaction hooks in the tracing API[#5836](https://github.com/hyperledger/besu/pull/5836)
- Layered transaction pool implementation is now stable and enabled by default. If you want still to use the legacy implementation, use `--tx-pool=legacy` [#5772](https://github.com/hyperledger/besu)
- Tune G1GC to reduce Besu memory footprint, and new `besu-untuned` start scripts to run without any specific G1GC flags [#5879](https://github.com/hyperledger/besu/pull/5879)
- Update Holešky config for re-launch [#5890](https://github.com/hyperledger/besu/pull/5890)
### Bug Fixes
- do not create ignorable storage on revert storage-variables subcommand [#5830](https://github.com/hyperledger/besu/pull/5830)
- fix duplicate key errors in EthScheduler-Transactions [#5857](https://github.com/hyperledger/besu/pull/5857)
- do not create ignorable storage on revert storage-variables subcommand [#5830](https://github.com/hyperledger/besu/pull/5830)
### Download Links
@ -44,7 +55,8 @@
- Fixing snapsync issue with forest during the heal step [#5776](https://github.com/hyperledger/besu/pull/5776)
### Download Links
https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/23.7.2/besu-23.7.2.tar.gz / sha256: f74b32c1a343cbad90a88aa59276b4c5eefea4643ee542aba2bbf898f85ae242
https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/23.7.2/besu-23.7.2.zip / sha256: a233c83591fc277e3d1530c84bb5ea896abad717d796b5e3b856c79199132b75
## 23.7.1

@ -84,10 +84,9 @@ public class ForkIdsNetworkConfigTest {
new Object[] {
NetworkName.HOLESKY,
List.of(
new ForkId(Bytes.ofUnsignedInt(0xa200f558L), 1694790240L),
new ForkId(Bytes.ofUnsignedInt(0x840a3b53L), 2000000000L),
new ForkId(Bytes.ofUnsignedInt(0x30771f90), 0L),
new ForkId(Bytes.ofUnsignedInt(0x30771f90), 0L))
new ForkId(Bytes.ofUnsignedInt(0xc61a6098L), 1696000704L),
new ForkId(Bytes.ofUnsignedInt(0xfd4f016bL), 0L),
new ForkId(Bytes.ofUnsignedInt(0xfd4f016bL), 0L))
},
new Object[] {
NetworkName.GOERLI,

@ -551,6 +551,22 @@ def tweakStartScript(createScriptTask) {
}
startScripts {
defaultJvmOpts = applicationDefaultJvmArgs + [
"-XX:G1ConcRefinementThreads=2",
"-XX:G1HeapWastePercent=15",
"-XX:MaxGCPauseMillis=100"
]
unixStartScriptGenerator.template = resources.text.fromFile("${projectDir}/besu/src/main/scripts/unixStartScript.txt")
windowsStartScriptGenerator.template = resources.text.fromFile("${projectDir}/besu/src/main/scripts/windowsStartScript.txt")
doLast { tweakStartScript(startScripts) }
}
task untunedStartScripts(type: CreateStartScripts) {
mainClass = 'org.hyperledger.besu.Besu'
classpath = startScripts.classpath
outputDir = startScripts.outputDir
applicationName = 'besu-untuned'
defaultJvmOpts = applicationDefaultJvmArgs
unixStartScriptGenerator.template = resources.text.fromFile("${projectDir}/besu/src/main/scripts/unixStartScript.txt")
windowsStartScriptGenerator.template = resources.text.fromFile("${projectDir}/besu/src/main/scripts/windowsStartScript.txt")
doLast { tweakStartScript(startScripts) }
@ -587,10 +603,10 @@ task autocomplete(type: JavaExec) {
}
}
installDist { dependsOn checkLicenses, evmToolStartScripts }
installDist { dependsOn checkLicenses, untunedStartScripts, evmToolStartScripts }
distTar {
dependsOn checkLicenses, autocomplete, evmToolStartScripts
dependsOn checkLicenses, autocomplete, untunedStartScripts, evmToolStartScripts
doFirst {
delete fileTree(dir: 'build/distributions', include: '*.tar.gz')
}
@ -599,7 +615,7 @@ distTar {
}
distZip {
dependsOn checkLicenses, autocomplete, evmToolStartScripts
dependsOn checkLicenses, autocomplete, untunedStartScripts, evmToolStartScripts
doFirst {
delete fileTree(dir: 'build/distributions', include: '*.zip')
}

@ -13,9 +13,8 @@
"londonBlock": 0,
"preMergeForkBlock": 0,
"terminalTotalDifficulty": 0,
"shanghaiTime": 1694790240,
"shanghaiTime": 1696000704,
"ethash": {},
"cancunTime": 2000000000,
"discovery": {
"bootnodes": [
"enode://ac906289e4b7f12df423d654c5a962b6ebe5b3a74cc9e06292a85221f9a64a6f1cfdd6b714ed6dacef51578f92b34c60ee91e9ede9c7f8fadc4d347326d95e2b@146.190.13.128:30303",
@ -827,196 +826,196 @@
"0x000000000000000000000000000000000000000000000000000000000000003e": "0x8869ff2c22b28cc10510d9853292803328be4fb0e80495e8bb8d271f5b889636",
"0x000000000000000000000000000000000000000000000000000000000000003f": "0xb5fe28e79f1b850f8658246ce9b6a1e7b49fc06db7143e8fe0b4f2b0c5523a5c",
"0x0000000000000000000000000000000000000000000000000000000000000040": "0x985e929f70af28d0bdd1a90a808f977f597c7c778c489e98d3bd8910d31ac0f7"
},
"0x0000006916a87b82333f4245046623b23794C65C": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x0be949928Ff199c9EBA9E110db210AA5C94EFAd0": {
"balance": "0x7c13bc4b2c133c56000000"
},
"0x0C100000006d7b5e23a1eAEE637f28cA32Cd5b31": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x0C35317B7a96C454E2CB3d1A255D775Ab112cCc8": {
"balance": "0xd3c21bcecceda1000000"
},
"0x0d731cfabC5574329823F26d488416451d2ea376": {
"balance": "0xd3c21bcecceda1000000"
},
"0x0e79065B5F11b5BD1e62B935A600976ffF3754B9": {
"balance": "0xd3c21bcecceda1000000"
},
"0x105083929bF9bb22C26cB1777Ec92661170D4285": {
"balance": "0xd3c21bcecceda1000000"
},
"0x10F5d45854e038071485AC9e402308cF80D2d2fE": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x1268AD189526AC0b386faF06eFfC46779c340eE6": {
"balance": "0xd3c21bcecceda1000000"
},
"0x12Cba59f5A74DB81a12ff63C349Bd82CBF6007C2": {
"balance": "0xd3c21bcecceda1000000"
},
"0x1446D7f6dF00380F246d8211dE7f0FaBC4Fd248C": {
"balance": "0xd3c21bcecceda1000000"
},
"0x164e38a375247A784A81d420201AA8fe4E513921": {
"balance": "0xd3c21bcecceda1000000"
},
"0x1B7aA44088a0eA95bdc65fef6E5071E946Bf7d8f": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x222222222222cF64a76AE3d36859958c864fDA2c": {
"balance": "0xd3c21bcecceda1000000"
},
"0x2f14582947E292a2eCd20C430B46f2d27CFE213c": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x2f2c75B5Dd5D246194812b00eEb3B09c2c66e2eE": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x341c40b94bf2afbfa42573cb78f16ee15a056238": {
"balance": "0xd3c21bcecceda1000000"
},
"0x34f845773D4364999f2fbC7AA26ABDeE902cBb46": {
"balance": "0xd3c21bcecceda1000000"
},
"0x3C75594181e03E8ECD8468A0037F058a9dAfad79": {
"balance": "0xd3c21bcecceda1000000"
},
"0x462396E69dBfa455F405f4DD82F3014Af8003B72": {
"balance": "0xa56fa5b99019a5c8000000"
},
"0x49Df3CCa2670eB0D591146B16359fe336e476F29": {
"balance": "0xd3c21bcecceda1000000"
},
"0x4D0b04b405c6b62C7cFC3aE54759747e2C0b4662": {
"balance": "0xd3c21bcecceda1000000"
},
"0x4D496CcC28058B1D74B7a19541663E21154f9c84": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x509a7667aC8D0320e36172c192506a6188aA84f6": {
"balance": "0x7c13bc4b2c133c56000000"
},
"0x5180db0237291A6449DdA9ed33aD90a38787621c": {
"balance": "0xd3c21bcecceda1000000"
},
"0x52730f347dEf6BA09adfF62EaC60D5fEe8205BC4": {
"balance": "0xd3c21bcecceda1000000"
},
"0x5EAC0fBd3dfef8aE3efa3c5dc1aa193bc6033dFd": {
"balance": "0xd3c21bcecceda1000000"
},
"0x6a7aA9b882d50Bb7bc5Da1a244719C99f12F06a3": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x6Cc9397c3B38739daCbfaA68EaD5F5D77Ba5F455": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x762cA62ca2549ad806763B3Aa1eA317c429bDBDa": {
"balance": "0xd3c21bcecceda1000000"
},
"0x778F5F13C4Be78A3a4d7141BCB26999702f407CF": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x875D25Ee4bC604C71BaF6236a8488F22399BED4b": {
"balance": "0xd3c21bcecceda1000000"
},
"0x8dF7878d3571BEF5e5a744F96287C8D20386d75A": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x9E415A096fF77650dc925dEA546585B4adB322B6": {
"balance": "0xd3c21bcecceda1000000"
},
"0xA0766B65A4f7B1da79a1AF79aC695456eFa28644": {
"balance": "0xd3c21bcecceda1000000"
},
"0xA29B144A449E414A472c60C7AAf1aaFfE329021D": {
"balance": "0xd3c21bcecceda1000000"
},
"0xa55395566b0b54395B3246f96A0bDc4b8a483df9": {
"balance": "0xd3c21bcecceda1000000"
},
"0xAC9ba72fb61aA7c31A95df0A8b6ebA6f41EF875e": {
"balance": "0xd3c21bcecceda1000000"
},
"0xB0498C15879db2eE5471d4926c5fAA25C9a09683": {
"balance": "0xd3c21bcecceda1000000"
},
"0xB19Fb4c1f280327e60Ed37b1Dc6EE77533539314": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0xC21cB9C99C316d1863142F7dD86dd5496D81A8D6": {
"balance": "0xd3c21bcecceda1000000"
},
"0xc473d412dc52e349862209924c8981b2ee420768": {
"balance": "0xd3c21bcecceda1000000"
},
"0xC48E23C5F6e1eA0BaEf6530734edC3968f79Af2e": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0xc6e2459991BfE27cca6d86722F35da23A1E4Cb97": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0xD3994e4d3202dD23c8497d7F75bF1647d1DA1bb1": {
"balance": "0x19D971E4FE8401E74000000"
},
"0xDCA6e9B48Ea86AeBFDf9929949124042296b6e34": {
"balance": "0xd3c21bcecceda1000000"
},
"0xe0a2Bd4258D2768837BAa26A28fE71Dc079f84c7": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0xEA28d002042fd9898D0Db016be9758eeAFE35C1E": {
"balance": "0xd3c21bcecceda1000000"
},
"0xEfA7454f1116807975A4750B46695E967850de5D": {
"balance": "0xd3c21bcecceda1000000"
},
"0xFBFd6Fa9F73Ac6A058E01259034C28001BEf8247": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0xe0991E844041bE6F11B99da5b114b6bCf84EBd57": {
"balance": "0xd3c21bcecceda1000000"
},
"0x15E719b6AcAf1E4411Bf0f9576CB1D0dB161DdFc": {
"balance": "0xd3c21bcecceda1000000"
},
"0x346D827a75F98F0A7a324Ff80b7C3F90252E8baC": {
"balance": "0xd3c21bcecceda1000000"
},
"0x73b2e0E54510239E22cC936F0b4a6dE1acf0AbdE": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0xBb977B2EE8a111D788B3477D242078d0B837E72b": {
"balance": "0xd3c21bcecceda1000000"
},
"0x834Dbf5A03e29c25bc55459cCe9c021EeBE676Ad": {
"balance": "0xd3c21bcecceda1000000"
},
"0xD1F77E4C1C45186e8653C489F90e008a73597296": {
"balance": "0xd3c21bcecceda1000000"
},
"0xb04aeF2a3d2D86B01006cCD4339A2e943d9c6480": {
"balance": "0xd3c21bcecceda1000000"
},
"0xC9CA2bA9A27De1Db589d8c33Ab8EDFa2111b31fb": {
"balance": "0xd3c21bcecceda1000000"
},
"0x4BC656B34De23896fa6069C9862F355b740401aF": {
"balance": "0x084595161401484a000000"
}
},
"0x0000006916a87b82333f4245046623b23794C65C": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x0be949928Ff199c9EBA9E110db210AA5C94EFAd0": {
"balance": "0x7c13bc4b2c133c56000000"
},
"0x0C100000006d7b5e23a1eAEE637f28cA32Cd5b31": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x0C35317B7a96C454E2CB3d1A255D775Ab112cCc8": {
"balance": "0xd3c21bcecceda1000000"
},
"0x0d731cfabC5574329823F26d488416451d2ea376": {
"balance": "0xd3c21bcecceda1000000"
},
"0x0e79065B5F11b5BD1e62B935A600976ffF3754B9": {
"balance": "0xd3c21bcecceda1000000"
},
"0x105083929bF9bb22C26cB1777Ec92661170D4285": {
"balance": "0xd3c21bcecceda1000000"
},
"0x10F5d45854e038071485AC9e402308cF80D2d2fE": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x1268AD189526AC0b386faF06eFfC46779c340eE6": {
"balance": "0xd3c21bcecceda1000000"
},
"0x12Cba59f5A74DB81a12ff63C349Bd82CBF6007C2": {
"balance": "0xd3c21bcecceda1000000"
},
"0x1446D7f6dF00380F246d8211dE7f0FaBC4Fd248C": {
"balance": "0xd3c21bcecceda1000000"
},
"0x164e38a375247A784A81d420201AA8fe4E513921": {
"balance": "0xd3c21bcecceda1000000"
},
"0x1B7aA44088a0eA95bdc65fef6E5071E946Bf7d8f": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x222222222222cF64a76AE3d36859958c864fDA2c": {
"balance": "0xd3c21bcecceda1000000"
},
"0x2f14582947E292a2eCd20C430B46f2d27CFE213c": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x2f2c75B5Dd5D246194812b00eEb3B09c2c66e2eE": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x341c40b94bf2afbfa42573cb78f16ee15a056238": {
"balance": "0xd3c21bcecceda1000000"
},
"0x34f845773D4364999f2fbC7AA26ABDeE902cBb46": {
"balance": "0xd3c21bcecceda1000000"
},
"0x3C75594181e03E8ECD8468A0037F058a9dAfad79": {
"balance": "0xd3c21bcecceda1000000"
},
"0x462396E69dBfa455F405f4DD82F3014Af8003B72": {
"balance": "0xa56fa5b99019a5c8000000"
},
"0x49Df3CCa2670eB0D591146B16359fe336e476F29": {
"balance": "0xd3c21bcecceda1000000"
},
"0x4D0b04b405c6b62C7cFC3aE54759747e2C0b4662": {
"balance": "0xd3c21bcecceda1000000"
},
"0x4D496CcC28058B1D74B7a19541663E21154f9c84": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x509a7667aC8D0320e36172c192506a6188aA84f6": {
"balance": "0x7c13bc4b2c133c56000000"
},
"0x5180db0237291A6449DdA9ed33aD90a38787621c": {
"balance": "0xd3c21bcecceda1000000"
},
"0x52730f347dEf6BA09adfF62EaC60D5fEe8205BC4": {
"balance": "0xd3c21bcecceda1000000"
},
"0x5EAC0fBd3dfef8aE3efa3c5dc1aa193bc6033dFd": {
"balance": "0xd3c21bcecceda1000000"
},
"0x6a7aA9b882d50Bb7bc5Da1a244719C99f12F06a3": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x6Cc9397c3B38739daCbfaA68EaD5F5D77Ba5F455": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x762cA62ca2549ad806763B3Aa1eA317c429bDBDa": {
"balance": "0xd3c21bcecceda1000000"
},
"0x778F5F13C4Be78A3a4d7141BCB26999702f407CF": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x875D25Ee4bC604C71BaF6236a8488F22399BED4b": {
"balance": "0xd3c21bcecceda1000000"
},
"0x8dF7878d3571BEF5e5a744F96287C8D20386d75A": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0x9E415A096fF77650dc925dEA546585B4adB322B6": {
"balance": "0xd3c21bcecceda1000000"
},
"0xA0766B65A4f7B1da79a1AF79aC695456eFa28644": {
"balance": "0xd3c21bcecceda1000000"
},
"0xA29B144A449E414A472c60C7AAf1aaFfE329021D": {
"balance": "0xd3c21bcecceda1000000"
},
"0xa55395566b0b54395B3246f96A0bDc4b8a483df9": {
"balance": "0xd3c21bcecceda1000000"
},
"0xAC9ba72fb61aA7c31A95df0A8b6ebA6f41EF875e": {
"balance": "0xd3c21bcecceda1000000"
},
"0xB0498C15879db2eE5471d4926c5fAA25C9a09683": {
"balance": "0xd3c21bcecceda1000000"
},
"0xB19Fb4c1f280327e60Ed37b1Dc6EE77533539314": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0xC21cB9C99C316d1863142F7dD86dd5496D81A8D6": {
"balance": "0xd3c21bcecceda1000000"
},
"0xc473d412dc52e349862209924c8981b2ee420768": {
"balance": "0xd3c21bcecceda1000000"
},
"0xC48E23C5F6e1eA0BaEf6530734edC3968f79Af2e": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0xc6e2459991BfE27cca6d86722F35da23A1E4Cb97": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0xD3994e4d3202dD23c8497d7F75bF1647d1DA1bb1": {
"balance": "0x19D971E4FE8401E74000000"
},
"0xDCA6e9B48Ea86AeBFDf9929949124042296b6e34": {
"balance": "0xd3c21bcecceda1000000"
},
"0xe0a2Bd4258D2768837BAa26A28fE71Dc079f84c7": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0xEA28d002042fd9898D0Db016be9758eeAFE35C1E": {
"balance": "0xd3c21bcecceda1000000"
},
"0xEfA7454f1116807975A4750B46695E967850de5D": {
"balance": "0xd3c21bcecceda1000000"
},
"0xFBFd6Fa9F73Ac6A058E01259034C28001BEf8247": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0xe0991E844041bE6F11B99da5b114b6bCf84EBd57": {
"balance": "0xd3c21bcecceda1000000"
},
"0x15E719b6AcAf1E4411Bf0f9576CB1D0dB161DdFc": {
"balance": "0xd3c21bcecceda1000000"
},
"0x346D827a75F98F0A7a324Ff80b7C3F90252E8baC": {
"balance": "0xd3c21bcecceda1000000"
},
"0x73b2e0E54510239E22cC936F0b4a6dE1acf0AbdE": {
"balance": "0x52b7d2dcc80cd2e4000000"
},
"0xBb977B2EE8a111D788B3477D242078d0B837E72b": {
"balance": "0xd3c21bcecceda1000000"
},
"0x834Dbf5A03e29c25bc55459cCe9c021EeBE676Ad": {
"balance": "0xd3c21bcecceda1000000"
},
"0xD1F77E4C1C45186e8653C489F90e008a73597296": {
"balance": "0xd3c21bcecceda1000000"
},
"0xb04aeF2a3d2D86B01006cCD4339A2e943d9c6480": {
"balance": "0xd3c21bcecceda1000000"
},
"0xC9CA2bA9A27De1Db589d8c33Ab8EDFa2111b31fb": {
"balance": "0xd3c21bcecceda1000000"
},
"0x4BC656B34De23896fa6069C9862F355b740401aF": {
"balance": "0x084595161401484a000000"
}
},
"coinbase": "0x0000000000000000000000000000000000000000",
"baseFeePerGas": "0x3B9ACA00",
"difficulty": "0x01",
"extraData": "0x686f77206d7563682069732074686520666973683f",
"extraData": "",
"gasLimit": "0x17D7840",
"nonce": "0x1234",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp": "1694786100"
}
"timestamp": "1695902100"
}

@ -69,24 +69,22 @@ public class TransactionTracer {
final Hash blockHash,
final Hash transactionHash,
final DebugOperationTracer tracer) {
Optional<TransactionTrace> transactionTrace =
blockReplay.beforeTransactionInBlock(
mutableWorldState,
blockHash,
transactionHash,
(transaction, header, blockchain, transactionProcessor, blobGasPrice) -> {
final TransactionProcessingResult result =
processTransaction(
header,
blockchain,
mutableWorldState.updater(),
transaction,
transactionProcessor,
tracer,
blobGasPrice);
return new TransactionTrace(transaction, result, tracer.getTraceFrames());
});
return transactionTrace;
return blockReplay.beforeTransactionInBlock(
mutableWorldState,
blockHash,
transactionHash,
(transaction, header, blockchain, transactionProcessor, blobGasPrice) -> {
final TransactionProcessingResult result =
processTransaction(
header,
blockchain,
mutableWorldState.updater(),
transaction,
transactionProcessor,
tracer,
blobGasPrice);
return new TransactionTrace(transaction, result, tracer.getTraceFrames());
});
}
public List<String> traceTransactionToFile(
@ -139,7 +137,7 @@ public class TransactionTracer {
stackedUpdater,
transaction,
transactionProcessor,
new StandardJsonTracer(out, showMemory, true, true),
new StandardJsonTracer(out, showMemory, true, true, false),
blobGasPrice);
out.println(
summaryTrace(

@ -181,6 +181,14 @@ public class EvmToolCommand implements Runnable {
negatable = true)
final Boolean showReturnData = false;
@Option(
names = {"--trace.storage"},
description =
"Show the updated storage slots for the current account. Default is to not show updated storage.",
scope = INHERIT,
negatable = true)
final Boolean showStorage = false;
@Option(
names = {"--notime"},
description = "Don't include time data in summary output.",
@ -365,7 +373,7 @@ public class EvmToolCommand implements Runnable {
final OperationTracer tracer = // You should have picked Mercy.
lastLoop && showJsonResults
? new StandardJsonTracer(out, showMemory, !hideStack, showReturnData)
? new StandardJsonTracer(out, showMemory, !hideStack, showReturnData, showStorage)
: OperationTracer.NO_TRACING;
WorldUpdater updater = component.getWorldUpdater();
@ -466,10 +474,10 @@ public class EvmToolCommand implements Runnable {
" \""
+ accountStorageEntry
.getKey()
.map(UInt256::toHexString)
.map(UInt256::toQuantityHexString)
.orElse("-")
+ "\": \""
+ accountStorageEntry.getValue().toHexString()
+ accountStorageEntry.getValue().toQuantityHexString()
+ "\"")
.toList()));
out.println(" },");

@ -182,7 +182,8 @@ public class StateTestSubCommand implements Runnable {
parentCommand.out,
parentCommand.showMemory,
!parentCommand.hideStack,
parentCommand.showReturnData)
parentCommand.showReturnData,
parentCommand.showStorage)
: OperationTracer.NO_TRACING;
final ObjectMapper objectMapper = JsonUtils.createObjectMapper();

@ -254,7 +254,8 @@ public class T8nSubCommand implements Runnable {
new PrintStream(traceDest),
parentCommand.showMemory,
!parentCommand.hideStack,
parentCommand.showReturnData);
parentCommand.showReturnData,
parentCommand.showStorage);
outputStreams.put(jsonTracer, traceDest);
return jsonTracer;
}

@ -198,7 +198,7 @@ tasks.register('validateReferenceTestSubmodule') {
description = "Checks that the reference tests submodule is not accidentally changed"
doLast {
def result = new ByteArrayOutputStream()
def expectedHash = '06e276776bc87817c38f6efb492bf6f4527fa904'
def expectedHash = '661356317ac6df52208d54187e692472a25a01f8'
def submodulePath = java.nio.file.Path.of("${rootProject.projectDir}", "ethereum/referencetests/src/reference-test/external-resources").toAbsolutePath()
try {
exec {

@ -97,33 +97,35 @@ public class ReferenceTestEnv extends BlockHeader {
*/
@JsonCreator
public ReferenceTestEnv(
@JsonProperty("beaconRoot") final String beaconRoot,
@JsonProperty("blockHashes") final Map<String, String> blockHashes,
@JsonProperty("ommers") final List<String> _ommers,
@JsonProperty("previousHash") final String previousHash,
@JsonProperty("withdrawals") final List<EnvWithdrawal> withdrawals,
@JsonProperty("currentBaseFee") final String baseFee,
@JsonProperty("currentBeaconRoot") final String currentBeaconRoot,
@JsonProperty("currentBlobGasUsed") final String currentBlobGasUsed,
@JsonProperty("currentCoinbase") final String coinbase,
@JsonProperty("currentDataGasUsed") final String currentDataGasUsed,
@JsonProperty("currentDifficulty") final String difficulty,
@JsonProperty("currentExcessBlobGas") final String currentExcessBlobGas,
@JsonProperty("currentExcessDataGas") final String currentExcessDataGas,
@JsonProperty("currentGasLimit") final String gasLimit,
@JsonProperty("currentNumber") final String number,
@JsonProperty("currentBaseFee") final String baseFee,
@JsonProperty("currentTimestamp") final String timestamp,
@JsonProperty("currentRandom") final String random,
@JsonProperty("currentStateRoot") final String stateRoot,
@JsonProperty("previousHash") final String previousHash,
@JsonProperty("parentDifficulty") final String parentDifficulty,
@JsonProperty("currentTimestamp") final String timestamp,
@JsonProperty("currentWithdrawalsRoot") final String currentWithdrawalsRoot,
@JsonProperty("parentBaseFee") final String parentBaseFee,
@JsonProperty("parentGasUsed") final String parentGasUsed,
@JsonProperty("parentGasLimit") final String parentGasLimit,
@JsonProperty("parentTimestamp") final String parentTimestamp,
@JsonProperty("ommers") final List<String> _ommers,
@JsonProperty("parentUncleHash") final String _parentUncleHash,
@JsonProperty("withdrawals") final List<EnvWithdrawal> withdrawals,
@JsonProperty("blockHashes") final Map<String, String> blockHashes,
@JsonProperty("currentExcessBlobGas") final String currentExcessBlobGas,
@JsonProperty("currentBlobGasUsed") final String currentBlobGasUsed,
@JsonProperty("currentExcessDataGas") final String currentExcessDataGas,
@JsonProperty("currentDataGasUsed") final String currentDataGasUsed,
@JsonProperty("parentExcessBlobGas") final String parentExcessBlobGas,
@JsonProperty("parentBlobGasUsed") final String parentBlobGasUsed,
@JsonProperty("parentExcessDataGas") final String parentExcessDataGas,
@JsonProperty("parentDataGasUsed") final String parentDataGasUsed,
@JsonProperty("beaconRoot") final String beaconRoot) {
@JsonProperty("parentDifficulty") final String parentDifficulty,
@JsonProperty("parentExcessBlobGas") final String parentExcessBlobGas,
@JsonProperty("parentExcessDataGas") final String parentExcessDataGas,
@JsonProperty("parentGasLimit") final String parentGasLimit,
@JsonProperty("parentGasUsed") final String parentGasUsed,
@JsonProperty("parentTimestamp") final String parentTimestamp,
@JsonProperty("parentUncleHash") final String _parentUncleHash) {
super(
generateTestBlockHash(previousHash, number),
Hash.EMPTY_LIST_HASH, // ommersHash
@ -141,7 +143,7 @@ public class ReferenceTestEnv extends BlockHeader {
Optional.ofNullable(baseFee).map(Wei::fromHexString).orElse(null),
Optional.ofNullable(random).map(Difficulty::fromHexString).orElse(Difficulty.ZERO),
0L,
null, // withdrawalsRoot
currentWithdrawalsRoot == null ? null : Hash.fromHexString(currentWithdrawalsRoot),
currentBlobGasUsed == null
? currentDataGasUsed == null ? null : Long.decode(currentDataGasUsed)
: Long.decode(currentBlobGasUsed),
@ -172,7 +174,10 @@ public class ReferenceTestEnv extends BlockHeader {
Map.entry(
Long.decode(entry.getKey()), Hash.fromHexString(entry.getValue())))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
this.beaconRoot = beaconRoot == null ? null : Hash.fromHexString(beaconRoot);
this.beaconRoot =
beaconRoot == null
? (currentBeaconRoot == null ? null : Hash.fromHexString(currentBeaconRoot))
: Hash.fromHexString(beaconRoot);
}
@Override

@ -1 +1 @@
Subproject commit 06e276776bc87817c38f6efb492bf6f4527fa904
Subproject commit 661356317ac6df52208d54187e692472a25a01f8

@ -86,6 +86,9 @@ public class BlockchainReferenceTestTools {
params.ignore("blobhashListBounds5");
params.ignore("blockWithAllTransactionTypes");
// EIP-4788 is still in flux and the current fill is not against the final address
params.ignore("[Cancun]");
// EOF tests are written against an older version of the spec
params.ignore("/stEOF/");
}

@ -45,6 +45,7 @@ public class StandardJsonTracer implements OperationTracer {
private final boolean showMemory;
private final boolean showStack;
private final boolean showReturnData;
private final boolean showStorage;
private int pc;
private int section;
private List<String> stack;
@ -52,6 +53,7 @@ public class StandardJsonTracer implements OperationTracer {
private Bytes memory;
private int memorySize;
private int depth;
private String storageString;
/**
* Instantiates a new Standard json tracer.
@ -60,16 +62,19 @@ public class StandardJsonTracer implements OperationTracer {
* @param showMemory show memory in trace lines
* @param showStack show the stack in trace lines
* @param showReturnData show return data in trace lines
* @param showStorage show the updated storage
*/
public StandardJsonTracer(
final PrintWriter out,
final boolean showMemory,
final boolean showStack,
final boolean showReturnData) {
final boolean showReturnData,
final boolean showStorage) {
this.out = out;
this.showMemory = showMemory;
this.showStack = showStack;
this.showReturnData = showReturnData;
this.showStorage = showStorage;
}
/**
@ -79,13 +84,20 @@ public class StandardJsonTracer implements OperationTracer {
* @param showMemory show memory in trace lines
* @param showStack show the stack in trace lines
* @param showReturnData show return data in trace lines
* @param showStorage show updated storage
*/
public StandardJsonTracer(
final PrintStream out,
final boolean showMemory,
final boolean showStack,
final boolean showReturnData) {
this(new PrintWriter(out, true, StandardCharsets.UTF_8), showMemory, showStack, showReturnData);
final boolean showReturnData,
final boolean showStorage) {
this(
new PrintWriter(out, true, StandardCharsets.UTF_8),
showMemory,
showStack,
showReturnData,
showStorage);
}
/**
@ -130,6 +142,33 @@ public class StandardJsonTracer implements OperationTracer {
memory = null;
}
depth = messageFrame.getMessageStackSize();
StringBuilder sb = new StringBuilder();
if (showStorage) {
var updater = messageFrame.getWorldUpdater();
var account = updater.getAccount(messageFrame.getRecipientAddress());
if (account != null && !account.getUpdatedStorage().isEmpty()) {
boolean[] shownEntry = {false};
sb.append(",\"storage\":{");
account
.getUpdatedStorage()
.forEach(
(k, v) -> {
if (shownEntry[0]) {
sb.append(",");
} else {
shownEntry[0] = true;
}
sb.append("\"")
.append(k.toQuantityHexString())
.append("\":\"")
.append(v.toQuantityHexString())
.append("\"");
});
sb.append("}");
}
}
storageString = sb.toString();
}
@Override
@ -155,7 +194,7 @@ public class StandardJsonTracer implements OperationTracer {
if (showStack) {
sb.append("\"stack\":[").append(commaJoiner.join(stack)).append("],");
}
if (showReturnData && returnData.size() > 0) {
if (showReturnData && !returnData.isEmpty()) {
sb.append("\"returnData\":\"").append(returnData.toHexString()).append("\",");
}
sb.append("\"depth\":").append(depth).append(",");
@ -164,14 +203,14 @@ public class StandardJsonTracer implements OperationTracer {
if (executeResult.getHaltReason() != null) {
sb.append(",\"error\":\"")
.append(executeResult.getHaltReason().getDescription())
.append("\"}");
.append("\"");
} else if (messageFrame.getRevertReason().isPresent()) {
sb.append(",\"error\":\"")
.append(quoteEscape(messageFrame.getRevertReason().orElse(Bytes.EMPTY)))
.append("\"}");
} else {
sb.append("}");
.append("\"");
}
sb.append(storageString).append("}");
out.println(sb);
}
@ -229,7 +268,7 @@ public class StandardJsonTracer implements OperationTracer {
final long timeNs) {
final StringBuilder sb = new StringBuilder(1024);
sb.append("{");
if (output.size() > 0) {
if (!output.isEmpty()) {
sb.append("\"output\":\"").append(output.toShortHexString()).append("\",");
} else {
sb.append("\"output\":\"\",");

@ -38,7 +38,7 @@ class StandardJsonTracerTest {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream out = new PrintStream(baos);
var executor = EVMExecutor.istanbul(EvmConfiguration.DEFAULT);
StandardJsonTracer tracer = new StandardJsonTracer(out, true, true, true);
StandardJsonTracer tracer = new StandardJsonTracer(out, true, true, true, false);
executor.tracer(tracer);
executor.gas(10_000_000_000L);
@ -58,20 +58,56 @@ class StandardJsonTracerTest {
// (g) if error is zero length or null it is not included.
assertThat(baos)
.hasToString(
"{\"pc\":0,\"op\":96,\"gas\":\"0x2540be400\",\"gasCost\":\"0x3\",\"memSize\":0,\"stack\":[],\"depth\":1,\"refund\":0,\"opName\":\"PUSH1\"}\n"
+ "{\"pc\":2,\"op\":128,\"gas\":\"0x2540be3fd\",\"gasCost\":\"0x3\",\"memSize\":0,\"stack\":[\"0x40\"],\"depth\":1,\"refund\":0,\"opName\":\"DUP1\"}\n"
+ "{\"pc\":3,\"op\":83,\"gas\":\"0x2540be3fa\",\"gasCost\":\"0xc\",\"memSize\":0,\"stack\":[\"0x40\",\"0x40\"],\"depth\":1,\"refund\":0,\"opName\":\"MSTORE8\"}\n"
+ "{\"pc\":4,\"op\":96,\"gas\":\"0x2540be3ee\",\"gasCost\":\"0x3\",\"memory\":\"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000\",\"memSize\":96,\"stack\":[],\"depth\":1,\"refund\":0,\"opName\":\"PUSH1\"}\n"
+ "{\"pc\":6,\"op\":96,\"gas\":\"0x2540be3eb\",\"gasCost\":\"0x3\",\"memory\":\"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000\",\"memSize\":96,\"stack\":[\"0x40\"],\"depth\":1,\"refund\":0,\"opName\":\"PUSH1\"}\n"
+ "{\"pc\":8,\"op\":85,\"gas\":\"0x2540be3e8\",\"gasCost\":\"0x4e20\",\"memory\":\"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000\",\"memSize\":96,\"stack\":[\"0x40\",\"0x40\"],\"depth\":1,\"refund\":0,\"opName\":\"SSTORE\"}\n"
+ "{\"pc\":9,\"op\":96,\"gas\":\"0x2540b95c8\",\"gasCost\":\"0x3\",\"memory\":\"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000\",\"memSize\":96,\"stack\":[],\"depth\":1,\"refund\":0,\"opName\":\"PUSH1\"}\n"
+ "{\"pc\":11,\"op\":96,\"gas\":\"0x2540b95c5\",\"gasCost\":\"0x3\",\"memory\":\"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000\",\"memSize\":96,\"stack\":[\"0x40\"],\"depth\":1,\"refund\":0,\"opName\":\"PUSH1\"}\n"
+ "{\"pc\":13,\"op\":96,\"gas\":\"0x2540b95c2\",\"gasCost\":\"0x3\",\"memory\":\"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000\",\"memSize\":96,\"stack\":[\"0x40\",\"0x0\"],\"depth\":1,\"refund\":0,\"opName\":\"PUSH1\"}\n"
+ "{\"pc\":15,\"op\":96,\"gas\":\"0x2540b95bf\",\"gasCost\":\"0x3\",\"memory\":\"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000\",\"memSize\":96,\"stack\":[\"0x40\",\"0x0\",\"0x40\"],\"depth\":1,\"refund\":0,\"opName\":\"PUSH1\"}\n"
+ "{\"pc\":17,\"op\":96,\"gas\":\"0x2540b95bc\",\"gasCost\":\"0x3\",\"memory\":\"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000\",\"memSize\":96,\"stack\":[\"0x40\",\"0x0\",\"0x40\",\"0x0\"],\"depth\":1,\"refund\":0,\"opName\":\"PUSH1\"}\n"
+ "{\"pc\":19,\"op\":90,\"gas\":\"0x2540b95b9\",\"gasCost\":\"0x2\",\"memory\":\"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000\",\"memSize\":96,\"stack\":[\"0x40\",\"0x0\",\"0x40\",\"0x0\",\"0x2\"],\"depth\":1,\"refund\":0,\"opName\":\"GAS\"}\n"
+ "{\"pc\":20,\"op\":250,\"gas\":\"0x2540b95b7\",\"gasCost\":\"0x2bc\",\"memory\":\"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000\",\"memSize\":96,\"stack\":[\"0x40\",\"0x0\",\"0x40\",\"0x0\",\"0x2\",\"0x2540b95b7\"],\"depth\":1,\"refund\":0,\"opName\":\"STATICCALL\"}\n"
+ "{\"pc\":21,\"op\":96,\"gas\":\"0x2540b92a7\",\"gasCost\":\"0x3\",\"memory\":\"0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000\",\"memSize\":96,\"stack\":[\"0x1\"],\"returnData\":\"0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b\",\"depth\":1,\"refund\":0,\"opName\":\"PUSH1\"}\n"
+ "{\"pc\":23,\"op\":243,\"gas\":\"0x2540b92a4\",\"gasCost\":\"0x0\",\"memory\":\"0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000\",\"memSize\":96,\"stack\":[\"0x1\",\"0x40\"],\"returnData\":\"0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b\",\"depth\":1,\"refund\":0,\"opName\":\"RETURN\"}\n");
"""
{"pc":0,"op":96,"gas":"0x2540be400","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":2,"op":128,"gas":"0x2540be3fd","gasCost":"0x3","memSize":0,"stack":["0x40"],"depth":1,"refund":0,"opName":"DUP1"}
{"pc":3,"op":83,"gas":"0x2540be3fa","gasCost":"0xc","memSize":0,"stack":["0x40","0x40"],"depth":1,"refund":0,"opName":"MSTORE8"}
{"pc":4,"op":96,"gas":"0x2540be3ee","gasCost":"0x3","memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":6,"op":96,"gas":"0x2540be3eb","gasCost":"0x3","memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":8,"op":85,"gas":"0x2540be3e8","gasCost":"0x4e20","memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40","0x40"],"depth":1,"refund":0,"opName":"SSTORE"}
{"pc":9,"op":96,"gas":"0x2540b95c8","gasCost":"0x3","memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":11,"op":96,"gas":"0x2540b95c5","gasCost":"0x3","memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":13,"op":96,"gas":"0x2540b95c2","gasCost":"0x3","memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":15,"op":96,"gas":"0x2540b95bf","gasCost":"0x3","memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40","0x0","0x40"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":17,"op":96,"gas":"0x2540b95bc","gasCost":"0x3","memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40","0x0","0x40","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":19,"op":90,"gas":"0x2540b95b9","gasCost":"0x2","memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x2"],"depth":1,"refund":0,"opName":"GAS"}
{"pc":20,"op":250,"gas":"0x2540b95b7","gasCost":"0x2bc","memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x2","0x2540b95b7"],"depth":1,"refund":0,"opName":"STATICCALL"}
{"pc":21,"op":96,"gas":"0x2540b92a7","gasCost":"0x3","memory":"0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x1"],"returnData":"0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b","depth":1,"refund":0,"opName":"PUSH1"}
{"pc":23,"op":243,"gas":"0x2540b92a4","gasCost":"0x0","memory":"0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x1","0x40"],"returnData":"0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b","depth":1,"refund":0,"opName":"RETURN"}
""");
}
@Test
void updatedStorageTestCase() {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream out = new PrintStream(baos);
var executor = EVMExecutor.istanbul(EvmConfiguration.DEFAULT);
StandardJsonTracer tracer = new StandardJsonTracer(out, false, false, false, true);
executor.tracer(tracer);
executor.gas(10_000_000_000L);
var codeBytes = Bytes.fromHexString("0x604080536040604055604060006040600060025afa6040f3");
executor.execute(codeBytes, Bytes.EMPTY, Wei.ZERO, Address.ZERO);
assertThat(baos)
.hasToString(
"""
{"pc":0,"op":96,"gas":"0x2540be400","gasCost":"0x3","memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":2,"op":128,"gas":"0x2540be3fd","gasCost":"0x3","memSize":0,"depth":1,"refund":0,"opName":"DUP1"}
{"pc":3,"op":83,"gas":"0x2540be3fa","gasCost":"0xc","memSize":0,"depth":1,"refund":0,"opName":"MSTORE8"}
{"pc":4,"op":96,"gas":"0x2540be3ee","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":6,"op":96,"gas":"0x2540be3eb","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":8,"op":85,"gas":"0x2540be3e8","gasCost":"0x4e20","memSize":96,"depth":1,"refund":0,"opName":"SSTORE"}
{"pc":9,"op":96,"gas":"0x2540b95c8","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}}
{"pc":11,"op":96,"gas":"0x2540b95c5","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}}
{"pc":13,"op":96,"gas":"0x2540b95c2","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}}
{"pc":15,"op":96,"gas":"0x2540b95bf","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}}
{"pc":17,"op":96,"gas":"0x2540b95bc","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}}
{"pc":19,"op":90,"gas":"0x2540b95b9","gasCost":"0x2","memSize":96,"depth":1,"refund":0,"opName":"GAS","storage":{"0x40":"0x40"}}
{"pc":20,"op":250,"gas":"0x2540b95b7","gasCost":"0x2bc","memSize":96,"depth":1,"refund":0,"opName":"STATICCALL","storage":{"0x40":"0x40"}}
{"pc":21,"op":96,"gas":"0x2540b92a7","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}}
{"pc":23,"op":243,"gas":"0x2540b92a4","gasCost":"0x0","memSize":96,"depth":1,"refund":0,"opName":"RETURN","storage":{"0x40":"0x40"}}
""");
}
}

@ -122,6 +122,12 @@ public class EvmToyCommand implements Runnable {
scope = ScopeType.INHERIT)
final Boolean showReturnData = false;
@CommandLine.Option(
names = {"--trace.storage"},
description = "When tracing, show the updated storage contents.",
scope = ScopeType.INHERIT)
final Boolean showStorage = false;
@CommandLine.Option(
names = {"--repeat"},
description = "Number of times to repeat for benchmarking.")
@ -164,7 +170,8 @@ public class EvmToyCommand implements Runnable {
final OperationTracer tracer = // You should have picked Mercy.
lastLoop && showJsonResults
? new StandardJsonTracer(System.out, showMemory, showStack, showReturnData)
? new StandardJsonTracer(
System.out, showMemory, showStack, showReturnData, showStorage)
: OperationTracer.NO_TRACING;
MessageFrame initialMessageFrame =

@ -1,4 +1,4 @@
version=23.7.3-SNAPSHOT
version=23.7.4-SNAPSHOT
org.gradle.welcome=never
# Set exports/opens flags required by Google Java Format and ErrorProne plugins. (JEP-396)

@ -4167,6 +4167,17 @@
<sha256 value="73ba8ae254e8f8ae7d7f3bfcb5f01a3826533bde7aba26d652d2d454c6e07d70" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.hyperledger.besu" name="arithmetic" version="0.8.2">
<artifact name="arithmetic-0.8.2.jar">
<sha256 value="d7a61afb72e184c99e1146c42a3b6276b0b9677fec285e8a2f64528da427a4b2" origin="Generated by Gradle"/>
</artifact>
<artifact name="arithmetic-0.8.2.module">
<sha256 value="dac70a03be1203fdceb5a0c7a7921ffce836fd28a0d0d260cdb1ed8d7405f143" origin="Generated by Gradle"/>
</artifact>
<artifact name="arithmetic-0.8.2.pom">
<sha256 value="4c23f63d0bf763610d1184a925c8a4a8a71161a268c1b679d3624a12b3f987e2" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.hyperledger.besu" name="blake2bf" version="0.8.1">
<artifact name="blake2bf-0.8.1.jar">
<sha256 value="a604d6aa5e5b8195702bd37021bcc75ca71bb82fc5f9d6b62e728470d00eaa1f" origin="Generated by Gradle"/>
@ -4178,6 +4189,17 @@
<sha256 value="6bdcec4fc08e4d54f77d1226b738874901a2de42849dfb76a28740c6954c4e3b" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.hyperledger.besu" name="blake2bf" version="0.8.2">
<artifact name="blake2bf-0.8.2.jar">
<sha256 value="cb2abade577e17f72c4ad193d61d03cdae43cc0b6bb5b00220038e56643f7e45" origin="Generated by Gradle"/>
</artifact>
<artifact name="blake2bf-0.8.2.module">
<sha256 value="f275da9d6a218219e43bfdaa3185c9190af980cac4f45a9cc3ffbbe9fbcde8cd" origin="Generated by Gradle"/>
</artifact>
<artifact name="blake2bf-0.8.2.pom">
<sha256 value="075857689d984c8e8324a1f7323964cb7ece1a9bc17f29cc1918e6b5bbc8a94e" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.hyperledger.besu" name="bls12-381" version="0.8.1">
<artifact name="bls12-381-0.8.1.jar">
<sha256 value="271008a549cb5d881139dd750d7d0258a8ff31618ea36cb3f9a5b4a3df5f9a99" origin="Generated by Gradle"/>
@ -4189,6 +4211,17 @@
<sha256 value="b58307308d609c35afb8af07499cc82972164840c9cb051952ca64eea0e40143" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.hyperledger.besu" name="bls12-381" version="0.8.2">
<artifact name="bls12-381-0.8.2.jar">
<sha256 value="3cb42d5724d1d349d5bdd1620d9032e59591aa18ed59394949a945818dcce5d2" origin="Generated by Gradle"/>
</artifact>
<artifact name="bls12-381-0.8.2.module">
<sha256 value="3e2971a61cc27cc6fdac39bb4cb0e36a09a58bc2d7619e23c3343e0519c087d1" origin="Generated by Gradle"/>
</artifact>
<artifact name="bls12-381-0.8.2.pom">
<sha256 value="d4531bcb20a6c9fc0404af8c7bf78a913967bdf3901ebb49de5d4bdff501c843" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.hyperledger.besu" name="ipa-multipoint" version="0.8.1">
<artifact name="ipa-multipoint-0.8.1.jar">
<sha256 value="ade17354e57645288634f6242e68fc1299afa7732773b3d5ef7c98157567c8aa" origin="Generated by Gradle"/>
@ -4200,6 +4233,17 @@
<sha256 value="c24ab5dd06233b9395a72ee24a24e415dbbdcc43ef4c49d290814e950296c4f7" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.hyperledger.besu" name="ipa-multipoint" version="0.8.2">
<artifact name="ipa-multipoint-0.8.2.jar">
<sha256 value="d045ef09d3d8b9b596c6344e763f148d57c66b1dcfeec1fd40ff965c61d973bc" origin="Generated by Gradle"/>
</artifact>
<artifact name="ipa-multipoint-0.8.2.module">
<sha256 value="c7361d0b64766df685612a47b446eeb518ae45c57f296d4bb690531626adb040" origin="Generated by Gradle"/>
</artifact>
<artifact name="ipa-multipoint-0.8.2.pom">
<sha256 value="60b276bdf73c848deeb53d27a628cd59aaede370206a2c47c5ea9793d993cb3e" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.hyperledger.besu" name="secp256k1" version="0.8.1">
<artifact name="secp256k1-0.8.1.jar">
<sha256 value="95331608c36d19ad455f48df123f6aa2a20d865dad25a6d0a7b10b83d381c71b" origin="Generated by Gradle"/>
@ -4211,6 +4255,17 @@
<sha256 value="4f2eb7ad7e5b1a7d69e95223604bdb85cc2d3fec4710bc15856c844e329037ad" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.hyperledger.besu" name="secp256k1" version="0.8.2">
<artifact name="secp256k1-0.8.2.jar">
<sha256 value="d6327378561501c7034c616fd0f85da4c24981c11d3fcec2163a8e92a32a48d8" origin="Generated by Gradle"/>
</artifact>
<artifact name="secp256k1-0.8.2.module">
<sha256 value="8e3a6da218d83990bbe2235da48bb9d8623001bbf25e324c8a463c5933574706" origin="Generated by Gradle"/>
</artifact>
<artifact name="secp256k1-0.8.2.pom">
<sha256 value="45d2e4243bdf8f3cabdf8668f712440753319fb6e322bc47001fdd39b5240ec1" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.hyperledger.besu" name="secp256r1" version="0.8.1">
<artifact name="secp256r1-0.8.1.jar">
<sha256 value="9b7b8f3f557ad9216ed36a2f8ef8427fba78090d4d8bcb413d117993b4f9473e" origin="Generated by Gradle"/>
@ -4222,6 +4277,17 @@
<sha256 value="05f166863653b500393778a380245fbd6fc4e6c33075d0a13f4ba5fcfb514a71" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.hyperledger.besu" name="secp256r1" version="0.8.2">
<artifact name="secp256r1-0.8.2.jar">
<sha256 value="cf0e58ec14f014c0a56a3cff6f38c143e02735207266a789ec6804cc06a7780c" origin="Generated by Gradle"/>
</artifact>
<artifact name="secp256r1-0.8.2.module">
<sha256 value="0b1ffb9e3e508dd0d216fa91226f9a798d88855528056894397037f9ac792977" origin="Generated by Gradle"/>
</artifact>
<artifact name="secp256r1-0.8.2.pom">
<sha256 value="8adace819bb8805b90a3a55311a17500ee0a5ea010f16e1f5109d0d595afc819" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.immutables" name="immutables" version="2.9.3">
<artifact name="immutables-2.9.3.pom">
<sha256 value="441e62f4a12c47176dea82e9a3fc4ea431f02d522f4430a64057398f830c5e43" origin="Generated by Gradle"/>

@ -160,7 +160,7 @@ dependencyManagement {
dependency 'org.openjdk.jol:jol-core:0.17'
dependency 'tech.pegasys:jc-kzg-4844:0.7.0'
dependencySet(group: 'org.hyperledger.besu', version: '0.8.1') {
dependencySet(group: 'org.hyperledger.besu', version: '0.8.2') {
entry 'arithmetic'
entry 'ipa-multipoint'
entry 'bls12-381'

@ -18,9 +18,10 @@ import org.hyperledger.besu.plugin.services.storage.SegmentIdentifier;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.locks.ReadWriteLock;
import org.apache.tuweni.bytes.Bytes;
@ -51,9 +52,10 @@ public class InMemoryKeyValueStorage extends SegmentedKeyValueStorageAdapter {
}
};
private static Map<SegmentIdentifier, Map<Bytes, Optional<byte[]>>> asSegmentMap(
private static ConcurrentMap<SegmentIdentifier, Map<Bytes, Optional<byte[]>>> asSegmentMap(
final Map<Bytes, Optional<byte[]>> initialMap) {
final Map<SegmentIdentifier, Map<Bytes, Optional<byte[]>>> segmentMap = new HashMap<>();
final ConcurrentMap<SegmentIdentifier, Map<Bytes, Optional<byte[]>>> segmentMap =
new ConcurrentHashMap<>();
segmentMap.put(SEGMENT_IDENTIFIER, initialMap);
return segmentMap;
}

@ -25,6 +25,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.locks.Lock;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -59,7 +60,7 @@ public class LayeredKeyValueStorage extends SegmentedInMemoryKeyValueStorage
* @param parent the parent key value storage for this layered storage.
*/
public LayeredKeyValueStorage(
final Map<SegmentIdentifier, Map<Bytes, Optional<byte[]>>> map,
final ConcurrentMap<SegmentIdentifier, Map<Bytes, Optional<byte[]>>> map,
final SegmentedKeyValueStorage parent) {
super(map);
this.parent = parent;

@ -30,6 +30,8 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
@ -46,14 +48,14 @@ import org.apache.tuweni.bytes.Bytes;
public class SegmentedInMemoryKeyValueStorage
implements SnappedKeyValueStorage, SnappableKeyValueStorage, SegmentedKeyValueStorage {
/** protected access for the backing hash map. */
final Map<SegmentIdentifier, Map<Bytes, Optional<byte[]>>> hashValueStore;
final ConcurrentMap<SegmentIdentifier, Map<Bytes, Optional<byte[]>>> hashValueStore;
/** protected access to the rw lock. */
protected final ReadWriteLock rwLock = new ReentrantReadWriteLock();
/** Instantiates a new In memory key value storage. */
public SegmentedInMemoryKeyValueStorage() {
this(new HashMap<>());
this(new ConcurrentHashMap<>());
}
/**
@ -62,7 +64,7 @@ public class SegmentedInMemoryKeyValueStorage
* @param hashValueStore the hash value store
*/
protected SegmentedInMemoryKeyValueStorage(
final Map<SegmentIdentifier, Map<Bytes, Optional<byte[]>>> hashValueStore) {
final ConcurrentMap<SegmentIdentifier, Map<Bytes, Optional<byte[]>>> hashValueStore) {
this.hashValueStore = hashValueStore;
}
@ -76,8 +78,8 @@ public class SegmentedInMemoryKeyValueStorage
segments.stream()
.collect(
Collectors
.<SegmentIdentifier, SegmentIdentifier, Map<Bytes, Optional<byte[]>>>toMap(
s -> s, s -> new HashMap<>())));
.<SegmentIdentifier, SegmentIdentifier, Map<Bytes, Optional<byte[]>>>
toConcurrentMap(s -> s, s -> new ConcurrentHashMap<>())));
}
@Override
@ -214,7 +216,9 @@ public class SegmentedInMemoryKeyValueStorage
// need to clone the submaps also:
return new SegmentedInMemoryKeyValueStorage(
hashValueStore.entrySet().stream()
.collect(Collectors.toMap(Map.Entry::getKey, e -> new HashMap<>(e.getValue()))));
.collect(
Collectors.toConcurrentMap(
Map.Entry::getKey, e -> new ConcurrentHashMap<>(e.getValue()))));
}
@Override

Loading…
Cancel
Save