Skip to content

refactor: uplift combined warp package from evm repositories #4156

Open
JonathanOppenheimer wants to merge 72 commits intomasterfrom
uplift-evm-warp
Open

refactor: uplift combined warp package from evm repositories #4156
JonathanOppenheimer wants to merge 72 commits intomasterfrom
uplift-evm-warp

Conversation

@JonathanOppenheimer
Copy link
Member

@JonathanOppenheimer JonathanOppenheimer commented Aug 4, 2025

Why this should be merged

There are packages in subnet-evm and coreth that share a lot of functionality / are mirrored. These packages should be uplifted to AvalancheGo to prevent the duplicative maintenance of two sets of the same code. This is part of that effort. This would close #4129 .

How this works

This code represents the 'merged' difference of coreth/warp and subnet-evm/warp. The two packages diverged significantly, and deference was given to additions.

Key merges:

  • Used snowtest.Context() when snowctx is needed (defer to coreth)
  • When the ValidatorReader is needed, imported it from warptest
  • Deferred to verifier_stats.go from subnet-evm
  • Deferred to verifier_backend.go from subnet-evm
  • Deferred to backend_test.go from subnet-evm
  • Used libevm RPC

Note:

  • There are now 5 different Validator types, of varying similarity declared across AvalancheGo, from Stephen 5 years to Draco 3 months ago. This doesn’t seem clean to me.

Linting changes can be viewed standalone in 017a635

How this was tested

This is currently 'dead' code; after a new AvalancheGo release is dropped, we can use the code in the evm repositories.

Need to be documented in RELEASES.md?

No

@JonathanOppenheimer JonathanOppenheimer changed the title Initial merge uplift: Add combined warp package from evm repositories Aug 5, 2025
@joshua-kim joshua-kim moved this to Ready 🚦 in avalanchego Aug 18, 2025
@github-actions
Copy link

This PR has become stale because it has been open for 30 days with no activity. Adding the lifecycle/frozen label will cause this PR to ignore lifecycle events.

@github-actions github-actions bot added the lifecycle/stale Inactive for 60 days label Sep 21, 2025
@JonathanOppenheimer JonathanOppenheimer changed the title uplift: Add combined warp package from evm repositories uplift: add combined warp package from evm repositories Sep 24, 2025
@JonathanOppenheimer JonathanOppenheimer changed the title uplift: add combined warp package from evm repositories uplift: add combined warp package from evm repositories Sep 24, 2025
@github-actions github-actions bot removed the lifecycle/stale Inactive for 60 days label Sep 28, 2025
@JonathanOppenheimer JonathanOppenheimer self-assigned this Oct 28, 2025
@JonathanOppenheimer JonathanOppenheimer changed the title uplift: add combined warp package from evm repositories uplift combined warp package from evm repositories Oct 28, 2025
@JonathanOppenheimer JonathanOppenheimer marked this pull request as ready for review October 28, 2025 20:51
@JonathanOppenheimer
Copy link
Member Author

FYI: I plan to review this PR thoroughly myself first, i.e. leave comments etc. and clean it up before seeking external review. This PR is finally passing CI now though!

return fmt.Errorf("failed to put warp signature in db: %w", err)
}

if _, err := b.signMessage(unsignedMessage); err != nil {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if we put the message in the database but for whatever reason fail to sign the message and put it in the cache (I actually do not know)

@JonathanOppenheimer
Copy link
Member Author

Blocked by #4767

This is no longer blocked and ready for review.

// Avalanche Warp Messaging components
// Used to serve BLS signatures of warp messages over RPC
warpBackend warp.Backend
warpMsgDB *warp.DB
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When naming, a general guideline is to avoid having multiple names for the same logical concept unless we need to disambiguate - since this is a warp.DB we should call this warpDB rather than a warpMsgDB because there aren't other warp.DB's in this context.

If we find that consumers are frequently referring to a type in a common way it might suggest that the type needs renaming.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a variable called warpDB declared in the VM struct:

// [warpDB] is used to store warp message signatures
// set to a prefixDB with the prefix [warpPrefix]
warpDB database.Database

I assume Msg was added to differentiate these two databases.

@JonathanOppenheimer JonathanOppenheimer changed the title uplift combined warp package from evm repositories refactor: uplift combined warp package from evm repositories Jan 14, 2026
@joshua-kim
Copy link
Contributor

Marking as frozen -- this is no longer a current priority.

@JonathanOppenheimer JonathanOppenheimer moved this from In Progress 🏗️ to Backlog 🧊 in avalanchego Feb 6, 2026
@JonathanOppenheimer
Copy link
Member Author

Marking as frozen -- this is no longer a current priority.

Putting this in the backlog until we revisit it.

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

Labels

cleanup Code quality improvement evm Related to EVM functionality lifecycle/frozen

Projects

Status: Backlog 🧊

Development

Successfully merging this pull request may close these issues.

Uplift warp package

2 participants