Skip to content

Commit

Permalink
feat:update the lotus version (#1153)
Browse files Browse the repository at this point in the history
* Add datastore batching

* update the lotus latest version

* update the ffi version

* putting the mds to new state manager

* update the go version and add flush to caching blockstore

* Replace ioutil with io/os

* update the go version in go.mod

* update the go-state-types

---------

Co-authored-by: Terry <[email protected]>
  • Loading branch information
Terryhung and Terry authored Apr 6, 2023
1 parent 4bdcb67 commit d9e0301
Show file tree
Hide file tree
Showing 13 changed files with 386 additions and 576 deletions.
11 changes: 4 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ orbs:
executors:
dockerizer:
docker:
- image: cimg/go:1.18.7
- image: cimg/go:1.19.7
environment:
IMAGE_NAME: filecoin/lily
golang:
docker:
- image: cimg/go:1.18.7
- image: cimg/go:1.19.7

commands:
install-deps:
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
test:
resource_class: xlarge
docker:
- image: cimg/go:1.18.7
- image: cimg/go:1.19.7
- image: timescale/timescaledb:2.5.0-pg13
environment:
POSTGRES_PASSWORD: password
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:
integration-test:
resource_class: large
docker:
- image: cimg/go:1.18.7
- image: cimg/go:1.19.7
- image: timescale/timescaledb:2.5.0-pg13
environment:
POSTGRES_PASSWORD: password
Expand Down Expand Up @@ -226,9 +226,6 @@ jobs:
executor:
type: executor
default: golang
golangci-lint-version:
type: string
default: 1.28.2
concurrency:
type: string
default: '2'
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL=/usr/bin/env bash

GO_BUILD_IMAGE?=golang:1.18.7
GO_BUILD_IMAGE?=golang:1.19.7
PG_IMAGE?=postgres:10
REDIS_IMAGE?=redis:6
LILY_IMAGE_NAME?=filecoin/lily
Expand Down
21 changes: 10 additions & 11 deletions chain/actors/agen/generator/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"fmt"
"go/format"
"io/ioutil"
"os"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -57,7 +56,7 @@ func generateAdapters() error {
}

{
af, err := ioutil.ReadFile(filepath.Join(actDir, "actor.go.template"))
af, err := os.ReadFile(filepath.Join(actDir, "actor.go.template"))
if err != nil {
return xerrors.Errorf("loading actor template: %w", err)
}
Expand All @@ -81,7 +80,7 @@ func generateAdapters() error {
return err
}

if err := ioutil.WriteFile(filepath.Join(actDir, fmt.Sprintf("%s.go", act)), fmted, 0666); err != nil {
if err := os.WriteFile(filepath.Join(actDir, fmt.Sprintf("%s.go", act)), fmted, 0666); err != nil {
return err
}
}
Expand All @@ -91,7 +90,7 @@ func generateAdapters() error {
}

func generateState(actDir string, versions []int) error {
af, err := ioutil.ReadFile(filepath.Join(actDir, "state.go.template"))
af, err := os.ReadFile(filepath.Join(actDir, "state.go.template"))
if err != nil {
if os.IsNotExist(err) {
return nil // skip
Expand All @@ -114,7 +113,7 @@ func generateState(actDir string, versions []int) error {
return err
}

if err := ioutil.WriteFile(filepath.Join(actDir, fmt.Sprintf("v%d.go", version)), b.Bytes(), 0666); err != nil {
if err := os.WriteFile(filepath.Join(actDir, fmt.Sprintf("v%d.go", version)), b.Bytes(), 0666); err != nil {
return err
}
}
Expand All @@ -123,7 +122,7 @@ func generateState(actDir string, versions []int) error {
}

func generateMessages(actDir string) error {
af, err := ioutil.ReadFile(filepath.Join(actDir, "message.go.template"))
af, err := os.ReadFile(filepath.Join(actDir, "message.go.template"))
if err != nil {
if os.IsNotExist(err) {
return nil // skip
Expand All @@ -146,7 +145,7 @@ func generateMessages(actDir string) error {
return err
}

if err := ioutil.WriteFile(filepath.Join(actDir, fmt.Sprintf("message%d.go", version)), b.Bytes(), 0666); err != nil {
if err := os.WriteFile(filepath.Join(actDir, fmt.Sprintf("message%d.go", version)), b.Bytes(), 0666); err != nil {
return err
}
}
Expand All @@ -156,7 +155,7 @@ func generateMessages(actDir string) error {

func generatePolicy(policyPath string) error {

pf, err := ioutil.ReadFile(policyPath + ".template")
pf, err := os.ReadFile(policyPath + ".template")
if err != nil {
if os.IsNotExist(err) {
return nil // skip
Expand All @@ -178,7 +177,7 @@ func generatePolicy(policyPath string) error {
return err
}

if err := ioutil.WriteFile(policyPath, b.Bytes(), 0666); err != nil {
if err := os.WriteFile(policyPath, b.Bytes(), 0666); err != nil {
return err
}

Expand All @@ -187,7 +186,7 @@ func generatePolicy(policyPath string) error {

func generateBuiltin(builtinPath string) error {

bf, err := ioutil.ReadFile(builtinPath + ".template")
bf, err := os.ReadFile(builtinPath + ".template")
if err != nil {
if os.IsNotExist(err) {
return nil // skip
Expand All @@ -209,7 +208,7 @@ func generateBuiltin(builtinPath string) error {
return err
}

if err := ioutil.WriteFile(builtinPath, b.Bytes(), 0666); err != nil {
if err := os.WriteFile(builtinPath, b.Bytes(), 0666); err != nil {
return err
}

Expand Down
6 changes: 3 additions & 3 deletions chain/indexer/tasktype/tablegen/generator/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"go/doc"
"go/parser"
"go/token"
"io/ioutil"
"os"
"path/filepath"
"reflect"
"strings"
Expand All @@ -18,7 +18,7 @@ import (

func Gen() error {
taskDir := "./chain/indexer/tasktype"
rf, err := ioutil.ReadFile(filepath.Join(taskDir, "table_tasks.go.template"))
rf, err := os.ReadFile(filepath.Join(taskDir, "table_tasks.go.template"))
if err != nil {
return fmt.Errorf("loading registry template: %w", err)
}
Expand All @@ -34,7 +34,7 @@ func Gen() error {
}); err != nil {
return err
}
if err := ioutil.WriteFile(filepath.Join(taskDir, "table_tasks.go"), b.Bytes(), 0o666); err != nil {
if err := os.WriteFile(filepath.Join(taskDir, "table_tasks.go"), b.Bytes(), 0o666); err != nil {
return err
}
return nil
Expand Down
4 changes: 2 additions & 2 deletions commands/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package commands
import (
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"

paramfetch "github.com/filecoin-project/go-paramfetch"
Expand Down Expand Up @@ -230,7 +230,7 @@ Note that jobs are not persisted between restarts of the daemon. See

var genBytes []byte
if c.String("genesis") != "" {
genBytes, err = ioutil.ReadFile(daemonFlags.genesis)
genBytes, err = os.ReadFile(daemonFlags.genesis)
if err != nil {
return fmt.Errorf("reading genesis: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions commands/util/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func ImportFromFsFile(ctx context.Context, r repo.Repo, fs fs.File, snapshot boo
return err
}

stm, err := stmgr.NewStateManager(cst, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil)
stm, err := stmgr.NewStateManager(cst, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil, mds)
if err != nil {
return err
}
Expand Down Expand Up @@ -203,7 +203,7 @@ func ImportChain(ctx context.Context, r repo.Repo, fname string, snapshot bool)
return err
}

stm, err := stmgr.NewStateManager(cst, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil)
stm, err := stmgr.NewStateManager(cst, consensus.NewTipSetExecutor(filcns.RewardFunc), vm.Syscalls(ffiwrapper.ProofVerifier), filcns.DefaultUpgradeSchedule(), nil, mds)
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit d9e0301

Please sign in to comment.