besu icon indicating copy to clipboard operation
besu copied to clipboard

[Plugin System] Create WorldStateArchiveProvider interface #9448

Open AliZDev-v0 opened this issue 2 weeks ago • 0 comments

PR description

Hello, I would like to make contributions into besu, I was not able to find easier task with less changes Feel free to close these PR, if it's irrelevant. I also can break down it to smaller PR's to make review easier

In order to create WorldStateArchiveProvider in plugin-api next interfaces were need to be moved into plugin-api module

  • MutableWorldState`
  • WorldStateArchive
  • WorldStateProof
  • StateRootCommitter
  • WorldStateKeyValueStorage
  • WorldStatePreimageStorage

For next classes interfaces were created but functionality stayed the same:

  • WorldStateQueryParams
  • WorldStateProof
  • WorldStateConfig

Javadoc was required for above classes, it was generated with AI, for me seems good

Since interface were moved from eth/core to plugin-api I was need to replace org.hyperledger.besu.ethereum.core. BlockHeader to org.hyperledger.besu.plugin.data.BlockHeader

There only one method not supported in interface is toLogString(), I added a static method to ethereum/core/Util.toLogString() to support it

The WorldStateKeyValueStorage is used instead of WorldStateStorageCoordinator because ForestWorldStateArchive do not need worldStateStorageCoordinator it needs WorldStateKeyValueStorage

 public ForestWorldStateArchive(
      final WorldStateStorageCoordinator worldStateStorageCoordinator,
      final WorldStatePreimageStorage preimageStorage,
      final EvmConfiguration evmConfiguration) {
    this.worldStateKeyValueStorage =
        worldStateStorageCoordinator.getStrategy(ForestWorldStateKeyValueStorage.class);

Fixed Issue(s)

[Plugin System] Create WorldStateArchiveProvider interface https://github.com/hyperledger/besu/issues/9448

Thanks for sending a pull request! Have you done the following?

  • [x] Checked out our contribution guidelines?
  • [ ] Considered documentation and added the doc-change-required label to this PR if updates are required. // Not sure about these
  • [x] Considered the changelog and included an update if required.
  • [ ] For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • [X] spotless: ./gradlew spotlessApply
  • [X] unit tests: ./gradlew build
  • [ ] acceptance tests: ./gradlew acceptanceTest // not working on my local
  • [x] integration tests: ./gradlew integrationTest
  • [X] reference tests: ./gradlew ethereum:referenceTests:referenceTests
  • [ ] hive tests: Engine or other RPCs modified? // did not, can setup it upon request

AliZDev-v0 avatar Dec 11 '25 02:12 AliZDev-v0