8000 Remove legacy warp handlers by ceyonur · Pull Request #999 · ava-labs/coreth · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove legacy warp handlers #999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3430383
remove old handlers
ceyonur May 31, 2025
9fe5ffb
merge tests
ceyonur May 31, 2025
6b260fb
fix ineff err check
ceyonur May 31, 2025
5e9d4fe
Remove todo
ceyonur May 31, 2025
b11417b
update releases md
ceyonur May 31, 2025
1dafe40
Merge branch 'master' into remove-legacy-warp-handlers
ceyonur May 31, 2025
4ff9e2d
add warp tests for Coreth
ceyonur Jun 2, 2025
0e7579a
Merge branch 'remove-legacy-warp-handlers' of github.com:ava-labs/cor…
ceyonur Jun 2, 2025
9117f76
uncomment monitor
ceyonur Jun 2, 2025
f2bd399
fix linters
ceyonur Jun 2, 2025
66a9571
exclude tests dir in UT
ceyonur Jun 2, 2025
6c5f28e
use tmp dir
ceyonur Jun 2, 2025
142e4ad
fix paths
ceyonur Jun 2, 2025
b86f5d7
fix comments
ceyonur Jun 2, 2025
79afd95
use subnet-evm for warp tests
ceyonur Jun 2, 2025
cbc89b6
move subnet-evm to tmp
ceyonur Jun 2, 2025
b7bcb96
use different step to move
ceyonur Jun 2, 2025
7d59339
remove tokens
ceyonur Jun 2, 2025
a68f0d5
remove extra key file
ceyonur Jun 2, 2025
4279b23
remove subscriptions
ceyonur Jun 2, 2025
49201eb
Merge branch 'add-warp-tests' into remove-legacy-warp-handlers
ceyonur Jun 2, 2025
83ce6c7
add acp118 aggregator & move legacy aggregator to warp tests
ceyonur Jun 2, 2025
fc59c20
Merge branch 'master' into remove-legacy-warp-handlers
ceyonur Jun 27, 2025
dc2d0d4
rm ignored files
ceyonur Jun 27, 2025
fe79a5b
Merge branch 'master' into remove-legacy-warp-handlers
ceyonur Jun 27, 2025
64ce408
Update codec.go
ceyonur Jun 30, 2025
c4d2e65
fix linter
ceyonur Jul 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Add metrics for ACP-176
- Removed the `"price-options-max-base-fee"` config flag
- Moved extra types returned in `ethclient` package to a new package `plugin/evm/customethclient` which supports the same functionality as `ethclient` but with the new types registered in header and block.
- Removed legacy warp message handlers in favor of ACP-118 SDK handlers.

## [v0.15.0](https://github.com/ava-labs/coreth/releases/tag/v0.15.0)

Expand Down
11 changes: 5 additions & 6 deletions plugin/evm/message/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ func init() {
c.RegisterType(LeafsResponse{}),
c.RegisterType(CodeRequest{}),
c.RegisterType(CodeResponse{}),
)

// Warp request types
c.RegisterType(MessageSignatureRequest{}),
c.RegisterType(BlockSignatureRequest{}),
c.RegisterType(SignatureResponse{}),
// Deprecated Warp request/responde types are skipped
// See https://github.com/ava-labs/coreth/pull/999
c.SkipRegistrations(3)

Codec.RegisterCodec(Version, c),
)
Codec.RegisterCodec(Version, c)

if errs.Errored() {
panic(errs.Err)
Expand Down
10 changes: 0 additions & 10 deletions plugin/evm/message/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ type RequestHandler interface {
HandleLeafsRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, leafsRequest LeafsRequest) ([]byte, error)
HandleBlockRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, request BlockRequest) ([]byte, error)
HandleCodeRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, codeRequest CodeRequest) ([]byte, error)
HandleMessageSignatureRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, signatureRequest MessageSignatureRequest) ([]byte, error)
HandleBlockSignatureRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, signatureRequest BlockSignatureRequest) ([]byte, error)
}

// ResponseHandler handles response for a sent request
Expand All @@ -45,11 +43,3 @@ func (NoopRequestHandler) HandleBlockRequest(ctx context.Context, nodeID ids.Nod
func (NoopRequestHandler) HandleCodeRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, codeRequest CodeRequest) ([]byte, error) {
return nil, nil
}

