-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
F3#GetManifest can panic #12772
Comments
Note, manifest can only be nil in dynamic manifest provider: the mechanism that makes passive testing possible. In dynamic manifest provider, there is an option which sets the initial manifest, i.e. the one to use if no other manifest is broadcasted via the manifest server. I see this option is indeed set in Lotus if static manifest is non-nil. My question is then: under what condition static manifest is set to nil? @rvagg do you have a test that reproduces this in a tagged release? |
func TestManifestNil(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs())
ens.InterconnectAll().BeginMining(2 * time.Millisecond)
ens.Start()
client.WaitTillChain(ctx, kit.HeightAtLeast(10))
manifest, err := client.F3GetManifest(ctx)
require.NoError(t, err)
require.NotNil(t, manifest)
}
|
Thanks. Looks like if :
then get manifest will return nil. This seems to be by design and diverges from my earlier understanding. Note that in itests, f3 is disabled by default with a dedicated In terms of next steps: probably the safest thing to do is to make sure |
lotus/chain/lf3/f3.go
Lines 187 to 189 in 9bfd0b4
It's possible currently for the inner call,
f3.F3#Manifest()
to return anil
. Apparently this shouldn't be possible, it should always fall back to the static manifest which is available at compile time: https://github.com/filecoin-project/lotus/pull/12762/files#r1878043815Unfortunately the current architecture of go-f3's
F3
is that it's initialised with anil
manifest, then it has to firstStart()
and then has to get its first update from theManifestProvider
before it's set. So callingGetManifest()
here before that happens can result in a panic, which can happen in itests when F3 is not properly set up.This should either be guarded here, or fixed in go-f3.
The text was updated successfully, but these errors were encountered: