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

Ntwk/hyperspacenet #1114

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ testfull: build
# testshort runs tests that don't require external dependencies such as postgres or redis
.PHONY: testshort
testshort:
go test -short ./... -v
go test -short ./...


.PHONY: lily
Expand Down Expand Up @@ -151,6 +151,9 @@ butterflynet: build
interopnet: GOFLAGS+=-tags=interopnet
interopnet: build

hyperspacenet: GOFLAGS+=-tags=hyperspacenet
hyperspacenet: build

# alias to match other network-specific targets
mainnet: build

Expand Down
28 changes: 14 additions & 14 deletions chain/actors/actors.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ import (
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
"github.com/ipfs/go-cid"
cid "github.com/ipfs/go-cid"
)

type Version int

var LatestVersion = 8

var Versions = []int{0, 2, 3, 4, 5, 6, 7, 8}

const (
Version0 Version = 0
Version2 Version = 2
Version3 Version = 3
Version4 Version = 4
Version5 Version = 5
Version6 Version = 6
Version7 Version = 7
Version8 Version = 8
Version9 Version = 9
Version0 Version = 0
Version2 Version = 2
Version3 Version = 3
Version4 Version = 4
Version5 Version = 5
Version6 Version = 6
Version7 Version = 7
Version8 Version = 8
Version9 Version = 9
Version10 Version = 10
Version11 Version = 11
Version12 Version = 12
Version13 Version = 13
)
const (
AccountKey = "account"
Copy link
Contributor

Choose a reason for hiding this comment

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

will need to add the evm actor key from fip-0054 here?

Expand Down
2 changes: 2 additions & 0 deletions chain/actors/adt/diff/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type ArrayDiffer interface {
// - All values that exist in curArr nnd not in prevArr are passed to ArrayDiffer.Add()
// - All values that exist in preArr and in curArr are passed to ArrayDiffer.Modify()
// - It is the responsibility of ArrayDiffer.Modify() to determine if the values it was passed have been modified.
//
// If `preArr` and `curArr` are both backed by /v3/AMTs with the same bitwidth use the more efficient Amt method.
func CompareArray(preArr, curArr adt.Array, out ArrayDiffer) error {
notNew := make(map[int64]struct{}, curArr.Length())
Expand Down Expand Up @@ -84,6 +85,7 @@ type MapDiffer interface {
// - All values that exist in curMap nnd not in prevArr are passed to MapDiffer.Add()
// - All values that exist in preMap and in curMap are passed to MapDiffer.Modify()
// - It is the responsibility of ArrayDiffer.Modify() to determine if the values it was passed have been modified.
//
// If `preMap` and `curMap` are both backed by /v3/HAMTs with the same bitwidth and hash function use the more efficient Hamt method.
func CompareMap(preMap, curMap adt.Map, out MapDiffer) error {
notNew := make(map[string]struct{})
Expand Down
202 changes: 0 additions & 202 deletions chain/actors/builtin/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,12 @@ import (

builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"

"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/proof"

"github.com/filecoin-project/lotus/chain/actors"

smoothingtypes "github.com/filecoin-project/go-state-types/builtin/v8/util/smoothing"
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
)

var SystemActorAddr = builtin.SystemActorAddr
var BurntFundsActorAddr = builtin.BurntFundsActorAddr
var CronActorAddr = builtin.CronActorAddr
var SaftAddress = makeAddress("t0122")
var ReserveAddress = makeAddress("t090")
var RootVerifierAddress = makeAddress("t080")

var (
ExpectedLeadersPerEpoch = builtin.ExpectedLeadersPerEpoch
)

const (
Expand All @@ -60,10 +47,6 @@ type ExtendedSectorInfo = proof.ExtendedSectorInfo
type PoStProof = proof.PoStProof
type FilterEstimate = smoothingtypes.FilterEstimate

func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, dealWeight, verifiedWeight abi.DealWeight) abi.StoragePower {
return minertypes.QAPowerForWeight(size, duration, dealWeight, verifiedWeight)
}

func ActorNameByCode(c cid.Cid) string {
if name, version, ok := actors.GetActorMetaByCode(c); ok {
return fmt.Sprintf("fil/%d/%s", version, name)
Expand Down Expand Up @@ -97,191 +80,6 @@ func ActorNameByCode(c cid.Cid) string {
}
}

func IsBuiltinActor(c cid.Cid) bool {
_, _, ok := actors.GetActorMetaByCode(c)
if ok {
return true
}

if builtin0.IsBuiltinActor(c) {
return true
}

if builtin2.IsBuiltinActor(c) {
return true
}

if builtin3.IsBuiltinActor(c) {
return true
}

if builtin4.IsBuiltinActor(c) {
return true
}

if builtin5.IsBuiltinActor(c) {
return true
}

if builtin6.IsBuiltinActor(c) {
return true
}

if builtin7.IsBuiltinActor(c) {
return true
}

return false
}

func IsAccountActor(c cid.Cid) bool {
name, _, ok := actors.GetActorMetaByCode(c)
if ok {
return name == "account"
}

if c == builtin0.AccountActorCodeID {
return true
}

if c == builtin2.AccountActorCodeID {
return true
}

if c == builtin3.AccountActorCodeID {
return true
}

if c == builtin4.AccountActorCodeID {
return true
}

if c == builtin5.AccountActorCodeID {
return true
}

if c == builtin6.AccountActorCodeID {
return true
}

if c == builtin7.AccountActorCodeID {
return true
}

return false
}

func IsStorageMinerActor(c cid.Cid) bool {
name, _, ok := actors.GetActorMetaByCode(c)
if ok {
return name == actors.MinerKey
}

if c == builtin0.StorageMinerActorCodeID {
return true
}

if c == builtin2.StorageMinerActorCodeID {
return true
}

if c == builtin3.StorageMinerActorCodeID {
return true
}

if c == builtin4.StorageMinerActorCodeID {
return true
}

if c == builtin5.StorageMinerActorCodeID {
return true
}

if c == builtin6.StorageMinerActorCodeID {
return true
}

if c == builtin7.StorageMinerActorCodeID {
return true
}

return false
}

func IsMultisigActor(c cid.Cid) bool {
name, _, ok := actors.GetActorMetaByCode(c)
if ok {
return name == actors.MultisigKey
}

if c == builtin0.MultisigActorCodeID {
return true
}

if c == builtin2.MultisigActorCodeID {
return true
}

if c == builtin3.MultisigActorCodeID {
return true
}

if c == builtin4.MultisigActorCodeID {
return true
}

if c == builtin5.MultisigActorCodeID {
return true
}

if c == builtin6.MultisigActorCodeID {
return true
}

if c == builtin7.MultisigActorCodeID {
return true
}

return false
}

func IsPaymentChannelActor(c cid.Cid) bool {
name, _, ok := actors.GetActorMetaByCode(c)
if ok {
return name == "paymentchannel"
}

if c == builtin0.PaymentChannelActorCodeID {
return true
}

if c == builtin2.PaymentChannelActorCodeID {
return true
}

if c == builtin3.PaymentChannelActorCodeID {
return true
}

if c == builtin4.PaymentChannelActorCodeID {
return true
}

if c == builtin5.PaymentChannelActorCodeID {
return true
}

if c == builtin6.PaymentChannelActorCodeID {
return true
}

if c == builtin7.PaymentChannelActorCodeID {
return true
}

return false
}

func makeAddress(addr string) address.Address {
ret, err := address.NewFromString(addr)
if err != nil {
Expand Down
Loading