profile
viewpoint

filecoin-project/go-filecoin 1671

Filecoin Full Node Implementation in Go

filecoin-project/go-fil-markets 17

Shared Implementation of Storage and Retrieval Markets for Filecoin Node Implementations

benweissmann/zephyr-mobile 6

Zephyr Mobile Application for Android

filecoin-project/go-amt-ipld 5

Implementation of an array mapped trie using go and ipld

gxed/ansi 0

Small, fast library to create ANSI colored strings and codes. [go, golang]

gxed/aws-sdk-go 0

AWS SDK for the Go programming language.

gxed/backoff 0

The exponential backoff algorithm in Go (Golang).

gxed/base58 0

Fast implementation of base58 encoding on golang.

PullRequestReviewEvent

push eventfilecoin-project/lotus

Steven Allen

commit sha d33dd4f7bc9bc79b0c6e7957ab115c430d97bc79

more renames

view details

push time in 12 hours

pull request commentfilecoin-project/lotus

[WIP] Network upgrade support

Q: How are we going to handle the "paths" in cli/chain.go and ChainGetNode? Specifically, how are we going to abstract over HAMT/AMT versions. We can probably leave the code as-is for now, but this is going to be very brittle.

Stebalien

comment created time in 13 hours

push eventfilecoin-project/lotus

Steven Allen

commit sha 63f026f7c3fb52f894ed80d6fef7bdd1f7de8650

migrate some more imports

view details

push time in 13 hours

push eventfilecoin-project/lotus

Steven Allen

commit sha 3f0106cfe5ba375b3e2ddad07dba8d5bef976a9b

migrate lotus-shed/genesis-verify to actor abstraction

view details

push time in 13 hours

push eventfilecoin-project/lotus

Steven Allen

commit sha 4bab784e401bcaec79a30ac0a36b75cc98e73fdd

migrate lotus-shed verifreg to specs-actors abstractions

view details

push time in 13 hours

push eventfilecoin-project/lotus

Steven Allen

commit sha a41bf74badf8586ebb20bcdba01d14cf006e5ff4

fix: remove incorrect variable

view details

Steven Allen

commit sha 916421b247b8a075ca808c139df7dd52aa396f81

convert lotus-shed balances

view details

push time in 15 hours

push eventfilecoin-project/lotus

Steven Allen

commit sha f9a896f6f2f33e30f4cbd627613255488cbc2aec

fix compile

view details

Steven Allen

commit sha 0ab2459fcec5e85ea6496174b350b201e0b1518a

convert multisig to new actor abstractions

view details

push time in 15 hours

push eventfilecoin-project/lotus

Steven Allen

commit sha 24ae9205fef921e1e15b59c291859c42ef5851ad

cross-version state tree diff

view details

push time in 16 hours

push eventfilecoin-project/lotus

Steven Allen

commit sha 26e68a76caa8aacba008ebc355c26140b57e1365

cross-version state tree diff

view details

push time in 16 hours

push eventfilecoin-project/lotus

Steven Allen

commit sha e75bb1e01b61c6fa597b1d6a8da7bfb2bdc9539b

cross-version state tree diff

view details

push time in 16 hours

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

 func GetSectorsForWinningPoSt(ctx context.Context, pv ffiwrapper.Verifier, sm *S 		return nil, xerrors.Errorf("generating winning post challenges: %w", err) 	} -	// we don't need to filter here (and it's **very** slow)-	sectors, err := mas.LoadSectorsFromSet(nil, false)+	iter, err := provingSectors.BitIterator() 	if err != nil {-		return nil, xerrors.Errorf("loading proving sectors: %w", err)+		return nil, xerrors.Errorf("iterating over proving sectors: %w", err) 	} -	out := make([]proof.SectorInfo, len(ids))-	for i, n := range ids {-		sb, err := provingSectors.Slice(n, 1)-		if err != nil {-			return nil, err-		}--		sid, err := sb.First()-		if err != nil {-			return nil, err-		}--		var sinfo miner.SectorOnChainInfo-		found, err := sectors.Get(sid, &sinfo)-+	// Select winning sectors by _index_ in the all-sectors bitfield.+	selectedSectors := bitfield.New()+	prev := uint64(0)+	for _, n := range ids {+		sno, err := iter.Nth(n - prev) 		if err != nil {-			return nil, xerrors.Errorf("loading sector info: %w", err)+			return nil, xerrors.Errorf("iterating over proving sectors: %w", err) 		}+		selectedSectors.Set(sno)+		prev = n+	}

@magik6k could you carefully review this code? I think it's right, but I'm not sure if it's tested anywhere.

Stebalien

comment created time in 16 hours

PullRequestReviewEvent

pull request commentipfs/go-ipfs

docs: update changelog for v0.7.0

I generally leave all changes except dep updates.

Also, WDYT about merging this after we merge the release branch back into master instead of before? This means we don't have to deal with the changelog of for a release until the release is actually finalized.

I'm not sure I understand. You mean don't merge this into the release branch? This change should go in the released source tarball (and should be inside the tagged release).

aschmahmann

comment created time in 16 hours

push eventfilecoin-project/lotus

Steven Allen

commit sha 4cf0c105eb12685b384fad6fb3e249898687511f

optimize sector loading And avoid exposing "arrays" via the miner abstraction. We may change these structures later.

view details

push time in 16 hours

push eventfilecoin-project/lotus

Steven Allen

commit sha 7aeee6e5ce3a7b2efb193cee33ee51f779a1a73b

optimize sector loading And avoid exposing "arrays" via the miner abstraction. We may change these structures later.

view details

push time in 16 hours

push eventfilecoin-project/lotus

Steven Allen

commit sha 025663118f65dc50d0dd13364fd57b7cddab70ed

non-destructive diff

view details

push time in 18 hours

fork Stebalien/metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites

https://metamask.io

fork in a day

fork Stebalien/uMatrix

uMatrix: Point and click matrix to filter net requests according to source, destination and type

fork in a day

push eventfilecoin-project/lotus

Steven Allen

commit sha 35bce5a5c691c015abc6b5fc51e85e63bb4915e4

revert post changes 1. Calling the specific partition/deadline APIs is faster. 2. It's _much_ easier to test this way.

view details

push time in 4 days

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

+package miner++import (+	"github.com/filecoin-project/go-state-types/dline"+	"github.com/libp2p/go-libp2p-core/peer"+	"golang.org/x/xerrors"++	"github.com/filecoin-project/go-address"+	"github.com/filecoin-project/go-bitfield"+	"github.com/filecoin-project/go-state-types/abi"+	"github.com/filecoin-project/go-state-types/cbor"+	v0builtin "github.com/filecoin-project/specs-actors/actors/builtin"+	v0miner "github.com/filecoin-project/specs-actors/actors/builtin/miner"++	"github.com/filecoin-project/lotus/chain/actors/adt"+	"github.com/filecoin-project/lotus/chain/types"+)++var Address = v0builtin.InitActorAddr++func Load(store adt.Store, act *types.Actor) (st State, err error) {+	switch act.Code {+	case v0builtin.StorageMinerActorCodeID:+		out := v0State{store: store}+		err := store.Get(store.Context(), act.Head, &out)+		if err != nil {+			return nil, err+		}+		return &out, nil+	}+	return nil, xerrors.Errorf("unknown actor code %s", act.Code)+}++type State interface {+	cbor.Marshaler++	AvailableBalance(abi.TokenAmount) (abi.TokenAmount, error)+	VestedFunds(abi.ChainEpoch) (abi.TokenAmount, error)++	GetSector(abi.SectorNumber) (*SectorOnChainInfo, error)+	FindSector(abi.SectorNumber) (*SectorLocation, error)+	GetSectorExpiration(abi.SectorNumber) (*SectorExpiration, error)+	GetPrecommittedSector(abi.SectorNumber) (*SectorPreCommitOnChainInfo, error)+	LoadSectorsFromSet(filter *bitfield.BitField, filterOut bool) (adt.Array, error)

Ok, I've changed my mind. We need to load sectors for future proofs. That means we need future logic, not the current logic.

Stebalien

comment created time in 4 days

PullRequestReviewEvent

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

+package builtin++import (+	"fmt"++	"github.com/filecoin-project/go-state-types/network"+)++type Version int++const (+	Version0 = iota+)++// Converts a network version into a specs-actors version.+func VersionForNetwork(version network.Version) Version {+	switch version {+	case network.Version0, network.Version1:

We're now encoding this inside the state tree itself.

@magik6k what version do we actually want in the state tree. We could use:

  • Network version (seems like overkill).
  • Actors version (what we're using here).
  • A specific "state tree" version (for the HAMT). That seems like the best approach, honestly.

Thoughts?

Stebalien

comment created time in 4 days

PullRequestReviewEvent

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

 var chainBalanceStateCmd = &cli.Command{  		sm := stmgr.NewStateManager(cs) -		tree, err := state.LoadStateTree(cst, sroot)+		// NETUPGRADE: FIXME.+		// Options: (a) encode the version in the chain or (b) pass a flag.+		tree, err := state.LoadStateTree(cst, sroot, network.Version0)

Ok. We've changed the state root to include a version.

Stebalien

comment created time in 4 days

PullRequestReviewEvent

push eventfilecoin-project/lotus

Steven Allen

commit sha 1bf3b4989dae6ddde14ed8ae5d81b15057901c0f

rename imports to match actors code `sed -i 's/\bv0\(\w\)\(\w*\)/\L\1\E\20/g' **/*.go`

view details

push time in 4 days

push eventfilecoin-project/lotus

Steven Allen

commit sha c130806c374905ec8afa1c25d0201bd1c2c9fe48

compile fix

view details

push time in 4 days

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

 import ( 	datatransfer "github.com/filecoin-project/go-data-transfer" 	"github.com/filecoin-project/go-state-types/abi" 	"github.com/filecoin-project/lotus/build"-	"github.com/filecoin-project/specs-actors/actors/builtin/miner" 	"github.com/ipfs/go-cid" +	v0miner "github.com/filecoin-project/specs-actors/actors/builtin/miner"

I don't really mind either way. But the trailing number is kind of nice. I'll refactor.

Stebalien

comment created time in 4 days

PullRequestReviewEvent

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

 var provingInfoCmd = &cli.Command{ 			return xerrors.Errorf("getting chain head: %w", err) 		} -		cd, err := api.StateMinerProvingDeadline(ctx, maddr, head.Key())+		mact, err := api.StateGetActor(ctx, maddr, head.Key()) 		if err != nil {-			return xerrors.Errorf("getting miner info: %w", err)+			return err 		} -		deadlines, err := api.StateMinerDeadlines(ctx, maddr, head.Key())+		stor := store.ActorStore(ctx, apibstore.NewAPIBlockstore(api))++		mas, err := miner.Load(stor, mact) 		if err != nil {-			return xerrors.Errorf("getting miner deadlines: %w", err)+			return err 		} -		fmt.Printf("Miner: %s\n", color.BlueString("%s", maddr))--		var mas miner.State-		{-			mact, err := api.StateGetActor(ctx, maddr, types.EmptyTSK)-			if err != nil {-				return err-			}-			rmas, err := api.ChainReadObj(ctx, mact.Head)-			if err != nil {-				return err-			}-			if err := mas.UnmarshalCBOR(bytes.NewReader(rmas)); err != nil {-				return err-			}+		cd, err := api.StateMinerProvingDeadline(ctx, maddr, head.Key())+		if err != nil {+			return xerrors.Errorf("getting miner info: %w", err) 		} -		parts := map[uint64][]*miner.Partition{}-		for dlIdx := range deadlines {-			part, err := api.StateMinerPartitions(ctx, maddr, uint64(dlIdx), types.EmptyTSK)-			if err != nil {-				return xerrors.Errorf("getting miner partition: %w", err)-			}--			parts[uint64(dlIdx)] = part-		}+		fmt.Printf("Miner: %s\n", color.BlueString("%s", maddr))  		proving := uint64(0) 		faults := uint64(0) 		recovering := uint64(0)+		curDeadlineSectors := uint64(0) -		for _, partitions := range parts {-			for _, partition := range partitions {-				sc, err := partition.Sectors.Count()-				if err != nil {-					return xerrors.Errorf("count partition sectors: %w", err)+		if err := mas.ForEachDeadline(func(dlIdx uint64, dl miner.Deadline) error {

You know, I'm not actually sure now. We need to compute the a proof for the future so we don't want to attach that to the current state.

Stebalien

comment created time in 4 days

PullRequestReviewEvent

push eventfilecoin-project/lotus

Steven Allen

commit sha f741ce6e3090fefe18d8d480a507b435b54d9fb5

fixup some more imports

view details

push time in 4 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 8747c6083e6ecc1c60620c8dcf67bb07a304d8d4

abstract over account actor

view details

Steven Allen

commit sha 24df873498f0af9ec38672a7c6c9024ec6546b5f

rename imports

view details

Steven Allen

commit sha e60027c00af38a2dee6b3de14c4f28a582b21069

remove todo

view details

Steven Allen

commit sha 8285eda8e507358f5a64080e3894573f6b5b131c

migrate storage miner info

view details

Steven Allen

commit sha 4a7055c32874a08f13ec850e63480dd30a30e66c

fix state loading in vm

view details

push time in 4 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 298efa221cf8908e7aefb2476b997420e18c554a

fix lint errors

view details

push time in 4 days

push eventfilecoin-project/lotus

Steven Allen

commit sha fb2b25c2975b9f996646d71e9fd0b3410d7572b0

finish upgrading chainwatch

view details

push time in 4 days

push eventipfs/go-ipfs

Steven Allen

commit sha 9b94f1179456caa5da18b87cd6a49b62a1f61d62

fix: fix mkreleaselog ignore pattern

view details

push time in 4 days

issue commentipfs/go-ipfs

generate plugin config on init

I don't think this is the right approach. In general, the default config should be empty as it makes it easier to upgrade/change defaults.

godcong

comment created time in 4 days

pull request commentfilecoin-project/lotus

[WIP] Network upgrade support

In case someone has space cycles before I get up, we need a DiffPartitions and, ideally DiffDeadlines implementation. See how we do this for sectors now.

Stebalien

comment created time in 4 days

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

+package power++import (+	"github.com/filecoin-project/go-address"+	"github.com/filecoin-project/go-state-types/abi"+	"github.com/filecoin-project/lotus/chain/actors/builtin"+	v0power "github.com/filecoin-project/specs-actors/actors/builtin/power"+	"github.com/filecoin-project/specs-actors/actors/util/adt"+)++type v0State struct {+	v0power.State+	store adt.Store+}++func (s *v0State) TotalLocked() (abi.TokenAmount, error) {+	return s.TotalPledgeCollateral, nil+}++func (s *v0State) TotalPower() (Claim, error) {+	return Claim{+		RawBytePower:    s.TotalRawBytePower,+		QualityAdjPower: s.TotalQualityAdjPower,+	}, nil+}++func (s *v0State) MinerPower(addr address.Address) (Claim, bool, error) {+	claims, err := adt.AsMap(s.store, s.Claims)+	if err != nil {+		return Claim{}, false, err+	}+	var claim v0power.Claim+	ok, err := claims.Get(abi.AddrKey(addr), &claim)+	if err != nil {+		return Claim{}, false, err+	}+	return Claim{+		RawBytePower:    claim.RawBytePower,+		QualityAdjPower: claim.QualityAdjPower,+	}, ok, nil+}++func (s *v0State) MinerNominalPowerMeetsConsensusMinimum(a address.Address) (bool, error) {+	return s.State.MinerNominalPowerMeetsConsensusMinimum(s.store, a)+}++func (s *v0State) TotalPowerSmoothed() (builtin.FilterEstimate, error) {+	return *s.State.ThisEpochQAPowerSmoothed, nil+}++func (s *v0State) ListAllMiners() ([]address.Address, error) {

Yeah, but maybe ForEachMiner might be better?

Stebalien

comment created time in 5 days

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

+package reward++import (+	"github.com/filecoin-project/go-state-types/abi"+	"golang.org/x/xerrors"++	"github.com/filecoin-project/go-state-types/cbor"+	v0builtin "github.com/filecoin-project/specs-actors/actors/builtin"++	"github.com/filecoin-project/lotus/chain/actors/adt"+	"github.com/filecoin-project/lotus/chain/actors/builtin"+	"github.com/filecoin-project/lotus/chain/types"+)++var Address = v0builtin.RewardActorAddr++func Load(store adt.Store, act *types.Actor) (st State, err error) {+	switch act.Code {+	case v0builtin.RewardActorCodeID:+		out := v0State{store: store}+		err := store.Get(store.Context(), act.Head, &out)+		if err != nil {+			return nil, err+		}+		return &out, nil+	}+	return nil, xerrors.Errorf("unknown actor code %s", act.Code)+}++type State interface {+	cbor.Er

Hm. It seems like some other interface needs to be tighter. We should be able to leave this at cbor.Marshaler.

Stebalien

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventfilecoin-project/lotus

Steven Allen

commit sha daa441b989514f549a1ea5d5bc28bf51e9d3c901

simplify market diff

view details

push time in 4 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 8bd6791e58d8420ce4434e8a92ff87768895e274

more fixups

view details

push time in 4 days

push eventfilecoin-project/lotus

Steven Allen

commit sha f2a0779bb9a6c4e5f9768c3d6ef3da30027c24cb

remove specs-actors import

view details

push time in 4 days

push eventfilecoin-project/lotus

Steven Allen

commit sha b2ee59024f935721f6f277f8ae381afb05a70d91

improve diff logic * Make diffing work across versions. * Start porting more chainwatch logic.

view details

push time in 4 days

pull request commentfilecoin-project/lotus

wdpost: Only add proven partitions to message params

Can we get a test to reproduce?

magik6k

comment created time in 4 days

push eventipfs/go-ipfs

Steven Allen

commit sha 3acd4c68f08d7b628f17ba3413d8a62fc61bb8ce

build: ignore generated files in changelog

view details

push time in 4 days

PR opened ipfs/go-ipfs

build: ignore generated files in changelog
+39 -43

0 comment

12 changed files

pr created time in 4 days

create barnchipfs/go-ipfs

branch : fix/ignore-generated-files

created branch time in 4 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 5bcfee00425c28988db1ef95c5633788bde7dea1

make market diffs work across version upgrades

view details

push time in 5 days

push eventfilecoin-project/lotus

Steven Allen

commit sha dc58f71604b6dbf63c21da966a2d4e146b36abeb

remove unnecessary code Go does have some nice features, once in a while.

view details

push time in 5 days

push eventfilecoin-project/lotus

Steven Allen

commit sha ae38970526b3ea65713333a74ae89f0697ef7e90

remove WpostProvignPeriod function

view details

push time in 5 days

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

+package market++import (+	"github.com/filecoin-project/specs-actors/actors/builtin/market"+	"github.com/filecoin-project/specs-actors/actors/util/adt"+)++type v0State struct {+	market.State+	store adt.Store+}

That shouldn't really be necessary as Load will assert the interface.

Stebalien

comment created time in 5 days

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

 var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ }  func init() {-	power.ConsensusMinerMinPower = big.NewInt(2048)-	miner.SupportedProofTypes = map[abi.RegisteredSealProof]struct{}{+	v0power.ConsensusMinerMinPower = big.NewInt(2048)+	v0miner.SupportedProofTypes = map[abi.RegisteredSealProof]struct{}{ 		abi.RegisteredSealProof_StackedDrg2KiBV1: {}, 	}-	verifreg.MinVerifiedDealSize = big.NewInt(256)+	v0verifreg.MinVerifiedDealSize = big.NewInt(256)

You know, these should probably be exposed by the runtime.

Stebalien

comment created time in 5 days

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

 const ForkLengthThreshold = Finality var BlocksPerEpoch = uint64(builtin.ExpectedLeadersPerEpoch)  // Epochs-const Finality = miner.ChainFinality+const Finality = v0miner.ChainFinality

This should definitely get a TODO.

Stebalien

comment created time in 5 days

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

 func (sm *StateManager) setupGenesisActors(ctx context.Context) error { 		return xerrors.Errorf("error setting up genesis infos: %w", err) 	} -	gi.genesisMsigs = make([]multisig.State, 0, len(totalsByEpoch))+	gi.genesisMsigs = make([]v0msig.State, 0, len(totalsByEpoch))

Hm. This could make running butterfly networks a bit tricky, if we always start at epoch 0 with v0 state.

But we can handle that later, I guess.

Stebalien

comment created time in 5 days

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

 func (sm *StateManager) setupGenesisActors(ctx context.Context) error { 				return err 			} -			if s.StartEpoch != 0 {+			if s.StartEpoch() != 0 { 				return xerrors.New("genesis multisig doesn't start vesting at epoch 0!") 			} -			ot, f := totalsByEpoch[s.UnlockDuration]+			ot, f := totalsByEpoch[s.UnlockDuration()] 			if f {-				totalsByEpoch[s.UnlockDuration] = big.Add(ot, s.InitialBalance)+				totalsByEpoch[s.UnlockDuration()] = big.Add(ot, s.InitialBalance()) 			} else {-				totalsByEpoch[s.UnlockDuration] = s.InitialBalance+				totalsByEpoch[s.UnlockDuration()] = s.InitialBalance()

What is this trying to do? These unlock continuously, so I'm not sure what this is computing.

Stebalien

comment created time in 5 days

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

+package market++import (+	"bytes"+	"errors"+	"fmt"++	"github.com/filecoin-project/go-address"+	"github.com/filecoin-project/go-state-types/abi"+	"github.com/filecoin-project/lotus/chain/actors/adt"+	"github.com/filecoin-project/lotus/chain/types"+	"github.com/filecoin-project/specs-actors/actors/builtin/market"+	v0adt "github.com/filecoin-project/specs-actors/actors/util/adt"+	typegen "github.com/whyrusleeping/cbor-gen"+)++type v0State struct {+	market.State+	store adt.Store+}++func (s *v0State) TotalLocked() (abi.TokenAmount, error) {+	fml := types.BigAdd(s.TotalClientLockedCollateral, s.TotalProviderLockedCollateral)+	fml = types.BigAdd(fml, s.TotalClientStorageFee)+	return fml, nil+}++func (s *v0State) BalancesChanged(otherState State) bool {+	v0otherState, ok := otherState.(*v0State)+	if !ok {+		// there's no way to compare differnt versions of the state, so let's+		// just say that means the state of balances has changed+		return true+	}+	return !s.State.EscrowTable.Equals(v0otherState.State.EscrowTable) || !s.State.LockedTable.Equals(v0otherState.State.LockedTable)+}++func (s *v0State) StatesChanged(otherState State) bool {+	v0otherState, ok := otherState.(*v0State)+	if !ok {+		// there's no way to compare differnt versions of the state, so let's+		// just say that means the state of balances has changed

This isn't entirely true, but it may not be worth doing this correctly. We can, in fact, do this the slow way and compare everything.

Stebalien

comment created time in 5 days

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

+package market++import (+	"bytes"+	"errors"+	"fmt"++	"github.com/filecoin-project/go-address"+	"github.com/filecoin-project/go-state-types/abi"+	"github.com/filecoin-project/lotus/chain/actors/adt"+	"github.com/filecoin-project/lotus/chain/types"+	"github.com/filecoin-project/specs-actors/actors/builtin/market"+	v0adt "github.com/filecoin-project/specs-actors/actors/util/adt"+	typegen "github.com/whyrusleeping/cbor-gen"+)++type v0State struct {+	market.State+	store adt.Store+}++func (s *v0State) TotalLocked() (abi.TokenAmount, error) {+	fml := types.BigAdd(s.TotalClientLockedCollateral, s.TotalProviderLockedCollateral)+	fml = types.BigAdd(fml, s.TotalClientStorageFee)+	return fml, nil+}++func (s *v0State) BalancesChanged(otherState State) bool {+	v0otherState, ok := otherState.(*v0State)+	if !ok {+		// there's no way to compare differnt versions of the state, so let's+		// just say that means the state of balances has changed+		return true+	}+	return !s.State.EscrowTable.Equals(v0otherState.State.EscrowTable) || !s.State.LockedTable.Equals(v0otherState.State.LockedTable)+}++func (s *v0State) StatesChanged(otherState State) bool {+	v0otherState, ok := otherState.(*v0State)+	if !ok {+		// there's no way to compare differnt versions of the state, so let's+		// just say that means the state of balances has changed+		return true+	}+	return !s.State.States.Equals(v0otherState.State.States)+}++func (s *v0State) States() (DealStates, error) {+	stateArray, err := v0adt.AsArray(s.store, s.State.States)+	if err != nil {+		return nil, err+	}+	return &v0DealStates{stateArray}, nil+}++func (s *v0State) ProposalsChanged(otherState State) bool {+	v0otherState, ok := otherState.(*v0State)+	if !ok {+		// there's no way to compare differnt versions of the state, so let's+		// just say that means the state of balances has changed+		return true+	}+	return !s.State.Proposals.Equals(v0otherState.State.Proposals)+}++func (s *v0State) Proposals() (DealProposals, error) {+	proposalArray, err := v0adt.AsArray(s.store, s.State.Proposals)+	if err != nil {+		return nil, err+	}+	return &v0DealProposals{proposalArray}, nil+}++func (s *v0State) EscrowTable() (BalanceTable, error) {+	bt, err := v0adt.AsBalanceTable(s.store, s.State.EscrowTable)+	if err != nil {+		return nil, err+	}+	return &v0BalanceTable{bt}, nil+}++func (s *v0State) LockedTable() (BalanceTable, error) {+	bt, err := v0adt.AsBalanceTable(s.store, s.State.LockedTable)+	if err != nil {+		return nil, err+	}+	return &v0BalanceTable{bt}, nil+}++func (s *v0State) VerifyDealsForActivation(+	minerAddr address.Address, deals []abi.DealID, currEpoch, sectorExpiry abi.ChainEpoch,+) (weight, verifiedWeight abi.DealWeight, err error) {+	return market.ValidateDealsForActivation(&s.State, s.store, deals, minerAddr, sectorExpiry, currEpoch)+}++type v0BalanceTable struct {+	*v0adt.BalanceTable+}++func (bt *v0BalanceTable) ForEach(cb func(address.Address, abi.TokenAmount) error) error {+	asMap := (*v0adt.Map)(bt.BalanceTable)+	var ta abi.TokenAmount+	return asMap.ForEach(&ta, func(key string) error {+		a, err := address.NewFromBytes([]byte(key))+		if err != nil {+			return err+		}+		return cb(a, ta)+	})+}++type v0DealStates struct {+	adt.Array+}++func (s *v0DealStates) Get(dealID abi.DealID) (*DealState, bool, error) {+	var v0deal market.DealState+	found, err := s.Array.Get(uint64(dealID), &v0deal)+	if err != nil {+		return nil, false, err+	}+	if !found {+		return nil, false, nil+	}+	deal := fromV0DealState(v0deal)+	return &deal, true, nil+}++func (s *v0DealStates) Diff(other DealStates) (*DealStateChanges, error) {+	v0other, ok := other.(*v0DealStates)+	if !ok {+		// TODO handle this if possible on a case by case basis but for now, just fail

I think we are going to need this.

Stebalien

comment created time in 5 days

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

+package multisig++import (+	"golang.org/x/xerrors"++	"github.com/filecoin-project/go-state-types/abi"+	"github.com/filecoin-project/go-state-types/cbor"+	v0builtin "github.com/filecoin-project/specs-actors/actors/builtin"++	"github.com/filecoin-project/lotus/chain/actors/adt"+	"github.com/filecoin-project/lotus/chain/types"+)++func Load(store adt.Store, act *types.Actor) (State, error) {+	switch act.Code {+	case v0builtin.MultisigActorCodeID:+		out := v0State{store: store}+		err := store.Get(store.Context(), act.Head, &out)+		if err != nil {+			return nil, err+		}+		return &out, nil+	}+	return nil, xerrors.Errorf("unknown actor code %s", act.Code)+}++type State interface {+	cbor.Marshaler++	LockedBalance(epoch abi.ChainEpoch) (abi.TokenAmount, error)+	StartEpoch() abi.ChainEpoch+	UnlockDuration() abi.ChainEpoch+	InitialBalance() abi.TokenAmount

Should return errors, just in case.

Stebalien

comment created time in 5 days

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

+package miner++import (+	"github.com/filecoin-project/go-state-types/dline"+	"github.com/libp2p/go-libp2p-core/peer"+	"golang.org/x/xerrors"++	"github.com/filecoin-project/go-address"+	"github.com/filecoin-project/go-bitfield"+	"github.com/filecoin-project/go-state-types/abi"+	"github.com/filecoin-project/go-state-types/cbor"+	v0builtin "github.com/filecoin-project/specs-actors/actors/builtin"+	v0miner "github.com/filecoin-project/specs-actors/actors/builtin/miner"++	"github.com/filecoin-project/lotus/chain/actors/adt"+	"github.com/filecoin-project/lotus/chain/types"+)++var Address = v0builtin.InitActorAddr++func Load(store adt.Store, act *types.Actor) (st State, err error) {+	switch act.Code {+	case v0builtin.StorageMinerActorCodeID:+		out := v0State{store: store}+		err := store.Get(store.Context(), act.Head, &out)+		if err != nil {+			return nil, err+		}+		return &out, nil+	}+	return nil, xerrors.Errorf("unknown actor code %s", act.Code)+}++type State interface {+	cbor.Marshaler++	AvailableBalance(abi.TokenAmount) (abi.TokenAmount, error)+	VestedFunds(abi.ChainEpoch) (abi.TokenAmount, error)++	GetSector(abi.SectorNumber) (*SectorOnChainInfo, error)+	FindSector(abi.SectorNumber) (*SectorLocation, error)+	GetSectorExpiration(abi.SectorNumber) (*SectorExpiration, error)+	GetPrecommittedSector(abi.SectorNumber) (*SectorPreCommitOnChainInfo, error)+	LoadSectorsFromSet(filter *bitfield.BitField, filterOut bool) (adt.Array, error)+	LoadPreCommittedSectors() (adt.Map, error)+	IsAllocated(abi.SectorNumber) (bool, error)++	LoadDeadline(idx uint64) (Deadline, error)+	ForEachDeadline(cb func(idx uint64, dl Deadline) error) error+	NumDeadlines() (uint64, error)+	Info() (MinerInfo, error)++	DeadlineInfo(epoch abi.ChainEpoch) *dline.Info
  1. All functions should return errors, just in case we need to move state somewhere else.
  2. This function is a bit tricky. If I ask the miner's state about a deadline in the future, I might need to use future actor code.
Stebalien

comment created time in 5 days

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

+package miner++import (+	"github.com/filecoin-project/go-state-types/dline"+	"github.com/libp2p/go-libp2p-core/peer"+	"golang.org/x/xerrors"++	"github.com/filecoin-project/go-address"+	"github.com/filecoin-project/go-bitfield"+	"github.com/filecoin-project/go-state-types/abi"+	"github.com/filecoin-project/go-state-types/cbor"+	v0builtin "github.com/filecoin-project/specs-actors/actors/builtin"+	v0miner "github.com/filecoin-project/specs-actors/actors/builtin/miner"++	"github.com/filecoin-project/lotus/chain/actors/adt"+	"github.com/filecoin-project/lotus/chain/types"+)++var Address = v0builtin.InitActorAddr++func Load(store adt.Store, act *types.Actor) (st State, err error) {+	switch act.Code {+	case v0builtin.StorageMinerActorCodeID:+		out := v0State{store: store}+		err := store.Get(store.Context(), act.Head, &out)+		if err != nil {+			return nil, err+		}+		return &out, nil+	}+	return nil, xerrors.Errorf("unknown actor code %s", act.Code)+}++type State interface {+	cbor.Marshaler++	AvailableBalance(abi.TokenAmount) (abi.TokenAmount, error)+	VestedFunds(abi.ChainEpoch) (abi.TokenAmount, error)++	GetSector(abi.SectorNumber) (*SectorOnChainInfo, error)+	FindSector(abi.SectorNumber) (*SectorLocation, error)+	GetSectorExpiration(abi.SectorNumber) (*SectorExpiration, error)+	GetPrecommittedSector(abi.SectorNumber) (*SectorPreCommitOnChainInfo, error)+	LoadSectorsFromSet(filter *bitfield.BitField, filterOut bool) (adt.Array, error)+	LoadPreCommittedSectors() (adt.Map, error)+	IsAllocated(abi.SectorNumber) (bool, error)++	LoadDeadline(idx uint64) (Deadline, error)+	ForEachDeadline(cb func(idx uint64, dl Deadline) error) error+	NumDeadlines() (uint64, error)+	Info() (MinerInfo, error)++	DeadlineInfo(epoch abi.ChainEpoch) *dline.Info+	WpostProvingPeriod() abi.ChainEpoch

Can we just use DeadlineInfo?

Stebalien

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventfilecoin-project/lotus

Steven Allen

commit sha 708aa368e1d6867647c2424fc4b1290ce3226d81

remove dep on v0 miner

view details

push time in 5 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 18bc59b93befe07fa4fe9f76652616f743c71fa2

uncruft

view details

push time in 5 days

Pull request review commentfilecoin-project/lotus

[WIP] Network upgrade support

+package miner++import (+	"github.com/filecoin-project/go-state-types/dline"+	"github.com/libp2p/go-libp2p-core/peer"+	"golang.org/x/xerrors"++	"github.com/filecoin-project/go-address"+	"github.com/filecoin-project/go-bitfield"+	"github.com/filecoin-project/go-state-types/abi"+	"github.com/filecoin-project/go-state-types/cbor"+	v0builtin "github.com/filecoin-project/specs-actors/actors/builtin"+	v0miner "github.com/filecoin-project/specs-actors/actors/builtin/miner"++	"github.com/filecoin-project/lotus/chain/actors/adt"+	"github.com/filecoin-project/lotus/chain/types"+)++var Address = v0builtin.InitActorAddr++func Load(store adt.Store, act *types.Actor) (st State, err error) {+	switch act.Code {+	case v0builtin.StorageMinerActorCodeID:+		out := v0State{store: store}+		err := store.Get(store.Context(), act.Head, &out)+		if err != nil {+			return nil, err+		}+		return &out, nil+	}+	return nil, xerrors.Errorf("unknown actor code %s", act.Code)+}++type State interface {+	cbor.Marshaler++	AvailableBalance(abi.TokenAmount) (abi.TokenAmount, error)+	VestedFunds(abi.ChainEpoch) (abi.TokenAmount, error)++	GetSector(abi.SectorNumber) (*SectorOnChainInfo, error)+	FindSector(abi.SectorNumber) (*SectorLocation, error)+	GetSectorExpiration(abi.SectorNumber) (*SectorExpiration, error)+	GetPrecommittedSector(abi.SectorNumber) (*SectorPreCommitOnChainInfo, error)+	LoadSectorsFromSet(filter *bitfield.BitField, filterOut bool) (adt.Array, error)

We should instead introduce a LoadSectorsForWinningPoSt and LoadSectorsForWindowPoSt function.

Stebalien

comment created time in 5 days

PullRequestReviewEvent

Pull request review commentfilecoin-project/lotus

wdpost: fix post with terminated sectors

 func (s *WindowPoStScheduler) runPost(ctx context.Context, di dline.Info, ts *ty  				skipCount += sc -				ssi, err := s.sectorsForProof(ctx, good, partition.Sectors, ts)+				ssi, err := s.sectorsForProof(ctx, good, toProve, ts)

I'm not sure what was wrong here, but this isn't the right fix. We should include terminated sectors in this bitfield. sectorsForProof will (or should) replace these terminated sectors (really, all sectors not included in "good") with the first "good" sector.

See https://github.com/filecoin-project/specs-actors/blob/d48c45d15f1d79b06bc27c5be326a9b88c1fae39/actors/builtin/miner/deadline_state.go#L961

magik6k

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventfilecoin-project/lotus

Steven Allen

commit sha 454c382e7ec024d2de7c7a91f83e6e0d71d78b8b

migrate StateMinerInitialPledgeCollateral

view details

push time in 6 days

pull request commentfilecoin-project/lotus

Sever chainstore's dependence on the state tree

Note: now that we're encoding the version in the state tree, this change shouldn't actually be necessary.

arajasek

comment created time in 6 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 92471d41d6923032eb807b857c02461e66d225b6

migrate precommit deposit function

view details

push time in 6 days

push eventfilecoin-project/lotus

Steven Allen

commit sha e1ba4eb5c449c9686c96d50aacd68d403d1370e0

sub reward actor

view details

Steven Allen

commit sha 02bc5fab268579539224af39e85b4a960209dbc2

add power actor address alias

view details

push time in 7 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 4e01fad0d47faafbf799eb7a0e6ee14e065018b2

start multisig abstraction

view details

push time in 7 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 91e9573863b8161b417910c253fdb994624ba211

Compile fixes

view details

push time in 7 days

push eventfilecoin-project/lotus

Steven Allen

commit sha c64f983900f8a0e2b7c1800dd2a4b1b96b201d1b

migrate StateMinserSectorCount

view details

push time in 7 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 53384e83d7c6d5488c0ec605959666dee49dc248

migrate wallet access

view details

push time in 7 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 4cd92d8576aeb31044b821d09ef1d333e2a24f0c

remove final WithStateTree

view details

push time in 7 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 6bf7976add095e8544e28f67517985dfb5e6591e

fix decode

view details

push time in 7 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 00c6397ec96170efd2124ef9c3bc9432090750f1

more progress

view details

push time in 7 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 36f920bcd7487c0bb0fb81326109882fda9b98b9

progress

view details

push time in 7 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 7fa6c1e8d04c3a68c1a37928af3c10c44b5fcff6

add info method to miner state API

view details

push time in 8 days

push eventfilecoin-project/lotus

Steven Allen

commit sha cc4d5306ebc363fa912310a2b2f96c4db2486c53

Progress

view details

push time in 8 days

push eventfilecoin-project/lotus

Raúl Kripalani

commit sha 695f6cfe4553ba1ebca9dd6365ac46256effe47a

wip in-memory journal.

view details

Raúl Kripalani

commit sha bef7d64e666242c19e4f76cb88422c64947e8f00

refactor EventType construction.

view details

Raúl Kripalani

commit sha 4bcf01938c151cf4a0d1c4cbf99fe18b36f885f5

use new journal from chain/store pkg.

view details

Raúl Kripalani

commit sha becbff0b134e84e37e4cd03349964ef13ac67f4e

add NilJournal; fix call sites to ChainStore constructor.

view details

Raúl Kripalani

commit sha 4d2d8b2d11837391a178b3f5d4836a9918b1ec22

Merge branch 'next' into inmem-journal

view details

Raúl Kripalani

commit sha 226786c1daeae33a5d4ef9b11ec572c97c300d40

wip

view details

Raúl Kripalani

commit sha 7459ec6bbafa709a34fa27bacd2bda51110023a6

add mpool journal events; fix dependency injection.

view details

Raúl Kripalani

commit sha d6e6eedd581565fa69dccae8ecbb648b9f2272e1

pipe sealing events to the journal.

view details

Raúl Kripalani

commit sha 3bd9d55a156c5f43ecf44be24a7eb53435745edd

message pool: write message(s) in journal entries.

view details

Raúl Kripalani

commit sha cb8e209f7806170fb48a8528934878a8815e7c62

journal: disable noisy message pool events.

view details

Raúl Kripalani

commit sha d547c2588c0b84f0660f1332aa9e0ae4f0509483

record deals events in journal.

view details

Raúl Kripalani

commit sha 4e82cf369c92d2f611cb1c62832aac448ac32280

rename journal entries to journal events.

view details

Raúl Kripalani

commit sha 443473f8338effeaa3e1f8c0f7005012b558083c

fix tests.

view details

Raúl Kripalani

commit sha b8475114ba4a42f414adb7ead78778d9d98c8688

Merge branch 'next' into inmem-journal

view details

Raúl Kripalani

commit sha 5074ce5a38986ac517c00fc2c022aa2dcf01dd4d

move in-mem journal to Project Oni.

view details

Raúl Kripalani

commit sha 92598237c38b237095e6a4b184d851b8e50f6d86

Merge branch 'next' into inmem-journal

view details

Raúl Kripalani

commit sha bca516b02815625695d5e33ce0b494f2d9718776

Merge remote-tracking branch 'origin/next' into inmem-journal

view details

Raúl Kripalani

commit sha 5e2c28d7e9e84c77ffde8b0b63178f42e2af0119

add comment.

view details

Raúl Kripalani

commit sha d53c6f25991630fb085508298c4e3e6d7e9eebef

storage-fsm: emit sealing state transition notifications.

view details

Raúl Kripalani

commit sha 2ea5abdfb5cbba97d5c935a3ad3f292287e760cf

wire journal into miner.

view details

push time in 8 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 9804310cc8243dc34e2944fc4ee839fbf3251c2c

Update specs-actors to 0.9.10 Moves the Keyer type (and helpers) into go-state-types.

view details

Steven Allen

commit sha f9ea3935ff90b39b434fb379b90702530f052563

Merge pull request #3846 from filecoin-project/steb/specs-actors-0.9.10 Update specs-actors to 0.9.10

view details

push time in 8 days

delete branch filecoin-project/lotus

delete branch : steb/specs-actors-0.9.10

delete time in 8 days

PR merged filecoin-project/lotus

Reviewers
Update specs-actors to 0.9.10

Moves the Keyer type (and helpers) into go-state-types.

+48 -43

0 comment

15 changed files

Stebalien

pr closed time in 8 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 9804310cc8243dc34e2944fc4ee839fbf3251c2c

Update specs-actors to 0.9.10 Moves the Keyer type (and helpers) into go-state-types.

view details

push time in 8 days

PR opened filecoin-project/lotus

Reviewers
Update specs-actors to 0.9.10

Moves the Keyer type (and helpers) into go-state-types.

+46 -42

0 comment

15 changed files

pr created time in 8 days

push eventfilecoin-project/lotus

Steven Allen

commit sha 93ca56359ccf8d3896c4bf1acc073cb79b1181f1

Update specs-actors to 0.9.10 Moves the Keyer type (and helpers) into go-state-types.

view details

push time in 8 days

push eventfilecoin-project/lotus

Łukasz Magiera

commit sha 8a05fe86d6e6504004aae927f2e27dd02a4c6159

wdpost: Skip sectors correctly

view details

Łukasz Magiera

commit sha 665f93bbb7ee37c11dc8ca77129cd9961f54c012

Merge pull request #3839 from filecoin-project/fix/skipped-skipping wdpost: Skip sectors correctly

view details

Aayush Rajasekaran

commit sha 07e574db44509b6b82e206225c7befbea92b1c2d

Merge pull request #3844 from filecoin-project/steb/specs-actors-0.9.9 Update to specs-actors 0.9.9

view details

Steven Allen

commit sha 0dc5ac125caa2a5eb70e69a870c8d7616bf23dc9

Update specs-actors to 0.9.10 Moves the Keyer type (and helpers) into go-state-types.

view details

push time in 8 days

create barnchfilecoin-project/lotus

branch : steb/specs-actors-0.9.10

created branch time in 8 days

pull request commentipfs/go-ipfs

chore: replace an fmt.Printf with a log.Infof()

This is going to be a pretty significant breaking change to downstream projects. I agree that the design is sub-par, but I'm not sure if this change is worth it (given that it's easy to just call Listen then Serve).

moul

comment created time in 8 days

delete branch filecoin-project/specs-actors

delete branch : backport/keyer-move

delete time in 8 days

Pull request review commentfilecoin-project/lotus

Update to specs-actors 0.9.9

 func (rt *Runtime) Send(to address.Address, method abi.MethodNum, m vmr.CBORMars 		params = buf.Bytes() 	} -	ret, err := rt.internalSend(rt.Message().Receiver(), to, method, value, params)+	ret, err := rt.internalSend(rt.Receiver(), to, method, value, params) 	if err != nil { 		if err.IsFatal() { 			panic(err) 		} 		log.Warnf("vmctx send failed: to: %s, method: %d: ret: %d, err: %s", to, method, ret, err)-		return &dumbWrapperType{nil}, err.RetCode()+		return err.RetCode() 	} 	_ = rt.chargeGasSafe(gasOnActorExec)-	return &dumbWrapperType{ret}, 0++	if err := out.UnmarshalCBOR(bytes.NewReader(ret)); err != nil {+		rt.Abortf(exitcode.ErrSerialization, "failed to unmarshal return value: %s", err)+	}

We should only hit this if we have a bug. Honestly, we might want to panic (or do something really noisy here).

Can we run a chain import against this to see if we have ever hit a bug here?

Stebalien

comment created time in 8 days

more