Skip to content

Conversation

powerslider
Copy link
Contributor

@powerslider powerslider commented Oct 6, 2025

Why this should be merged

Check #1779

How this works

  • Delete plugin/evm/customrawdb.
  • Switch dependent code to using github.com/ava-labs/avalanchego/vms/evm/sync/customrawdb import instead.

Necessary changes to adapt to the newest avalanchego version and the migrated customrawdb package:

  • Fix genesis compat/upgrade handling.
    • core/genesis.go: Use attached extras safely, pre-write config only at height 0, write after compat checks. Add helpers (reconcileCompatibility, persistChainConfigAndReload, logCompatibilityMismatch).
  • Dockerfile: Isolate optional local avalanchego without mixing with subnet-evm's build context. Prevents Docker builds from accidentally flattening avalanchego sources or failing on missing go.mod.
  • ci/scripts: sort RHS inputs to comm in build_test.sh and lint_allowed_eth_imports.sh to avoid input is not in sorted order
  • compatibility.json: Deterministically sort keys.

How this was tested

existing tests and successful build

Need to be documented?

no

Need to update RELEASES.md?

no

resolves #1779

Signed-off-by: Tsvetan Dimitrov ([email protected])

@powerslider powerslider requested review from a team and maru-ava as code owners October 6, 2025 11:36
…ego imports

resolves #17791

Signed-off-by: Tsvetan Dimitrov ([email protected])
@powerslider powerslider force-pushed the powerslider/1779-delete-customrawdb-package branch from 901b225 to 0825b78 Compare October 6, 2025 11:37
@powerslider powerslider marked this pull request as draft October 6, 2025 14:04
…ilize chain config I/O

- Alias libevm metrics import to evmmetrics and update usages to avoid symbol collision
with local metrics in the network and network/stats packages.
- Pass a copied extras object into customrawdb ReadChainConfig/WriteChainConfig to avoid data
races and shared-mutation bugs under new avalanchego versions.
- Also modify Dockerfile to isolate the avalanchego source to not become
  part of the build context of the main project.
- Revert the previous docker related changes.
@powerslider powerslider force-pushed the powerslider/1779-delete-customrawdb-package branch from a4b29c5 to 517b563 Compare October 6, 2025 21:51
- Read stored config using a local copy of extras to avoid data races.
- Still write using the attached extras to persist upgrade bytes.
- Re-read with a fresh copy for compatibility comparison.
…ocal avalanchego, sort comm inputs

- core/genesis:
    - Persist upgrade bytes only when height == 0, otherwise write after compatibility check passes.
    - Reconcile precompile-only incompatibilities by persisting upgrade metadata and proceeding.
- docker:
    - Only move and replace local avalanchego when it’s a standalone module (./avalanchego/go.mod), avoiding accidental source flattening.
- scripts:
    - Sort right-hand inputs to comm in build_test.sh and lint_allowed_eth_imports.sh to eliminate “comm: input is not in sorted order”.
@powerslider powerslider force-pushed the powerslider/1779-delete-customrawdb-package branch 3 times, most recently from a621e73 to 79557f4 Compare October 7, 2025 11:20
- Move ./avalanchego to /third_party if present.
- Always dropreplace first; conditionally add replace if go.mod exists.
- Run go mod tidy after edits.
@powerslider powerslider force-pushed the powerslider/1779-delete-customrawdb-package branch from 79557f4 to e9ecb8c Compare October 7, 2025 11:28
@powerslider powerslider self-assigned this Oct 7, 2025
@powerslider powerslider added the state-sync-migration Migration of state sync code to `avalanchego`. label Oct 7, 2025
@powerslider powerslider marked this pull request as ready for review October 7, 2025 11:50
@powerslider
Copy link
Contributor Author

Added a DO NOT MERGE label until ava-labs/avalanchego#4387 is merged.

@powerslider powerslider added the DO NOT MERGE This PR is not meant to be merged in its current state label Oct 8, 2025
@JonathanOppenheimer
Copy link
Member

I will review post AvalancheGo merger and when this PR is updated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DO NOT MERGE This PR is not meant to be merged in its current state state-sync-migration Migration of state sync code to `avalanchego`.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete customrawdb package after migration to avalanchego

2 participants