Skip to content

RPCChainVM Improvements #3631

Open
Open
@aaronbuchwald

Description

@aaronbuchwald

The RPCChainVM allows AvalancheGo to run a VM over gRPC rather than being registered within the AvalancheGo binary.

There are a few features or expectations that the RPCChainVM does not maintain that should either be fixed or explicitly documented for VM developers.

Discrepancies

Snow Ctx Lock

The snow context lock is held by the consensus engine while processing any message except for explicitly async App-specific messages. However, this lock is not transmitted over gRPC.

You can see the *snow.Context type created and passed in to the VM server is not populated, which provides a fresh default value for the lock that is unrelated to the lock held by the consensus engine:

if err := vm.vm.Initialize(ctx, vm.ctx, vm.db, req.GenesisBytes, req.UpgradeBytes, req.ConfigBytes, toEngine, nil, appSenderClient); err != nil {

Snow Log

The log passed in to the VM is always configured at the info level:

// TODO: Allow the logger to be configured by the client

Ideally, this would inherit the log level from AvalancheGo by default. Alternatively, we should make it explicit that it's disconnected from AvalancheGo and the VM must configure the log level itself.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions