From 17cd28028ff56b30c07bc83c592afab123058f45 Mon Sep 17 00:00:00 2001 From: Jennifer Wang Date: Wed, 22 Jun 2022 15:21:50 -0400 Subject: [PATCH 1/2] fvm liftoff --- FVMLiftoff.txt | 57 ++++++++++++++++++++++++++++++++++++++++++++ chain/stmgr/forks.go | 10 ++++++++ 2 files changed, 67 insertions(+) create mode 100644 FVMLiftoff.txt diff --git a/FVMLiftoff.txt b/FVMLiftoff.txt new file mode 100644 index 000000000..4bff5c25b --- /dev/null +++ b/FVMLiftoff.txt @@ -0,0 +1,57 @@ + . + + . ' ` . + . ' . + + . ' . ' | + . ' . ' | ++ . ' . + +| ` . . ' . ' . +| + . ' . + ++ | . ' . ' | + ` . | . ' . ' | ++ + . ' . + +| ` . . ' . ' +| + . ' ++ | . ' . + ` . | '. ` . + + ` . ` . + ` . ` . ` . --- --- + ` . ` . . + /\__\ ___ /\ \ + ` . + ' | /:/ _/_ /\ \ |::\ \ + ` . | | /:/ /\__\ \:\ \ |:|:\ \ + ` . | . + /:/ /:/ / \:\ \ __|:|\:\ \ + + ' /:/_/:/ / ___ \:\__\ /::::|_\:\__\ + \:\/:/ / /\ \ |:| | \:\~~\ \/__/ + \::/__/ \:\ \|:| | \:\ \ + \:\ \ \:\__|:|__| \:\ \ + \:\__\ \::::/__/ \:\__\ + \/__/ ~~~~ \/__/ + ___ ___ ___ ___ + /\__\ /\ \ /\__\ /\__\ + ___ /:/ _/_ ___ /::\ \ /:/ _/_ /:/ _/_ + /\__\ /:/ /\__\ /\__\ /:/\:\ \ /:/ /\__\ /:/ /\__\ + ___ ___ /:/__/ /:/ /:/ / /:/ / /:/ \:\ \ /:/ /:/ / /:/ /:/ / + /\ \ /\__\ /::\ \ /:/_/:/ / /:/__/ /:/__/ \:\__\ /:/_/:/ / /:/_/:/ / + \:\ \ /:/ / \/\:\ \__ \:\/:/ / /::\ \ \:\ \ /:/ / \:\/:/ / \:\/:/ / + \:\ /:/ / ~~\:\/\__\ \::/__/ /:/\:\ \ \:\ /:/ / \::/__/ \::/__/ . + + \:\/:/ / \::/ / \:\ \ \/__\:\ \ \:\/:/ / \:\ \ \:\ \ . ' ` . + \::/ / /:/ / \:\__\ \:\__\ \::/ / \:\__\ \:\__\ . ' . + + \/__/ \/__/ \/__/ \/__/ \/__/ \/__/ \/__/ . ' . ' | + . ' . ' | + + . ' . + + | ` . . ' . ' . + | + . ' . + + + | . ' . ' | + ` . | . ' . ' | + + + . ' . + + | ` . . ' . ' + | + . ' + + | . ' . + ` . | '. ` . + + ` . ` . + ` . ` . ` . + ` . ` . . + + ` . + ' | + ` . | | + ` . | . + + + diff --git a/chain/stmgr/forks.go b/chain/stmgr/forks.go index 048ea7372..52913b303 100644 --- a/chain/stmgr/forks.go +++ b/chain/stmgr/forks.go @@ -1,9 +1,12 @@ package stmgr import ( + "bufio" "bytes" "context" "encoding/binary" + "fmt" + "os" "sort" "sync" "time" @@ -192,6 +195,13 @@ func (sm *StateManager) HandleStateForks(ctx context.Context, root cid.Cid, heig "to", retCid, "duration", time.Since(startTime), ) + + f, _ := os.Open("/Users/jennijuju/filecoin/lotus/FVMLiftoff.txt") + scanner := bufio.NewScanner(f) + for scanner.Scan() { + line := scanner.Text() + fmt.Println(line) + } } return retCid, nil From cd6c0c2ad3d5462183562419bedf28cdba876da8 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 22 Jun 2022 12:41:14 -0700 Subject: [PATCH 2/2] feat: move banner, embed, and run at v8 upgrade only 1. Embed the banner in the upgrades subsystem instead of reading it at runtime. 2. Print it all at once instead of line-by-line. 3. Run it in the v8 upgrade itself. --- .../consensus/filcns/FVMLiftoff.txt | 0 chain/consensus/filcns/upgrades.go | 8 ++++++++ chain/stmgr/forks.go | 10 ---------- 3 files changed, 8 insertions(+), 10 deletions(-) rename FVMLiftoff.txt => chain/consensus/filcns/FVMLiftoff.txt (100%) diff --git a/FVMLiftoff.txt b/chain/consensus/filcns/FVMLiftoff.txt similarity index 100% rename from FVMLiftoff.txt rename to chain/consensus/filcns/FVMLiftoff.txt diff --git a/chain/consensus/filcns/upgrades.go b/chain/consensus/filcns/upgrades.go index 300ab1eb9..33dbe638f 100644 --- a/chain/consensus/filcns/upgrades.go +++ b/chain/consensus/filcns/upgrades.go @@ -2,9 +2,12 @@ package filcns import ( "context" + "fmt" "runtime" "time" + _ "embed" + "github.com/docker/go-units" "github.com/ipfs/go-cid" cbor "github.com/ipfs/go-ipld-cbor" @@ -47,6 +50,9 @@ import ( "github.com/filecoin-project/lotus/node/bundle" ) +//go:embed FVMLiftoff.txt +var fvmLiftoffBanner string + func DefaultUpgradeSchedule() stmgr.UpgradeSchedule { var us stmgr.UpgradeSchedule @@ -1338,6 +1344,8 @@ func UpgradeActorsV8(ctx context.Context, sm *stmgr.StateManager, cache stmgr.Mi return cid.Undef, xerrors.Errorf("migrating actors v7 state: %w", err) } + fmt.Print(fvmLiftoffBanner) + return newRoot, nil } diff --git a/chain/stmgr/forks.go b/chain/stmgr/forks.go index 52913b303..048ea7372 100644 --- a/chain/stmgr/forks.go +++ b/chain/stmgr/forks.go @@ -1,12 +1,9 @@ package stmgr import ( - "bufio" "bytes" "context" "encoding/binary" - "fmt" - "os" "sort" "sync" "time" @@ -195,13 +192,6 @@ func (sm *StateManager) HandleStateForks(ctx context.Context, root cid.Cid, heig "to", retCid, "duration", time.Since(startTime), ) - - f, _ := os.Open("/Users/jennijuju/filecoin/lotus/FVMLiftoff.txt") - scanner := bufio.NewScanner(f) - for scanner.Scan() { - line := scanner.Text() - fmt.Println(line) - } } return retCid, nil