Skip to content

Commit

Permalink
feat: implement synthetic PoRep
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Sep 21, 2023
1 parent 15b69ba commit 4e71b8a
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 131 deletions.
2 changes: 1 addition & 1 deletion cmd/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ var newMinerCmd = &cmds.Command{
return fmt.Errorf("getting network version: %v", err)
}

spt, err := miner.SealProofTypeFromSectorSize(ssize, nv)
spt, err := miner.SealProofTypeFromSectorSize(ssize, nv, false)
if err != nil {
return fmt.Errorf("getting seal proof type: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/seed.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ var preSealCmd = &cmds.Command{
nv = network.Version(ver)
}

spt, err := miner.SealProofTypeFromSectorSize(sectorSize, nv)
spt, err := miner.SealProofTypeFromSectorSize(sectorSize, nv, false)
if err != nil {
return err
}
Expand Down
Binary file modified fixtures/assets/genesis-car/butterflynet.car
Binary file not shown.
12 changes: 6 additions & 6 deletions fixtures/networks/butterfly.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ func ButterflySnapNet() *NetworkConf {
return &NetworkConf{
Bootstrap: config.BootstrapConfig{
Addresses: []string{
"/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWD5mtdmjHQ1Puj9Md7SEfoa7kWMpwqUhAKsyYsBP56LQC",
"/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWEoYPkm6o87ES6AppFY7d7WHJUQg7XVPRAyQZjEU31efQ",
"/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWMH8fFcfL6K7dwRo2wqa4UjdM5pxg9DAnoWPrVRx4Dioj",
"/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWArCrw1TLyJ5r37pYvHgv9kkXNC8tu2t1Sx7hyoCHpRje",
},
Period: "30s",
},
Network: config.NetworkParamsConfig{
DevNet: true,
NetworkType: types.NetworkButterfly,
GenesisNetworkVersion: network.Version18,
GenesisNetworkVersion: network.Version20,
ReplaceProofTypes: []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg512MiBV1,
abi.RegisteredSealProof_StackedDrg32GiBV1,
Expand Down Expand Up @@ -53,9 +53,9 @@ func ButterflySnapNet() *NetworkConf {
UpgradeSkyrHeight: -19,
UpgradeSharkHeight: -20,
UpgradeHyggeHeight: -21,
UpgradeLightningHeight: 50,
UpgradeThunderHeight: 50 + 360,
UpgradeWatermelonHeight: 999999999999999,
UpgradeLightningHeight: -22,
UpgradeThunderHeight: -23,
UpgradeWatermelonHeight: 900,
},
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1},
AddressNetwork: address.Testnet,
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/
github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.12/go.mod h1:n/kujdC9JphvYTrmaD1+vJpvDPy/DwzckoMzP0nBKWI=
github.com/filecoin-project/go-state-types v0.11.1/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8=
github.com/filecoin-project/go-state-types v0.11.2-0.20230712101859-8f37624fa540/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8=
github.com/filecoin-project/go-state-types v0.12.1 h1:/1ip/jXIP4QzWd3hlaQ7RGp1DHKKYG3+NOhd/r08UJY=
github.com/filecoin-project/go-state-types v0.12.1/go.mod h1:KOBGyvCalT8uHBS7KSKOVbjsilD90bBZHgLAqrzz6gU=
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig=
Expand Down
2 changes: 1 addition & 1 deletion pkg/gen/genesis/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ func MakeGenesisBlock(ctx context.Context, rep repo.Repo, bs bstore.Blockstore,
}

// setup Storage Miners
stateroot, err = SetupStorageMiners(ctx, cs, stateroot, template.Miners, template.NetworkVersion, para)
stateroot, err = SetupStorageMiners(ctx, cs, stateroot, template.Miners, template.NetworkVersion, para, false)
if err != nil {
return nil, fmt.Errorf("setup miners failed: %w", err)
}
Expand Down
11 changes: 9 additions & 2 deletions pkg/gen/genesis/miners.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,14 @@ func mkFakedSigSyscalls(sys vmcontext.SyscallsImpl) vmcontext.SyscallsImpl {
}

// Note: Much of this is brittle, if the methodNum / param / return changes, it will break things
func SetupStorageMiners(ctx context.Context, cs *chain.Store, sroot cid.Cid, miners []Miner, nv network.Version, para *config.ForkUpgradeConfig) (cid.Cid, error) {
func SetupStorageMiners(ctx context.Context,
cs *chain.Store,
sroot cid.Cid,
miners []Miner,
nv network.Version,
para *config.ForkUpgradeConfig,
synthetic bool,
) (cid.Cid, error) {
cst := cbor.NewCborStore(cs.Blockstore())
av, err := actorstypes.VersionForNetwork(nv)
if err != nil {
Expand Down Expand Up @@ -147,7 +154,7 @@ func SetupStorageMiners(ctx context.Context, cs *chain.Store, sroot cid.Cid, min
i := i
m := m

spt, err := miner.SealProofTypeFromSectorSize(m.SectorSize, nv)
spt, err := miner.SealProofTypeFromSectorSize(m.SectorSize, nv, synthetic)
if err != nil {
return cid.Undef, err
}
Expand Down
2 changes: 1 addition & 1 deletion venus-devtool/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psS
github.com/filecoin-project/go-state-types v0.1.4/go.mod h1:xCA/WfKlC2zcn3fUmDv4IrzznwS98X5XW/irUP3Lhxg=
github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.11.1/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8=
github.com/filecoin-project/go-state-types v0.11.2-0.20230712101859-8f37624fa540/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8=
github.com/filecoin-project/go-state-types v0.12.1 h1:/1ip/jXIP4QzWd3hlaQ7RGp1DHKKYG3+NOhd/r08UJY=
github.com/filecoin-project/go-state-types v0.12.1/go.mod h1:KOBGyvCalT8uHBS7KSKOVbjsilD90bBZHgLAqrzz6gU=
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig=
Expand Down
Binary file modified venus-shared/actors/builtin-actors-code/v12.tar.zst
Binary file not shown.
Loading

0 comments on commit 4e71b8a

Please sign in to comment.