func (NoopRequestHandler) HandleMessageSignatureRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, signatureRequest MessageSignatureRequest) ([]byte, error) {
return nil, nil
}

func (NoopRequestHandler) HandleBlockSignatureRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, signatureRequest BlockSignatureRequest) ([]byte, error) {
return nil, nil
}
49 changes: 0 additions & 49 deletions plugin/evm/message/signature_request.go

This file was deleted.

73 changes: 0 additions & 73 deletions plugin/evm/message/signature_request_test.go

This file was deleted.

23 changes: 6 additions & 17 deletions plugin/evm/network_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
syncHandlers "github.com/ava-labs/coreth/sync/handlers"
"github.com/ava-labs/coreth/sync/handlers/stats"
"github.com/ava-labs/coreth/warp"
warpHandlers "github.com/ava-labs/coreth/warp/handlers"
"github.com/ava-labs/libevm/ethdb"
"github.com/ava-labs/libevm/log"
"github.com/ava-labs/libevm/triedb"
Expand All @@ -23,10 +22,9 @@ var _ message.RequestHandler = (*networkHandler)(nil)
type LeafHandlers map[message.NodeType]syncHandlers.LeafRequestHandler

type networkHandler struct {
leafRequestHandlers LeafHandlers
blockRequestHandler *syncHandlers.BlockRequestHandler
codeRequestHandler *syncHandlers.CodeRequestHandler
signatureRequestHandler *warpHandlers.SignatureRequestHandler
leafRequestHandlers LeafHandlers
blockRequestHandler *syncHandlers.BlockRequestHandler
codeRequestHandler *syncHandlers.CodeRequestHandler
}

type LeafRequestTypeConfig struct {
Expand All @@ -47,10 +45,9 @@ func newNetworkHandler(
syncStats stats.HandlerStats,
) *networkHandler {
return &networkHandler{
leafRequestHandlers: leafRequestHandlers,
blockRequestHandler: syncHandlers.NewBlockRequestHandler(provider, networkCodec, syncStats),
codeRequestHandler: syncHandlers.NewCodeRequestHandler(diskDB, networkCodec, syncStats),
signatureRequestHandler: warpHandlers.NewSignatureRequestHandler(warpBackend, networkCodec),
leafRequestHandlers: leafRequestHandlers,
blockRequestHandler: syncHandlers.NewBlockRequestHandler(provider, networkCodec, syncStats),
codeRequestHandler: syncHandlers.NewCodeRequestHandler(diskDB, networkCodec, syncStats),
}
}

Expand All @@ -70,11 +67,3 @@ func (n networkHandler) HandleBlockRequest(ctx context.Context, nodeID ids.NodeI
func (n networkHandler) HandleCodeRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, codeRequest message.CodeRequest) ([]byte, error) {
return n.codeRequestHandler.OnCodeRequest(ctx, nodeID, requestID, codeRequest)
}

func (n networkHandler) HandleMessageSignatureRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, messageSignatureRequest message.MessageSignatureRequest) ([]byte, error) {
return n.signatureRequestHandler.OnMessageSignatureRequest(ctx, nodeID, requestID, messageSignatureRequest)
}

func (n networkHandler) HandleBlockSignatureRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, blockSignatureRequest message.BlockSignatureRequest) ([]byte, error) {
return n.signatureRequestHandler.OnBlockSignatureRequest(ctx, nodeID, requestID, blockSignatureRequest)
}
6 changes: 4 additions & 2 deletions plugin/evm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -1091,8 +1091,10 @@ func (vm *VM) CreateHandlers(context.Context) (map[string]http.Handler, error) {
}

if vm.config.WarpAPIEnabled {
warpAPI := warp.NewAPI(vm.ctx, vm.networkCodec, vm.warpBackend, vm.Network, vm.requirePrimaryNetworkSigners)
if err := handler.RegisterName("warp", warpAPI); err != nil {
warpSDKClient := vm.Network.NewClient(p2p.SignatureRequestHandlerID)
signatureAggregator := acp118.NewSignatureAggregator(vm.ctx.Log, warpSDKClient)

if err := handler.RegisterName("warp", warp.NewAPI(vm.ctx, vm.warpBackend, signatureAggregator, vm.requirePrimaryNetworkSigners)); err != nil {
return nil, err
}
enabledAPIs = append(enabledAPIs, "warp")
Expand Down
Loading
Loading
0