Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Common: Serialization for EpochVoteSubmissions #97

Closed
adlrocha opened this issue Apr 20, 2023 · 0 comments · Fixed by #100
Closed

Common: Serialization for EpochVoteSubmissions #97

adlrocha opened this issue Apr 20, 2023 · 0 comments · Fixed by #100
Assignees
Labels

Comments

@adlrocha
Copy link
Contributor

Related: consensus-shipyard/ipc-libs#170

Background

The call to ValidatorHasVoted in Lotus is broken because the when an EpochVoteSubmissions is set but the checkpoint hasn't been executed, this line tries to get the object out of the HAMT and the serialization fails because it is not able to resolve the CID for the object or one of the internal CIDs set in the object. We receive the following error:

2023-04-20T16:30:49.944+0200    WARN    rpc     go-jsonrpc@v0.2.3/handler.go:406        error in RPC call to 'Filecoin.IPCHasVotedTopDownCheckpoint': error checking if validator has voted top-down checkpoint:
    github.com/filecoin-project/lotus/node/impl/ipc.(*IPCAPI).IPCHasVotedTopDownCheckpoint
        /home/workspace/pl/lotus/node/impl/ipc/ipc.go:236
  - failed to get key bafy2bzacea2dlrhxmbp5thuszzeirndwhu6snfvppzcp632iyizt3rylsanok in node
                                                                                             :
    github.com/filecoin-project/specs-actors/v7/actors/util/adt.(*Map).Get
        /home/adlrocha/go/pkg/mod/github.com/filecoin-project/specs-actors/v7@v7.0.1/actors/util/adt/map.go:98
  - expected byte array

What we want to take out of the object is the submitters, i.e. check if a validator has voted.

Solution

We would have to test it a bit more, it is not clear to me if the error of not finding the CID is because when we initialize the EpochVoteSubmissions the hamt is not flushed and thus not found in the datastore. The same issue may be here. Or if there is something sketchy with this.

Ideally we should trace and replicate the error to see what happens. The easiest way of replicating is to have two validators, have one of the validators vote for a checkpoint and certain epoch, and then from any of the validators check if it has voted the checkpoint to force it fetch an EpochVoteSubmissions. This needs to be tested through Lotus. This can probably be easily replicated by directly writing a test similar to this one

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants