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

Feat/update actor and network skeleton / 升级网络框架以及 actor bundle #5900

Merged
merged 4 commits into from
Apr 13, 2023
Merged
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
2 changes: 2 additions & 0 deletions app/submodule/chain/chaininfo_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@ func (cia *chainInfoAPI) StateGetNetworkParams(ctx context.Context) (*types.Netw
UpgradeSkyrHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeSkyrHeight,
UpgradeSharkHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeSharkHeight,
UpgradeHyggeHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeHyggeHeight,
UpgradeLightningHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeLightningHeight,
UpgradeThunderHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeThunderHeight,
},
}

Expand Down
3 changes: 3 additions & 0 deletions fixtures/networks/butterfly.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ func ButterflySnapNet() *NetworkConf {
UpgradeSkyrHeight: -19,
UpgradeSharkHeight: -20,
UpgradeHyggeHeight: 600,
// TODO: set upgrade height
UpgradeLightningHeight: 999999999999999,
UpgradeThunderHeight: 999999999999999 + 1,
},
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1},
AddressNetwork: address.Testnet,
Expand Down
3 changes: 3 additions & 0 deletions fixtures/networks/calibration.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ func Calibration() *NetworkConf {
UpgradeSkyrHeight: 510,
UpgradeSharkHeight: 16800,
UpgradeHyggeHeight: 322354, // 2023-02-21T16:30:00Z
// TODO: set upgrade height
UpgradeLightningHeight: 999999999999999,
UpgradeThunderHeight: 999999999999999 + 1,
},
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1},
AddressNetwork: address.Testnet,
Expand Down
2 changes: 2 additions & 0 deletions fixtures/networks/forcenet.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ func ForceNet() *NetworkConf {
UpgradeSkyrHeight: -19,
UpgradeSharkHeight: -20,
UpgradeHyggeHeight: 30,
UpgradeLightningHeight: 30,
UpgradeThunderHeight: 1000,
},
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: config.DrandMainnet},
AddressNetwork: address.Testnet,
Expand Down
5 changes: 4 additions & 1 deletion fixtures/networks/integrationtestnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ func IntegrationNet() *NetworkConf {
UpgradeOhSnapHeight: 1594680,
UpgradeSkyrHeight: 1960320,
UpgradeSharkHeight: 2383680,
UpgradeHyggeHeight: 99999999999999,
UpgradeHyggeHeight: 2683348,
// TODO: set correct upgrade height
UpgradeLightningHeight: 999999999999999,
UpgradeThunderHeight: 999999999999999 + 1,
},
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 5, 51000: 1},
AddressNetwork: address.Testnet,
Expand Down
5 changes: 4 additions & 1 deletion fixtures/networks/interopnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ func InteropNet() *NetworkConf {
UpgradeOhSnapHeight: -18,
UpgradeSkyrHeight: -19,
UpgradeSharkHeight: -20,
UpgradeHyggeHeight: 99999999999999,
UpgradeHyggeHeight: 100,
// TODO: set correct upgrade height
UpgradeLightningHeight: 200,
UpgradeThunderHeight: 300 + 1,
},
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1},
AddressNetwork: address.Testnet,
Expand Down
3 changes: 3 additions & 0 deletions fixtures/networks/mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ func Mainnet() *NetworkConf {
UpgradeSkyrHeight: 1960320, // 2022-07-06T14:00:00Z
UpgradeSharkHeight: 2383680, // 2022-11-30T14:00:00Z
UpgradeHyggeHeight: 2683348, // 2023-03-14T15:14:00Z
// TODO: set correct upgrade height
UpgradeLightningHeight: 999999999999999,
UpgradeThunderHeight: 999999999999999 + 1,
},
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 5, 51000: 1},
AddressNetwork: address.Mainnet,
Expand Down
4 changes: 3 additions & 1 deletion fixtures/networks/net_2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ func Net2k() *NetworkConf {
UpgradeOhSnapHeight: -18,
UpgradeSkyrHeight: -19,
UpgradeSharkHeight: -20,
UpgradeHyggeHeight: 30,
UpgradeHyggeHeight: -21,
UpgradeLightningHeight: 30,
UpgradeThunderHeight: 1000,
},
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1},
AddressNetwork: address.Testnet,
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ require (
github.com/filecoin-project/go-fil-markets v1.25.2
github.com/filecoin-project/go-jsonrpc v0.1.5
github.com/filecoin-project/go-paramfetch v0.0.4
github.com/filecoin-project/go-state-types v0.10.0
github.com/filecoin-project/go-state-types v0.11.0-rc1
github.com/filecoin-project/pubsub v1.0.0
github.com/filecoin-project/specs-actors v0.9.15
github.com/filecoin-project/specs-actors/v2 v2.3.6
Expand Down Expand Up @@ -128,7 +128,7 @@ require (
)

require (
github.com/BurntSushi/toml v1.1.0 // indirect
github.com/BurntSushi/toml v1.1.0
github.com/Kubuxu/go-os-helper v0.0.1 // indirect
github.com/Stebalien/go-bitfield v0.0.1 // indirect
github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a // indirect
Expand Down
7 changes: 5 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ github.com/filecoin-project/go-state-types v0.1.4/go.mod h1:xCA/WfKlC2zcn3fUmDv4
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.8/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.10.0 h1:vsSThZIaPmOxNGG59+8D/HnlWRtlbdOjduH6ye+v8f0=
github.com/filecoin-project/go-state-types v0.10.0/go.mod h1:aLIas+W8BWAfpLWEPUOGMPBdhcVwoCG4pIQSQk26024=
github.com/filecoin-project/go-state-types v0.11.0-rc1 h1:UvifFHZ+S/jbshCjRHgAUuZ1qAEyeItsNywh2tsSpY4=
github.com/filecoin-project/go-state-types v0.11.0-rc1/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8=
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig=
github.com/filecoin-project/go-statemachine v1.0.2 h1:421SSWBk8GIoCoWYYTE/d+qCWccgmRH0uXotXRDjUbc=
github.com/filecoin-project/go-statemachine v1.0.2/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54=
Expand Down Expand Up @@ -875,6 +875,7 @@ github.com/ipld/go-ipld-prime v0.11.0/go.mod h1:+WIAkokurHmZ/KwzDOMUuoeJgaRQktHt
github.com/ipld/go-ipld-prime v0.14.0/go.mod h1:9ASQLwUFLptCov6lIYc70GRB4V7UTyLD0IJtrDJe6ZM=
github.com/ipld/go-ipld-prime v0.16.0/go.mod h1:axSCuOCBPqrH+gvXr2w9uAOulJqBPhHPT2PjoiiU1qA=
github.com/ipld/go-ipld-prime v0.17.0/go.mod h1:aYcKm5TIvGfY8P3QBKz/2gKcLxzJ1zDaD+o0bOowhgs=
github.com/ipld/go-ipld-prime v0.19.0/go.mod h1:Q9j3BaVXwaA3o5JUDNvptDDr/x8+F7FG6XJ8WI3ILg4=
github.com/ipld/go-ipld-prime v0.20.0 h1:Ud3VwE9ClxpO2LkCYP7vWPc0Fo+dYdYzgxUJZ3uRG4g=
github.com/ipld/go-ipld-prime v0.20.0/go.mod h1:PzqZ/ZR981eKbgdr3y2DJYeD/8bgMawdGVlJDE8kK+M=
github.com/ipld/go-ipld-prime-proto v0.0.0-20191113031812-e32bd156a1e5/go.mod h1:gcvzoEDBjwycpXt3LBE061wT9f46szXGHAmj9uoP6fU=
Expand Down Expand Up @@ -1423,6 +1424,7 @@ github.com/multiformats/go-multicodec v0.3.1-0.20210902112759-1539a079fd61/go.mo
github.com/multiformats/go-multicodec v0.3.1-0.20211210143421-a526f306ed2c/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ=
github.com/multiformats/go-multicodec v0.4.1/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ=
github.com/multiformats/go-multicodec v0.5.0/go.mod h1:DiY2HFaEp5EhEXb/iYzVAunmyX/aSFMxq2KMKfWEues=
github.com/multiformats/go-multicodec v0.6.0/go.mod h1:GUC8upxSBE4oG+q3kWZRw/+6yC1BqO550bjhWsJbZlw=
github.com/multiformats/go-multicodec v0.8.0 h1:evBmgkbSQux+Ds2IgfhkO38Dl2GDtRW8/Rp6YiSHX/Q=
github.com/multiformats/go-multicodec v0.8.0/go.mod h1:GUC8upxSBE4oG+q3kWZRw/+6yC1BqO550bjhWsJbZlw=
github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U=
Expand Down Expand Up @@ -1934,6 +1936,7 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE=
golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down
6 changes: 5 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ type ForkUpgradeConfig struct {
UpgradeSkyrHeight abi.ChainEpoch `json:"upgradeSkyrHeight"`
UpgradeSharkHeight abi.ChainEpoch `json:"upgradeSharkHeight"`
UpgradeHyggeHeight abi.ChainEpoch `json:"upgradeHyggeHeight"`
UpgradeLightningHeight abi.ChainEpoch `json:"upgradeLightningHeight"`
UpgradeThunderHeight abi.ChainEpoch `json:"upgradeThunderHeight"`
}

func IsNearUpgrade(epoch, upgradeEpoch abi.ChainEpoch) bool {
Expand Down Expand Up @@ -325,7 +327,9 @@ var DefaultForkUpgradeParam = &ForkUpgradeConfig{
UpgradeOhSnapHeight: 1594680,
UpgradeSkyrHeight: 1960320,
UpgradeSharkHeight: 2383680,
UpgradeHyggeHeight: 99999999999999,
UpgradeHyggeHeight: 2683348,
UpgradeLightningHeight: 99999999999999,
UpgradeThunderHeight: 99999999999999 + 1,
}

func newDefaultNetworkParamsConfig() *NetworkParamsConfig {
Expand Down
8 changes: 8 additions & 0 deletions pkg/fork/fork.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,14 @@ func DefaultUpgradeSchedule(cf *ChainFork, upgradeHeight *config.ForkUpgradeConf
StopWithin: 5,
}},
Expensive: true,
}, {
Height: upgradeHeight.UpgradeLightningHeight,
Network: network.Version19,
Migration: nil,
}, {
Height: upgradeHeight.UpgradeThunderHeight,
Network: network.Version20,
Migration: nil,
},
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/state/tree/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func VersionForNetwork(ver network.Version) (StateTreeVersion, error) {
return StateTreeVersion3, nil
case network.Version13, network.Version14, network.Version15, network.Version16, network.Version17:
return StateTreeVersion4, nil
case network.Version18:
case network.Version18, network.Version19, network.Version20:
return StateTreeVersion5, nil
default:
panic(fmt.Sprintf("unsupported network version %d", ver))
Expand Down
4 changes: 2 additions & 2 deletions venus-devtool/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ require (
github.com/filecoin-project/go-data-transfer v1.15.2
github.com/filecoin-project/go-fil-markets v1.25.2
github.com/filecoin-project/go-jsonrpc v0.2.1
github.com/filecoin-project/go-state-types v0.10.0
github.com/filecoin-project/lotus v1.20.3
github.com/filecoin-project/go-state-types v0.11.0-rc1
github.com/filecoin-project/lotus v1.22.0-rc1
github.com/filecoin-project/venus v0.0.0-00010101000000-000000000000
github.com/google/uuid v1.3.0
github.com/ipfs/go-cid v0.3.2
Expand Down
14 changes: 9 additions & 5 deletions venus-devtool/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,14 @@ github.com/filecoin-project/go-state-types v0.1.4/go.mod h1:xCA/WfKlC2zcn3fUmDv4
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.8/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.10.0 h1:vsSThZIaPmOxNGG59+8D/HnlWRtlbdOjduH6ye+v8f0=
github.com/filecoin-project/go-state-types v0.10.0/go.mod h1:aLIas+W8BWAfpLWEPUOGMPBdhcVwoCG4pIQSQk26024=
github.com/filecoin-project/go-statemachine v1.0.2 h1:421SSWBk8GIoCoWYYTE/d+qCWccgmRH0uXotXRDjUbc=
github.com/filecoin-project/go-state-types v0.11.0-rc1 h1:UvifFHZ+S/jbshCjRHgAUuZ1qAEyeItsNywh2tsSpY4=
github.com/filecoin-project/go-state-types v0.11.0-rc1/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8=
github.com/filecoin-project/go-statemachine v1.0.3 h1:N07o6alys+V1tNoSTi4WuuoeNC4erS/6jE74+NsgQuk=
github.com/filecoin-project/go-statestore v0.2.0 h1:cRRO0aPLrxKQCZ2UOQbzFGn4WDNdofHZoGPjfNaAo5Q=
github.com/filecoin-project/go-statestore v0.2.0/go.mod h1:8sjBYbS35HwPzct7iT4lIXjLlYyPor80aU7t7a/Kspo=
github.com/filecoin-project/index-provider v0.9.1 h1:Jnh9dviIHvQxZ2baNoYu3n8z6F9O62ksnVlyREgPyyM=
github.com/filecoin-project/lotus v1.20.3 h1:7Szh7jCc8pOa1++tdZgaUGMJYSHIMkUpypAO4at9I2U=
github.com/filecoin-project/lotus v1.20.3/go.mod h1:eNjjbZvjLgH7OEaD7kAkk5i8OrZ7owq349yfQ1wrVTo=
github.com/filecoin-project/lotus v1.22.0-rc1 h1:b/xYT+Ba3lGwW0CZkUFlAelko1Kf/XCHxolU6E320rQ=
github.com/filecoin-project/lotus v1.22.0-rc1/go.mod h1:qkMPPUTT5pG4OcNih6r/DHy8bZhGkblNI0cAXGmqI8c=
github.com/filecoin-project/pubsub v1.0.0 h1:ZTmT27U07e54qV1mMiQo4HDr0buo8I1LDHBYLXlsNXM=
github.com/filecoin-project/pubsub v1.0.0/go.mod h1:GkpB33CcUtUNrLPhJgfdy4FDx4OMNR9k+46DHx/Lqrg=
github.com/filecoin-project/specs-actors v0.9.13/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao=
Expand Down Expand Up @@ -499,6 +499,7 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
Expand Down Expand Up @@ -816,6 +817,7 @@ github.com/ipld/go-ipld-prime v0.11.0/go.mod h1:+WIAkokurHmZ/KwzDOMUuoeJgaRQktHt
github.com/ipld/go-ipld-prime v0.14.0/go.mod h1:9ASQLwUFLptCov6lIYc70GRB4V7UTyLD0IJtrDJe6ZM=
github.com/ipld/go-ipld-prime v0.16.0/go.mod h1:axSCuOCBPqrH+gvXr2w9uAOulJqBPhHPT2PjoiiU1qA=
github.com/ipld/go-ipld-prime v0.17.0/go.mod h1:aYcKm5TIvGfY8P3QBKz/2gKcLxzJ1zDaD+o0bOowhgs=
github.com/ipld/go-ipld-prime v0.19.0/go.mod h1:Q9j3BaVXwaA3o5JUDNvptDDr/x8+F7FG6XJ8WI3ILg4=
github.com/ipld/go-ipld-prime v0.20.0 h1:Ud3VwE9ClxpO2LkCYP7vWPc0Fo+dYdYzgxUJZ3uRG4g=
github.com/ipld/go-ipld-prime v0.20.0/go.mod h1:PzqZ/ZR981eKbgdr3y2DJYeD/8bgMawdGVlJDE8kK+M=
github.com/ipld/go-ipld-prime-proto v0.0.0-20191113031812-e32bd156a1e5/go.mod h1:gcvzoEDBjwycpXt3LBE061wT9f46szXGHAmj9uoP6fU=
Expand Down Expand Up @@ -1322,6 +1324,7 @@ github.com/multiformats/go-multicodec v0.3.1-0.20210902112759-1539a079fd61/go.mo
github.com/multiformats/go-multicodec v0.3.1-0.20211210143421-a526f306ed2c/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ=
github.com/multiformats/go-multicodec v0.4.1/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ=
github.com/multiformats/go-multicodec v0.5.0/go.mod h1:DiY2HFaEp5EhEXb/iYzVAunmyX/aSFMxq2KMKfWEues=
github.com/multiformats/go-multicodec v0.6.0/go.mod h1:GUC8upxSBE4oG+q3kWZRw/+6yC1BqO550bjhWsJbZlw=
github.com/multiformats/go-multicodec v0.8.0 h1:evBmgkbSQux+Ds2IgfhkO38Dl2GDtRW8/Rp6YiSHX/Q=
github.com/multiformats/go-multicodec v0.8.0/go.mod h1:GUC8upxSBE4oG+q3kWZRw/+6yC1BqO550bjhWsJbZlw=
github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U=
Expand Down Expand Up @@ -1789,6 +1792,7 @@ golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE=
golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down
10 changes: 5 additions & 5 deletions venus-devtool/inline-gen/inlinegen-data.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"actorVersions": [0, 2, 3, 4, 5, 6, 7, 8, 9, 10],
"latestActorsVersion": 10,
"actorVersions": [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
"latestActorsVersion": 11,

"networkVersions": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
"latestNetworkVersion": 18
}
"networkVersions": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
"latestNetworkVersion": 20
}
Binary file not shown.
11 changes: 9 additions & 2 deletions venus-shared/actors/builtin/account/actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import (

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

builtin10 "github.com/filecoin-project/go-state-types/builtin"
builtin11 "github.com/filecoin-project/go-state-types/builtin"
)

var Methods = builtin10.MethodsAccount
var Methods = builtin11.MethodsAccount

func Load(store adt.Store, act *types.Actor) (State, error) {
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
Expand All @@ -52,6 +52,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version10:
return load10(store, act.Head)

case actorstypes.Version11:
return load11(store, act.Head)

}
}

Expand Down Expand Up @@ -116,6 +119,9 @@ func MakeState(store adt.Store, av actorstypes.Version, addr address.Address) (S
case actorstypes.Version10:
return make10(store, addr)

case actorstypes.Version11:
return make11(store, addr)

}
return nil, fmt.Errorf("unknown actor version %d", av)
}
Expand Down Expand Up @@ -143,5 +149,6 @@ func AllCodes() []cid.Cid {
(&state8{}).Code(),
(&state9{}).Code(),
(&state10{}).Code(),
(&state11{}).Code(),
}
}
65 changes: 65 additions & 0 deletions venus-shared/actors/builtin/account/state.v11.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// FETCHED FROM LOTUS: builtin/account/state.go.template

package account

import (
"fmt"

actorstypes "github.com/filecoin-project/go-state-types/actors"

"github.com/filecoin-project/go-address"
"github.com/ipfs/go-cid"

"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/venus/venus-shared/actors"
"github.com/filecoin-project/venus/venus-shared/actors/adt"

account11 "github.com/filecoin-project/go-state-types/builtin/v11/account"
)

var _ State = (*state11)(nil)

func load11(store adt.Store, root cid.Cid) (State, error) {
out := state11{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}

func make11(store adt.Store, addr address.Address) (State, error) {
out := state11{store: store}
out.State = account11.State{Address: addr}
return &out, nil
}

type state11 struct {
account11.State
store adt.Store
}

func (s *state11) PubkeyAddress() (address.Address, error) {
return s.Address, nil
}

func (s *state11) GetState() interface{} {
return &s.State
}

func (s *state11) ActorKey() string {
return manifest.AccountKey
}

func (s *state11) ActorVersion() actorstypes.Version {
return actorstypes.Version11
}

func (s *state11) Code() cid.Cid {
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
if !ok {
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
}

return code
}
Loading