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

FIP0031 refinements #8429

Merged
merged 69 commits into from
Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
3370847
Implement FIP-0031
arajasek Mar 1, 2022
13a4602
gomod: update specs-actors@v8
vyzo Apr 4, 2022
a9ae38a
wire in nv16 migration signature and manifests
vyzo Apr 4, 2022
08a5950
actor manifests and metadata
vyzo Apr 4, 2022
770608a
update templates for actor shims
vyzo Apr 4, 2022
cdd5420
agen
vyzo Apr 4, 2022
efa57bb
make agen gofmt
vyzo Apr 4, 2022
7712fc0
rerun agen to gofmt
vyzo Apr 4, 2022
c3fb330
embed actors v8 bundle
vyzo Apr 4, 2022
f26d19e
load actor bundle at startup and initialize the manifest CID from the…
vyzo Apr 4, 2022
5e3112f
introduce a marker type for builtin actor loading to make DI work
vyzo Apr 4, 2022
17d72f0
use a sync.Once for manifest loading to avoid interference from paral…
vyzo Apr 4, 2022
10b07ec
update filecoin-ffi
vyzo Apr 6, 2022
ddede20
update fvm construction
vyzo Apr 6, 2022
a8547ed
make manifest cid access thread-safe
vyzo Apr 6, 2022
ad00d59
gitignore actor bundles
vyzo Apr 7, 2022
34022f3
add script to fetch bundles
vyzo Apr 7, 2022
a375d53
add make rules to fetch actor bundles
vyzo Apr 7, 2022
7191352
fix itest migrations
vyzo Apr 7, 2022
c9ac002
make gateway a variable
vyzo Apr 7, 2022
1dbfb3b
fetch builtin actor bundles as part of prepare workflow
vyzo Apr 7, 2022
44e42bf
fix sync_test
vyzo Apr 7, 2022
aba27d9
make gen
vyzo Apr 7, 2022
3e72a08
fix rand_test
vyzo Apr 7, 2022
36cb76a
genesis depends on actor bundle
vyzo Apr 7, 2022
45a65c5
update specs-actors
vyzo Apr 7, 2022
8f121ab
patch agen to deal with v8 deal proposals
vyzo Apr 7, 2022
9ee5793
make gen
vyzo Apr 7, 2022
e8b902b
initialize system actor for nv16 at genesis
vyzo Apr 7, 2022
752ce9e
make tests work
vyzo Apr 8, 2022
5d6e9ec
patch genesis state tree to get the right code IDs
vyzo Apr 8, 2022
fcf69e7
register mapping for methods using the real code cid
vyzo Apr 8, 2022
2c9ea8c
fix test
vyzo Apr 8, 2022
73e7c42
mark TODO for fixing policy stuffs in test
vyzo Apr 8, 2022
12554ba
fix forks_test
vyzo Apr 8, 2022
c35e769
fix conformance driver
vyzo Apr 8, 2022
77613b5
fix lint
vyzo Apr 8, 2022
339b7db
Integrate FIP 0027
arajasek Mar 12, 2022
124fe26
WIP annoying errors
ZenGround0 Apr 7, 2022
7163fe6
Post rebase fix
ZenGround0 Apr 7, 2022
60d0957
More fixes
ZenGround0 Apr 8, 2022
0f6da17
Lint
ZenGround0 Apr 8, 2022
8562798
Use go-fil-markets tag
ZenGround0 Apr 11, 2022
cd5829a
update specs-actors
vyzo Apr 12, 2022
19593ed
fix forks_test
vyzo Apr 12, 2022
54f3121
removed dead code from builtin actor template init funcs
vyzo Apr 12, 2022
508c060
remove unnecessary isv8 state boolean from agen
vyzo Apr 12, 2022
1643ec4
less wonky market/state.go.template
vyzo Apr 12, 2022
1f7c89d
make gen
vyzo Apr 12, 2022
93f1fac
simplify DI -- no need for the special key for builtin actor loading
vyzo Apr 12, 2022
0ac8708
simplify fetch-bundles script
vyzo Apr 12, 2022
3b1964c
remove manifest from upgrade schedule, get it inside the migration in…
vyzo Apr 12, 2022
dec2b31
fix lint
vyzo Apr 12, 2022
5f62227
fix sync_test
vyzo Apr 12, 2022
f28bd05
fix rand_test
vyzo Apr 12, 2022
07e4024
fix lint
vyzo Apr 12, 2022
395c772
make the miner load the manifest so that it can correctly map actors
vyzo Apr 12, 2022
507b835
need a blockstore for the manifest loader
vyzo Apr 12, 2022
6bd2d89
use memory blockstore for miner manifest loading
vyzo Apr 14, 2022
30ed847
make fetch-bundles.sh portable.
raulk Apr 13, 2022
1c1d8e0
update specs-actors/v8@master
vyzo Apr 14, 2022
65de3e7
add retries to curl when fetching bundles
vyzo Apr 14, 2022
1866eeb
go mod tidy
vyzo Apr 14, 2022
2690b69
fix rebase issues
vyzo Apr 14, 2022
cede67b
make gen
vyzo Apr 14, 2022
c5e3ca3
fix more rebase issues
vyzo Apr 14, 2022
534e43e
fix lotus-shed
vyzo Apr 14, 2022
beb3369
add LoadManifestFromBundle, use it in miner init
vyzo Apr 15, 2022
e2e2cd8
rename patchStateTree to patchManifestCodeCids
vyzo Apr 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ commands:
- run: sudo apt-get install ocl-icd-opencl-dev libhwloc-dev
- run: git submodule sync
- run: git submodule update --init
- fetch_builtin_actors
download-params:
steps:
- restore_cache:
Expand Down Expand Up @@ -83,6 +84,23 @@ commands:
name: fetch all tags
command: |
git fetch --all
fetch_builtin_actors:
steps:
- restore_cache:
name: restore builtin actors bundle cache
keys:
- 'builtin-actors-v8.car'
paths:
- build/builtin-actors/
- run:
name: fetch builtin actor bundles
command: |
build/builtin-actors/fetch-bundles.sh
- save_cache:
name: save builtin actors bundle cache
key: 'builtin-actors-v8.car'
paths:
- build/builtin-actors/

packer_build:
description: "Run a packer build"
Expand Down Expand Up @@ -224,7 +242,7 @@ jobs:

test-conformance:
description: |
Run tests using a corpus of interoperable test vectors for Filecoin
Run tests using a corpus of interoperable test vectors for Filecoin
implementations to test their correctness and compliance with the Filecoin
specifications.
parameters:
Expand Down
20 changes: 19 additions & 1 deletion .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ commands:
- run: sudo apt-get install ocl-icd-opencl-dev libhwloc-dev
- run: git submodule sync
- run: git submodule update --init
- fetch_builtin_actors
download-params:
steps:
- restore_cache:
Expand Down Expand Up @@ -83,6 +84,23 @@ commands:
name: fetch all tags
command: |
git fetch --all
fetch_builtin_actors:
steps:
- restore_cache:
name: restore builtin actors bundle cache
keys:
- 'builtin-actors-v8.car'
paths:
- build/builtin-actors/
- run:
name: fetch builtin actor bundles
command: |
build/builtin-actors/fetch-bundles.sh
- save_cache:
name: save builtin actors bundle cache
key: 'builtin-actors-v8.car'
paths:
- build/builtin-actors/

packer_build:
description: "Run a packer build"
Expand Down Expand Up @@ -224,7 +242,7 @@ jobs:

test-conformance:
description: |
Run tests using a corpus of interoperable test vectors for Filecoin
Run tests using a corpus of interoperable test vectors for Filecoin
implementations to test their correctness and compliance with the Filecoin
specifications.
parameters:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ bin/ipget
bin/tmp/*
.idea
scratchpad

build/builtin-actors/*.car
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ build/.update-modules:

# end git modules

# builtin actor bundles
builtin-actor-bundles:
./build/builtin-actors/fetch-bundles.sh

BUILD_DEPS+=builtin-actor-bundles

.PHONY: builtin-actor-bundles

## MAIN BINARIES

CLEAN+=build/.update-modules
Expand Down Expand Up @@ -362,4 +370,4 @@ print-%:
@echo $*=$($*)

circleci:
go generate -x ./.circleci
go generate -x ./.circleci
2 changes: 1 addition & 1 deletion api/api_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
datatransfer "github.com/filecoin-project/go-data-transfer"
"github.com/filecoin-project/go-state-types/abi"
abinetwork "github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/specs-actors/v2/actors/builtin/market"
"github.com/filecoin-project/specs-actors/v8/actors/builtin/market"
"github.com/filecoin-project/specs-storage/storage"

"github.com/filecoin-project/go-fil-markets/piecestore"
Expand Down
2 changes: 1 addition & 1 deletion api/cbor_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions build/builtin-actors/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This directory contains the builtin actors v8 bundle, to be emdedded in the binary.
To change your actor bundle, prior to fixing for nv16 upgrade, generate a bundle using the actor
bundler and place it in this directory, in a file named builtin-actors-v8.car
52 changes: 52 additions & 0 deletions build/builtin-actors/fetch-bundles.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash
set -e

cd "$(dirname "$0")"

# gateway to use
dweb="dweb.link"

actors7_cid=""
actors7_hash=""
actors8_cid="bafybeictmywrut5tprz5fnoti6adfwuvixvrfardhqwldxosmdsfavc56e"
actors8_hash="687b38f59b0c32800f55a8f1f303de214ec173c90e653984d67f393bc41c1416"

die() {
echo "$1"
exit 1
}

check() {
file=$1
hash=$2
if [ -e "$file" ]; then
echo "$hash $file" | shasum -a 256 --check
else
return 1
fi
}

fetch() {
output=$1
cid=$2
hash=$3
if (check "$output" "$hash"); then
return 0
else
echo "fetching $cid to $output"
curl --retry 3 -k "https://$dweb/ipfs/$cid" -o "$output"
check "$output" "$hash" || die "hash mismatch"
fi
}

if [ -n "$actors7_cid" ]; then
fetch builtin-actors-v7.car "$actors7_cid" "$actors7_hash"
else
touch builtin-actors-v7.car
fi

if [ -n "$actors8_cid" ]; then
fetch builtin-actors-v8.car "$actors8_cid" "$actors8_hash"
else
touch builtin-actors-v8.car
fi
19 changes: 19 additions & 0 deletions build/builtin_actors.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package build

import (
_ "embed"
)

//go:embed builtin-actors/builtin-actors-v8.car
var actorsv8 []byte

func BuiltinActorsV8Bundle() []byte {
return actorsv8
}

//go:embed builtin-actors/builtin-actors-v7.car
var actorsv7 []byte

func BuiltinActorsV7Bundle() []byte {
return actorsv7
}
Binary file modified build/openrpc/full.json.gz
Binary file not shown.
Binary file modified build/openrpc/miner.json.gz
Binary file not shown.
2 changes: 2 additions & 0 deletions build/params_2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var UpgradeHyperdriveHeight = abi.ChainEpoch(-16)
var UpgradeChocolateHeight = abi.ChainEpoch(-17)

var UpgradeOhSnapHeight = abi.ChainEpoch(-18)
var UpgradeFVM1Height = abi.ChainEpoch(-19)

var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
Expand Down Expand Up @@ -91,6 +92,7 @@ func init() {
UpgradeHyperdriveHeight = getUpgradeHeight("LOTUS_HYPERDRIVE_HEIGHT", UpgradeHyperdriveHeight)
UpgradeChocolateHeight = getUpgradeHeight("LOTUS_CHOCOLATE_HEIGHT", UpgradeChocolateHeight)
UpgradeOhSnapHeight = getUpgradeHeight("LOTUS_OHSNAP_HEIGHT", UpgradeOhSnapHeight)
UpgradeFVM1Height = getUpgradeHeight("LOTUS_FVM1_HEIGHT", UpgradeFVM1Height)

BuildType |= Build2k

Expand Down
2 changes: 2 additions & 0 deletions build/params_butterfly.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const UpgradeChocolateHeight = -17

const UpgradeOhSnapHeight = 240

var UpgradeFVM1Height = abi.ChainEpoch(99999999999999)

func init() {
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2 << 30))
policy.SetSupportedProofTypes(
Expand Down
2 changes: 2 additions & 0 deletions build/params_calibnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ const UpgradeChocolateHeight = 312746
// 2022-02-10T19:23:00Z
const UpgradeOhSnapHeight = 682006

var UpgradeFVM1Height = abi.ChainEpoch(99999999999999)

func init() {
policy.SetConsensusMinerMinPower(abi.NewStoragePower(32 << 30))
policy.SetSupportedProofTypes(
Expand Down
4 changes: 4 additions & 0 deletions build/params_interop.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var UpgradeTurboHeight = abi.ChainEpoch(-15)
var UpgradeHyperdriveHeight = abi.ChainEpoch(-16)
var UpgradeChocolateHeight = abi.ChainEpoch(-17)
var UpgradeOhSnapHeight = abi.ChainEpoch(-18)
var UpgradeFVM1Height = abi.ChainEpoch(-19)

var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
Expand Down Expand Up @@ -93,6 +94,9 @@ func init() {
UpgradeNorwegianHeight = getUpgradeHeight("LOTUS_NORWEGIAN_HEIGHT", UpgradeNorwegianHeight)
UpgradeTurboHeight = getUpgradeHeight("LOTUS_ACTORSV4_HEIGHT", UpgradeTurboHeight)
UpgradeHyperdriveHeight = getUpgradeHeight("LOTUS_HYPERDRIVE_HEIGHT", UpgradeHyperdriveHeight)
UpgradeChocolateHeight = getUpgradeHeight("LOTUS_CHOCOLATE_HEIGHT", UpgradeChocolateHeight)
UpgradeOhSnapHeight = getUpgradeHeight("LOTUS_OHSNAP_HEIGHT", UpgradeOhSnapHeight)
UpgradeFVM1Height = getUpgradeHeight("LOTUS_FVM1_HEIGHT", UpgradeFVM1Height)

BuildType |= BuildInteropnet
SetAddressNetwork(address.Testnet)
Expand Down
2 changes: 2 additions & 0 deletions build/params_mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ const UpgradeChocolateHeight = 1231620
// 2022-03-01T15:00:00Z
var UpgradeOhSnapHeight = abi.ChainEpoch(1594680)

var UpgradeFVM1Height = abi.ChainEpoch(99999999999999)

func init() {
if os.Getenv("LOTUS_USE_TEST_ADDRESSES") != "1" {
SetAddressNetwork(address.Mainnet)
Expand Down
2 changes: 1 addition & 1 deletion build/params_shared_vals.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const NewestNetworkVersion = network.Version{{.latestNetworkVersion}}

/* inline-gen start */

const NewestNetworkVersion = network.Version15
const NewestNetworkVersion = network.Version16

/* inline-gen end */

Expand Down
1 change: 1 addition & 0 deletions build/params_testground.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ var (
UpgradeHyperdriveHeight abi.ChainEpoch = -15
UpgradeChocolateHeight abi.ChainEpoch = -16
UpgradeOhSnapHeight abi.ChainEpoch = -17
UpgradeFVM1Height abi.ChainEpoch = -18

DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
Expand Down
8 changes: 7 additions & 1 deletion chain/actors/agen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"bytes"
"fmt"
"go/format"
"io/ioutil"
"os"
"path/filepath"
Expand Down Expand Up @@ -77,7 +78,12 @@ func generateAdapters() error {
return err
}

if err := ioutil.WriteFile(filepath.Join(actDir, fmt.Sprintf("%s.go", act)), b.Bytes(), 0666); err != nil {
fmted, err := format.Source(b.Bytes())
if err != nil {
return err
}

if err := ioutil.WriteFile(filepath.Join(actDir, fmt.Sprintf("%s.go", act)), fmted, 0666); err != nil {
return err
}
}
Expand Down
Loading