-
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
feat(f3): f3-activation-contract integration #12861
base: master
Are you sure you want to change the base?
Conversation
It has no chance of working on lite nodes right now Signed-off-by: Jakub Sztandera <[email protected]>
Includes shed tool for debuging, the tool could be re-written to use the the ContractManifestProvider. Integration of ContractManifestProvider into the existing manifest pipeline is missing. Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
89275bd
to
f41783e
Compare
Signed-off-by: Jakub Sztandera <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the PR title to match https://github.com/filecoin-project/lotus/blob/master/CONTRIBUTING.md#pr-title-conventions
PR title now matches the required format.
…essManifest` Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
@@ -84,6 +88,7 @@ func NewConfig(nn dtypes.NetworkName) *Config { | |||
PrioritizeStaticManifest: true, | |||
DynamicManifestProvider: buildconstants.F3ManifestServerID, | |||
AllowDynamicFinalize: false, | |||
ContractPollInterval: 15 * time.Minute, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking out-loud: would we ever want to change this in passive testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might, you are right for faster iteration speed
} else if config.ContractAddress != "" { | ||
primaryManifest, err = NewContractManifestProvider(mctx, config, stateCaller) | ||
} | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to have an info log somewhere that logs whether the primary manifest ended up being Contract or Static.
address string | ||
networkName gpbft.NetworkName | ||
stateCaller StateCaller | ||
PollInterval time.Duration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this field exported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was from before I had the poll interval in the config to be used by the shed utility
if len(cmp.address) == 0 { | ||
// close the channel so fusing provider knows we have nothing | ||
close(cmp.manifestChanges) | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log in debug what happened?
return &m, nil | ||
} | ||
|
||
func parseContractReturn(retBytes []byte) (uint64, []byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non blocker: I would move this function to be after the one that first calls it (i.e., after fetchManifest
).
|
||
Flags: []cli.Flag{ | ||
&cli.StringFlag{ | ||
Name: "contract", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cli docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is lotus-shed but sure :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non blocker for me. Up to you.
} | ||
|
||
var f3CheckActivationRaw = &cli.Command{ | ||
Name: "check-activation-raw", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description for these commands would be nice
return fmt.Errorf("bootstrap epoch does not match: %d != %d", m.BootstrapEpoch, activationEpoch) | ||
} | ||
io.Copy(os.Stdout, flate.NewReader(bytes.NewReader(compressedManifest))) | ||
fmt.Printf("\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Printf("\n") | |
fmt.Println() |
if m.BootstrapEpoch < 0 || uint64(m.BootstrapEpoch) != activationEpoch { | ||
return fmt.Errorf("bootstrap epoch does not match: %d != %d", m.BootstrapEpoch, activationEpoch) | ||
} | ||
io.Copy(os.Stdout, flate.NewReader(bytes.NewReader(compressedManifest))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicitly ignore the error?
io.Copy(os.Stdout, flate.NewReader(bytes.NewReader(compressedManifest))) | |
_, _ = io.Copy(os.Stdout, flate.NewReader(bytes.NewReader(compressedManifest))) |
Includes shed tool for debuging, the tool could be re-written to use the
the ContractManifestProvider.
Integration of ContractManifestProvider into the existing manifest
pipeline is missing.