Skip to content
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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

Kubuxu
Copy link
Contributor

@Kubuxu Kubuxu commented Feb 1, 2025

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.

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]>
@Kubuxu Kubuxu force-pushed the feat/f3-activation-contract branch from 89275bd to f41783e Compare February 13, 2025 16:54
@Kubuxu Kubuxu changed the title WIP: f3-activation-contract integration f3-activation-contract integration Feb 13, 2025
Signed-off-by: Jakub Sztandera <[email protected]>
@Kubuxu Kubuxu marked this pull request as ready for review February 13, 2025 17:08
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kubuxu Kubuxu changed the title f3-activation-contract integration feat: f3: f3-activation-contract integration Feb 13, 2025
@github-actions github-actions bot dismissed their stale review February 13, 2025 17:09

PR title now matches the required format.

@Kubuxu Kubuxu changed the title feat: f3: f3-activation-contract integration feat(f3): f3-activation-contract integration Feb 13, 2025
chain/lf3/manifest.go Show resolved Hide resolved
chain/lf3/manifest.go Show resolved Hide resolved
chain/lf3/manifest.go Outdated Show resolved Hide resolved
cmd/lotus-shed/f3.go Show resolved Hide resolved
chain/lf3/manifest.go Outdated Show resolved Hide resolved
chain/lf3/manifest.go Outdated Show resolved Hide resolved
@Kubuxu Kubuxu requested a review from masih February 18, 2025 14:15
@@ -84,6 +88,7 @@ func NewConfig(nn dtypes.NetworkName) *Config {
PrioritizeStaticManifest: true,
DynamicManifestProvider: buildconstants.F3ManifestServerID,
AllowDynamicFinalize: false,
ContractPollInterval: 15 * time.Minute,
Copy link
Member

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?

Copy link
Contributor Author

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 {
Copy link
Member

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
Copy link
Member

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?

Copy link
Contributor Author

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
Copy link
Member

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) {
Copy link
Member

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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cli docs.

Copy link
Contributor Author

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

Copy link
Member

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",
Copy link
Member

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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explicitly ignore the error?

Suggested change
io.Copy(os.Stdout, flate.NewReader(bytes.NewReader(compressedManifest)))
_, _ = io.Copy(os.Stdout, flate.NewReader(bytes.NewReader(compressedManifest)))

cmd/lotus-shed/f3.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Status: ⌨️ In Progress
Development

Successfully merging this pull request may close these issues.

2 participants