From 244eb9a3369d3e684f65cdee8bac79ac8c83602c Mon Sep 17 00:00:00 2001 From: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:45:42 -0400 Subject: [PATCH] rename registry -> codec Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> --- api/dependencies.go | 6 +-- api/jsonrpc/client.go | 4 +- api/jsonrpc/server.go | 12 ++--- api/ws/server.go | 26 +++++----- chain/block.go | 4 +- chain/dependencies.go | 6 +-- chain/transaction.go | 24 +++++----- chain/transaction_test.go | 12 ++--- docs/tutorials/morpheusvm/options.md | 6 +-- examples/morpheusvm/vm/client.go | 6 +-- examples/vmwithcontracts/vm/client.go | 6 +-- internal/gossiper/dependencies.go | 4 +- internal/gossiper/manual.go | 4 +- internal/gossiper/proposer.go | 4 +- tests/integration/integration.go | 4 +- vm/defaultvm/vm.go | 12 ++--- vm/network_tx_gossip.go | 69 ++++----------------------- vm/resolutions.go | 12 ++--- vm/vm.go | 18 +++---- 19 files changed, 95 insertions(+), 144 deletions(-) diff --git a/api/dependencies.go b/api/dependencies.go index 874be7d6cb..ee9856ea4d 100644 --- a/api/dependencies.go +++ b/api/dependencies.go @@ -25,9 +25,9 @@ type VM interface { SubnetID() ids.ID Tracer() trace.Tracer Logger() logging.Logger - ActionRegistry() *codec.TypeParser[chain.Action] - OutputRegistry() *codec.TypeParser[codec.Typed] - AuthRegistry() *codec.TypeParser[chain.Auth] + ActionCodec() *codec.TypeParser[chain.Action] + OutputCodec() *codec.TypeParser[codec.Typed] + AuthCodec() *codec.TypeParser[chain.Auth] Rules(t int64) chain.Rules Submit( ctx context.Context, diff --git a/api/jsonrpc/client.go b/api/jsonrpc/client.go index 54e89d9f2e..012ad588fc 100644 --- a/api/jsonrpc/client.go +++ b/api/jsonrpc/client.go @@ -169,9 +169,9 @@ func (cli *JSONRPCClient) GenerateTransactionManual( } // Build transaction - actionRegistry, authRegistry := parser.ActionRegistry(), parser.AuthRegistry() + actionCodec, authCodec := parser.ActionCodec(), parser.AuthCodec() tx := chain.NewTx(base, actions) - tx, err := tx.Sign(authFactory, actionRegistry, authRegistry) + tx, err := tx.Sign(authFactory, actionCodec, authCodec) if err != nil { return nil, nil, fmt.Errorf("%w: failed to sign transaction", err) } diff --git a/api/jsonrpc/server.go b/api/jsonrpc/server.go index 39bbf7629e..5c060b1dd3 100644 --- a/api/jsonrpc/server.go +++ b/api/jsonrpc/server.go @@ -88,9 +88,9 @@ func (j *JSONRPCServer) SubmitTx( ctx, span := j.vm.Tracer().Start(req.Context(), "JSONRPCServer.SubmitTx") defer span.End() - actionRegistry, authRegistry := j.vm.ActionRegistry(), j.vm.AuthRegistry() + actionCodec, authCodec := j.vm.ActionCodec(), j.vm.AuthCodec() rtx := codec.NewReader(args.Tx, consts.NetworkSizeLimit) // will likely be much smaller than this - tx, err := chain.UnmarshalTx(rtx, actionRegistry, authRegistry) + tx, err := chain.UnmarshalTx(rtx, actionCodec, authCodec) if err != nil { return fmt.Errorf("%w: unable to unmarshal on public service", err) } @@ -151,8 +151,8 @@ type GetABIReply struct { } func (j *JSONRPCServer) GetABI(_ *http.Request, _ *GetABIArgs, reply *GetABIReply) error { - actionRegistry, outputRegistry := j.vm.ActionRegistry(), j.vm.OutputRegistry() - vmABI, err := abi.NewABI(actionRegistry.GetRegisteredTypes(), (*outputRegistry).GetRegisteredTypes()) + actionCodec, outputCodec := j.vm.ActionCodec(), j.vm.OutputCodec() + vmABI, err := abi.NewABI(actionCodec.GetRegisteredTypes(), (*outputCodec).GetRegisteredTypes()) if err != nil { return err } @@ -178,8 +178,8 @@ func (j *JSONRPCServer) Execute( ctx, span := j.vm.Tracer().Start(req.Context(), "JSONRPCServer.ExecuteAction") defer span.End() - actionRegistry := j.vm.ActionRegistry() - action, err := actionRegistry.Unmarshal(codec.NewReader(args.Action, len(args.Action))) + actionCodec := j.vm.ActionCodec() + action, err := actionCodec.Unmarshal(codec.NewReader(args.Action, len(args.Action))) if err != nil { return fmt.Errorf("failed to unmashal action: %w", err) } diff --git a/api/ws/server.go b/api/ws/server.go index c4896f3ff3..095957a751 100644 --- a/api/ws/server.go +++ b/api/ws/server.go @@ -55,13 +55,13 @@ func OptionFunc(v *vm.VM, config Config) error { return nil } - actionRegistry, authRegistry := v.ActionRegistry(), v.AuthRegistry() + actionCodec, authCodec := v.ActionCodec(), v.AuthCodec() server, handler := NewWebSocketServer( v, v.Logger(), v.Tracer(), - actionRegistry, - authRegistry, + actionCodec, + authCodec, config.MaxPendingMessages, ) @@ -103,11 +103,11 @@ func (w WebSocketServerFactory) New(api.VM) (api.Handler, error) { } type WebSocketServer struct { - vm api.VM - logger logging.Logger - tracer trace.Tracer - actionRegistry *codec.TypeParser[chain.Action] - authRegistry *codec.TypeParser[chain.Auth] + vm api.VM + logger logging.Logger + tracer trace.Tracer + actionCodec *codec.TypeParser[chain.Action] + authCodec *codec.TypeParser[chain.Auth] s *pubsub.Server @@ -122,16 +122,16 @@ func NewWebSocketServer( vm api.VM, log logging.Logger, tracer trace.Tracer, - actionRegistry *codec.TypeParser[chain.Action], - authRegistry *codec.TypeParser[chain.Auth], + actionCodec *codec.TypeParser[chain.Action], + authCodec *codec.TypeParser[chain.Auth], maxPendingMessages int, ) (*WebSocketServer, *pubsub.Server) { w := &WebSocketServer{ vm: vm, logger: log, tracer: tracer, - actionRegistry: actionRegistry, - authRegistry: authRegistry, + actionCodec: actionCodec, + authCodec: authCodec, blockListeners: pubsub.NewConnections(), txListeners: map[ids.ID]*pubsub.Connections{}, expiringTxs: emap.NewEMap[*chain.Transaction](), @@ -253,7 +253,7 @@ func (w *WebSocketServer) MessageCallback() pubsub.Callback { msgBytes = msgBytes[1:] // Unmarshal TX p := codec.NewReader(msgBytes, consts.NetworkSizeLimit) // will likely be much smaller - tx, err := chain.UnmarshalTx(p, w.actionRegistry, w.authRegistry) + tx, err := chain.UnmarshalTx(p, w.actionCodec, w.authCodec) if err != nil { w.logger.Error("failed to unmarshal tx", zap.Int("len", len(msgBytes)), diff --git a/chain/block.go b/chain/block.go index a23b01cd1d..6ab04f9eb7 100644 --- a/chain/block.go +++ b/chain/block.go @@ -113,11 +113,11 @@ func UnmarshalBlock(raw []byte, parser Parser) (*StatelessBlock, error) { // Parse transactions txCount := p.UnpackInt(false) // can produce empty blocks - actionRegistry, authRegistry := parser.ActionRegistry(), parser.AuthRegistry() + actionCodec, authCodec := parser.ActionCodec(), parser.AuthCodec() b.Txs = []*Transaction{} // don't preallocate all to avoid DoS b.authCounts = map[uint8]int{} for i := uint32(0); i < txCount; i++ { - tx, err := UnmarshalTx(p, actionRegistry, authRegistry) + tx, err := UnmarshalTx(p, actionCodec, authCodec) if err != nil { return nil, err } diff --git a/chain/dependencies.go b/chain/dependencies.go index 2e0d215d84..280671d8e9 100644 --- a/chain/dependencies.go +++ b/chain/dependencies.go @@ -23,9 +23,9 @@ import ( type Parser interface { Rules(int64) Rules - ActionRegistry() *codec.TypeParser[Action] - OutputRegistry() *codec.TypeParser[codec.Typed] - AuthRegistry() *codec.TypeParser[Auth] + ActionCodec() *codec.TypeParser[Action] + OutputCodec() *codec.TypeParser[codec.Typed] + AuthCodec() *codec.TypeParser[Auth] } type Metrics interface { diff --git a/chain/transaction.go b/chain/transaction.go index f435bd49e1..aace2a2b85 100644 --- a/chain/transaction.go +++ b/chain/transaction.go @@ -75,8 +75,8 @@ func (t *Transaction) Digest() ([]byte, error) { func (t *Transaction) Sign( factory AuthFactory, - actionRegistry *codec.TypeParser[Action], - authRegistry *codec.TypeParser[Auth], + actionCodec *codec.TypeParser[Action], + authCodec *codec.TypeParser[Auth], ) (*Transaction, error) { msg, err := t.Digest() if err != nil { @@ -99,7 +99,7 @@ func (t *Transaction) Sign( return nil, err } p = codec.NewReader(p.Bytes(), consts.MaxInt) - return UnmarshalTx(p, actionRegistry, authRegistry) + return UnmarshalTx(p, actionCodec, authCodec) } func (t *Transaction) Bytes() []byte { return t.bytes } @@ -416,15 +416,15 @@ func MarshalTxs(txs []*Transaction) ([]byte, error) { func UnmarshalTxs( raw []byte, initialCapacity int, - actionRegistry *codec.TypeParser[Action], - authRegistry *codec.TypeParser[Auth], + actionCodec *codec.TypeParser[Action], + authCodec *codec.TypeParser[Auth], ) (map[uint8]int, []*Transaction, error) { p := codec.NewReader(raw, consts.NetworkSizeLimit) txCount := p.UnpackInt(true) authCounts := map[uint8]int{} txs := make([]*Transaction, 0, initialCapacity) // DoS to set size to txCount for i := uint32(0); i < txCount; i++ { - tx, err := UnmarshalTx(p, actionRegistry, authRegistry) + tx, err := UnmarshalTx(p, actionCodec, authCodec) if err != nil { return nil, nil, err } @@ -440,20 +440,20 @@ func UnmarshalTxs( func UnmarshalTx( p *codec.Packer, - actionRegistry *codec.TypeParser[Action], - authRegistry *codec.TypeParser[Auth], + actionCodec *codec.TypeParser[Action], + authCodec *codec.TypeParser[Auth], ) (*Transaction, error) { start := p.Offset() base, err := UnmarshalBase(p) if err != nil { return nil, fmt.Errorf("%w: could not unmarshal base", err) } - actions, err := unmarshalActions(p, actionRegistry) + actions, err := unmarshalActions(p, actionCodec) if err != nil { return nil, fmt.Errorf("%w: could not unmarshal actions", err) } digest := p.Offset() - auth, err := authRegistry.Unmarshal(p) + auth, err := authCodec.Unmarshal(p) if err != nil { return nil, fmt.Errorf("%w: could not unmarshal auth", err) } @@ -483,7 +483,7 @@ func UnmarshalTx( func unmarshalActions( p *codec.Packer, - actionRegistry *codec.TypeParser[Action], + actionCodec *codec.TypeParser[Action], ) ([]Action, error) { actionCount := p.UnpackByte() if actionCount == 0 { @@ -491,7 +491,7 @@ func unmarshalActions( } actions := []Action{} for i := uint8(0); i < actionCount; i++ { - action, err := actionRegistry.Unmarshal(p) + action, err := actionCodec.Unmarshal(p) if err != nil { return nil, fmt.Errorf("%w: could not unmarshal action", err) } diff --git a/chain/transaction_test.go b/chain/transaction_test.go index 4be7c016da..50a692683a 100644 --- a/chain/transaction_test.go +++ b/chain/transaction_test.go @@ -105,17 +105,17 @@ func TestMarshalUnmarshal(t *testing.T) { require.NoError(err) factory := auth.NewED25519Factory(priv) - actionRegistry := codec.NewTypeParser[chain.Action]() - authRegistry := codec.NewTypeParser[chain.Auth]() + actionCodec := codec.NewTypeParser[chain.Action]() + authCodec := codec.NewTypeParser[chain.Auth]() - err = authRegistry.Register(&auth.ED25519{}, auth.UnmarshalED25519) + err = authCodec.Register(&auth.ED25519{}, auth.UnmarshalED25519) require.NoError(err) - err = actionRegistry.Register(&mockTransferAction{}, unmarshalTransfer) + err = actionCodec.Register(&mockTransferAction{}, unmarshalTransfer) require.NoError(err) - err = actionRegistry.Register(&action2{}, unmarshalAction2) + err = actionCodec.Register(&action2{}, unmarshalAction2) require.NoError(err) - signedTx, err := tx.Sign(factory, actionRegistry, authRegistry) + signedTx, err := tx.Sign(factory, actionCodec, authCodec) require.NoError(err) require.Equal(len(signedTx.Actions), len(tx.Actions)) diff --git a/docs/tutorials/morpheusvm/options.md b/docs/tutorials/morpheusvm/options.md index e83b9300b2..4f706d1708 100644 --- a/docs/tutorials/morpheusvm/options.md +++ b/docs/tutorials/morpheusvm/options.md @@ -266,15 +266,15 @@ func (p *Parser) Rules(_ int64) chain.Rules { return p.genesis.Rules } -func (*Parser) ActionRegistry() chain.ActionRegistry { +func (*Parser) ActionCodec() chain.ActionCodec { return ActionParser } -func (*Parser) OutputRegistry() chain.OutputRegistry { +func (*Parser) OutputCodec() chain.OutputCodec { return OutputParser } -func (*Parser) AuthRegistry() chain.AuthRegistry { +func (*Parser) AuthCodec() chain.AuthCodec { return AuthParser } diff --git a/examples/morpheusvm/vm/client.go b/examples/morpheusvm/vm/client.go index e5b1cc218f..de4690d753 100644 --- a/examples/morpheusvm/vm/client.go +++ b/examples/morpheusvm/vm/client.go @@ -106,15 +106,15 @@ func (p *Parser) Rules(_ int64) chain.Rules { return p.genesis.Rules } -func (*Parser) ActionRegistry() *codec.TypeParser[chain.Action] { +func (*Parser) ActionCodec() *codec.TypeParser[chain.Action] { return ActionParser } -func (*Parser) OutputRegistry() *codec.TypeParser[chain.Output] { +func (*Parser) OutputCodec() *codec.TypeParser[chain.Output] { return OutputParser } -func (*Parser) AuthRegistry() *codec.TypeParser[chain.Auth] { +func (*Parser) AuthCodec() *codec.TypeParser[chain.Auth] { return AuthParser } diff --git a/examples/vmwithcontracts/vm/client.go b/examples/vmwithcontracts/vm/client.go index aadec9c22d..661e5f84c7 100644 --- a/examples/vmwithcontracts/vm/client.go +++ b/examples/vmwithcontracts/vm/client.go @@ -109,15 +109,15 @@ func (p *Parser) Rules(_ int64) chain.Rules { return p.genesis.Rules } -func (*Parser) ActionRegistry() *codec.TypeParser[chain.Action] { +func (*Parser) ActionCodec() *codec.TypeParser[chain.Action] { return ActionParser } -func (*Parser) OutputRegistry() *codec.TypeParser[codec.Typed] { +func (*Parser) OutputCodec() *codec.TypeParser[codec.Typed] { return OutputParser } -func (*Parser) AuthRegistry() *codec.TypeParser[chain.Auth] { +func (*Parser) AuthCodec() *codec.TypeParser[chain.Auth] { return AuthParser } diff --git a/internal/gossiper/dependencies.go b/internal/gossiper/dependencies.go index dc408a3378..555fe0cfc0 100644 --- a/internal/gossiper/dependencies.go +++ b/internal/gossiper/dependencies.go @@ -27,8 +27,8 @@ type VM interface { IsValidator(context.Context, ids.NodeID) (bool, error) Logger() logging.Logger PreferredBlock(context.Context) (*chain.StatefulBlock, error) - ActionRegistry() *codec.TypeParser[chain.Action] - AuthRegistry() *codec.TypeParser[chain.Auth] + ActionCodec() *codec.TypeParser[chain.Action] + AuthCodec() *codec.TypeParser[chain.Auth] NodeID() ids.NodeID Rules(int64) chain.Rules Submit(ctx context.Context, verify bool, txs []*chain.Transaction) []error diff --git a/internal/gossiper/manual.go b/internal/gossiper/manual.go index 4a34919d1a..73cd163791 100644 --- a/internal/gossiper/manual.go +++ b/internal/gossiper/manual.go @@ -85,8 +85,8 @@ func (g *Manual) Force(ctx context.Context) error { } func (g *Manual) HandleAppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error { - actionRegistry, authRegistry := g.vm.ActionRegistry(), g.vm.AuthRegistry() - _, txs, err := chain.UnmarshalTxs(msg, initialCapacity, actionRegistry, authRegistry) + actionCodec, authCodec := g.vm.ActionCodec(), g.vm.AuthCodec() + _, txs, err := chain.UnmarshalTxs(msg, initialCapacity, actionCodec, authCodec) if err != nil { g.vm.Logger().Warn( "AppGossip provided invalid txs", diff --git a/internal/gossiper/proposer.go b/internal/gossiper/proposer.go index 329dbcf450..0ba943c542 100644 --- a/internal/gossiper/proposer.go +++ b/internal/gossiper/proposer.go @@ -162,8 +162,8 @@ func (g *Proposer) Force(ctx context.Context) error { } func (g *Proposer) HandleAppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error { - actionRegistry, authRegistry := g.vm.ActionRegistry(), g.vm.AuthRegistry() - authCounts, txs, err := chain.UnmarshalTxs(msg, initialCapacity, actionRegistry, authRegistry) + actionCodec, authCodec := g.vm.ActionCodec(), g.vm.AuthCodec() + authCounts, txs, err := chain.UnmarshalTxs(msg, initialCapacity, actionCodec, authCodec) if err != nil { g.vm.Logger().Warn( "received invalid txs", diff --git a/tests/integration/integration.go b/tests/integration/integration.go index acdcfbd040..daec49e5ca 100644 --- a/tests/integration/integration.go +++ b/tests/integration/integration.go @@ -305,8 +305,8 @@ var _ = ginkgo.Describe("[HyperSDK APIs]", func() { ginkgo.It("GetABI", func() { ginkgo.By("Gets ABI") - actionRegistry, outputRegistry := instances[0].vm.ActionRegistry(), instances[0].vm.OutputRegistry() - expectedABI, err := abi.NewABI(actionRegistry.GetRegisteredTypes(), (*outputRegistry).GetRegisteredTypes()) + actionCodec, outputCodec := instances[0].vm.ActionCodec(), instances[0].vm.OutputCodec() + expectedABI, err := abi.NewABI(actionCodec.GetRegisteredTypes(), (*outputCodec).GetRegisteredTypes()) require.NoError(err) workload.GetABI(ctx, require, uris, expectedABI) diff --git a/vm/defaultvm/vm.go b/vm/defaultvm/vm.go index a0851aca7e..323ceba7b0 100644 --- a/vm/defaultvm/vm.go +++ b/vm/defaultvm/vm.go @@ -36,9 +36,9 @@ func New( v *version.Semantic, genesisFactory genesis.GenesisAndRuleFactory, stateManager chain.StateManager, - actionRegistry *codec.TypeParser[chain.Action], - authRegistry *codec.TypeParser[chain.Auth], - outputRegistry *codec.TypeParser[codec.Typed], + actionCodec *codec.TypeParser[chain.Action], + authCodec *codec.TypeParser[chain.Auth], + outputCodec *codec.TypeParser[codec.Typed], authEngine map[uint8]vm.AuthEngine, options ...vm.Option, ) (*vm.VM, error) { @@ -47,9 +47,9 @@ func New( v, genesisFactory, stateManager, - actionRegistry, - authRegistry, - outputRegistry, + actionCodec, + authCodec, + outputCodec, authEngine, options..., ) diff --git a/vm/network_tx_gossip.go b/vm/network_tx_gossip.go index 83cd31d98f..4dbf5b5a83 100644 --- a/vm/network_tx_gossip.go +++ b/vm/network_tx_gossip.go @@ -5,79 +5,30 @@ package vm import ( "context" - "time" "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/version" + "github.com/ava-labs/avalanchego/network/p2p" "go.uber.org/zap" ) +var _ p2p.Handler = (*TxGossipHandler)(nil) + type TxGossipHandler struct { + p2p.NoOpHandler vm *VM } func NewTxGossipHandler(vm *VM) *TxGossipHandler { - return &TxGossipHandler{vm} -} - -func (*TxGossipHandler) Connected(context.Context, ids.NodeID, *version.Application) error { - return nil -} - -func (*TxGossipHandler) Disconnected(context.Context, ids.NodeID) error { - return nil + return &TxGossipHandler{vm: vm} } -func (t *TxGossipHandler) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error { +func (t *TxGossipHandler) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) { if !t.vm.isReady() { t.vm.snowCtx.Log.Warn("handle app gossip failed", zap.Error(ErrNotReady)) - return nil + return } - return t.vm.gossiper.HandleAppGossip(ctx, nodeID, msg) -} - -func (*TxGossipHandler) AppRequest( - context.Context, - ids.NodeID, - uint32, - time.Time, - []byte, -) error { - return nil -} - -func (*TxGossipHandler) AppRequestFailed( - context.Context, - ids.NodeID, - uint32, -) error { - return nil -} - -func (*TxGossipHandler) AppResponse( - context.Context, - ids.NodeID, - uint32, - []byte, -) error { - return nil -} - -func (*TxGossipHandler) CrossChainAppRequest( - context.Context, - ids.ID, - uint32, - time.Time, - []byte, -) error { - return nil -} - -func (*TxGossipHandler) CrossChainAppRequestFailed(context.Context, ids.ID, uint32) error { - return nil -} - -func (*TxGossipHandler) CrossChainAppResponse(context.Context, ids.ID, uint32, []byte) error { - return nil + if t.vm.gossiper.HandleAppGossip(ctx, nodeID, msg); err != nil { + t.vm.snowCtx.Log.Warn("handle app gossip failed", zap.Error(err)) + } } diff --git a/vm/resolutions.go b/vm/resolutions.go index eb7963d8b2..aaf717a9dc 100644 --- a/vm/resolutions.go +++ b/vm/resolutions.go @@ -51,16 +51,16 @@ func (vm *VM) SubnetID() ids.ID { return vm.snowCtx.SubnetID } -func (vm *VM) ActionRegistry() *codec.TypeParser[chain.Action] { - return vm.actionRegistry +func (vm *VM) ActionCodec() *codec.TypeParser[chain.Action] { + return vm.actionCodec } -func (vm *VM) OutputRegistry() *codec.TypeParser[codec.Typed] { - return vm.outputRegistry +func (vm *VM) OutputCodec() *codec.TypeParser[codec.Typed] { + return vm.outputCodec } -func (vm *VM) AuthRegistry() *codec.TypeParser[chain.Auth] { - return vm.authRegistry +func (vm *VM) AuthCodec() *codec.TypeParser[chain.Auth] { + return vm.authCodec } func (vm *VM) AuthVerifiers() workers.Workers { diff --git a/vm/vm.go b/vm/vm.go index 1dd81e6fd4..32c12a3329 100644 --- a/vm/vm.go +++ b/vm/vm.go @@ -91,9 +91,9 @@ type VM struct { vmDB database.Database handlers map[string]http.Handler stateManager chain.StateManager - actionRegistry *codec.TypeParser[chain.Action] - authRegistry *codec.TypeParser[chain.Auth] - outputRegistry *codec.TypeParser[codec.Typed] + actionCodec *codec.TypeParser[chain.Action] + authCodec *codec.TypeParser[chain.Auth] + outputCodec *codec.TypeParser[codec.Typed] authEngine map[uint8]AuthEngine tracer avatrace.Tracer @@ -151,9 +151,9 @@ func New( v *version.Semantic, genesisFactory genesis.GenesisAndRuleFactory, stateManager chain.StateManager, - actionRegistry *codec.TypeParser[chain.Action], - authRegistry *codec.TypeParser[chain.Auth], - outputRegistry *codec.TypeParser[codec.Typed], + actionCodec *codec.TypeParser[chain.Action], + authCodec *codec.TypeParser[chain.Auth], + outputCodec *codec.TypeParser[codec.Typed], authEngine map[uint8]AuthEngine, options ...Option, ) (*VM, error) { @@ -169,9 +169,9 @@ func New( v: v, stateManager: stateManager, config: NewConfig(), - actionRegistry: actionRegistry, - authRegistry: authRegistry, - outputRegistry: outputRegistry, + actionCodec: actionCodec, + authCodec: authCodec, + outputCodec: outputCodec, authEngine: authEngine, genesisAndRuleFactory: genesisFactory, options: options,