mirror of
https://github.com/luxfi/evmgpu.git
synced 2026-10-30 16:57:11 +00:00
Mirrors luxfi/evm Wave 1C cascade. 18 files. Same migration patterns:
plugin/evm/message/codec.go local Manager interface, sync/* swap,
customrawdb/* + validators/state/* hand-rolled binary, vm.go +
network.go + plugin/evm/network_handler.go call-site fixups, plus
core/parallel/gpu_{ecrecover,evm}.go GPU dispatch wiring.
Builds clean: go build ./...
36 lines
1.1 KiB
Go
36 lines
1.1 KiB
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package message
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/luxfi/ids"
|
|
)
|
|
|
|
// Request represents a Network request type
|
|
type Request interface {
|
|
// Requests should implement String() for logging.
|
|
fmt.Stringer
|
|
|
|
// Handle allows `Request` to call respective methods on handler to handle
|
|
// this particular request type
|
|
Handle(ctx context.Context, nodeID ids.NodeID, requestID uint32, handler RequestHandler) ([]byte, error)
|
|
}
|
|
|
|
// RequestMarshaler is the minimal surface RequestToBytes needs from the
|
|
// package codec. The concrete *manager satisfies it; callers should pass
|
|
// [Codec].
|
|
type RequestMarshaler interface {
|
|
Marshal(version uint16, source interface{}) ([]byte, error)
|
|
}
|
|
|
|
// RequestToBytes marshals the given request object into bytes. The
|
|
// `marshaler` argument exists for symmetry with the legacy codec.Manager
|
|
// signature; in-tree callers always pass [Codec].
|
|
func RequestToBytes(marshaler RequestMarshaler, request Request) ([]byte, error) {
|
|
return marshaler.Marshal(Version, &request)
|
|
}
|