-
Notifications
You must be signed in to change notification settings - Fork 47
Support network version 16 #988
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6fd49cf
deps: update to lotus v0.16.0
frrist 0f4889b
refactor: remove unused actor gen code
frrist 4bd6127
chore: update actor code generator for v8
frrist c72c484
gen: init actor accessors
frrist 6a55643
gen: market actor accessors
frrist bf2f66d
gen: multisig actor accessors
frrist b629535
gen: power actor accessors
frrist 3133c28
gen: reward actor accessors
frrist 850e3c0
gen verifreg actor accessors
frrist 10ad0f6
gen: miner actor accessors
frrist f093f8e
chore: update miner state extractors
frrist 3e06c16
chore: update market actor extractors
frrist e052cc7
gen: builtin accessors
frrist 6ad70c3
refactor: remove unused map opts lookup
frrist 8eb812f
chore: update message test deps
frrist 2674378
feat: add actor CID lookups
frrist 439b304
chore: update lens interface to match lotus api
frrist 7fbf91b
refactor: register new actor code in processor
frrist f9ecb42
fix: update parsed message extractor with new exitcode
frrist 7fc5900
fix: only init VM for network version prior to 13
frrist b01176d
Add is_string column to market_deal_proposal model (#1015)
frrist 2efb5f7
fix: many incorrect pointer equality comparisons (#1018)
frrist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,332 @@ | ||
package actors | ||
|
||
import ( | ||
"github.com/filecoin-project/lotus/chain/actors" | ||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin" | ||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" | ||
builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin" | ||
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin" | ||
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" | ||
) | ||
|
||
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 | ||
) | ||
const ( | ||
AccountKey = "account" | ||
CronKey = "cron" | ||
InitKey = "init" | ||
MarketKey = "storagemarket" | ||
MinerKey = "storageminer" | ||
MultisigKey = "multisig" | ||
PaychKey = "paymentchannel" | ||
PowerKey = "storagepower" | ||
RewardKey = "reward" | ||
SystemKey = "system" | ||
VerifregKey = "verifiedregistry" | ||
) | ||
|
||
// GetActorCodeID looks up a builtin actor's code CID by actor version and canonical actor name. | ||
func GetActorCodeID(av Version, name string) (cid.Cid, bool) { | ||
// Actors V8 and above | ||
if c, ok := actors.GetActorCodeID(actors.Version(av), name); ok { | ||
return c, true | ||
} | ||
|
||
// Actors V7 and lower | ||
switch name { | ||
|
||
case AccountKey: | ||
switch av { | ||
|
||
case Version0: | ||
return builtin0.AccountActorCodeID, true | ||
|
||
case Version2: | ||
return builtin2.AccountActorCodeID, true | ||
|
||
case Version3: | ||
return builtin3.AccountActorCodeID, true | ||
|
||
case Version4: | ||
return builtin4.AccountActorCodeID, true | ||
|
||
case Version5: | ||
return builtin5.AccountActorCodeID, true | ||
|
||
case Version6: | ||
return builtin6.AccountActorCodeID, true | ||
|
||
case Version7: | ||
return builtin7.AccountActorCodeID, true | ||
} | ||
|
||
case CronKey: | ||
switch av { | ||
|
||
case Version0: | ||
return builtin0.CronActorCodeID, true | ||
|
||
case Version2: | ||
return builtin2.CronActorCodeID, true | ||
|
||
case Version3: | ||
return builtin3.CronActorCodeID, true | ||
|
||
case Version4: | ||
return builtin4.CronActorCodeID, true | ||
|
||
case Version5: | ||
return builtin5.CronActorCodeID, true | ||
|
||
case Version6: | ||
return builtin6.CronActorCodeID, true | ||
|
||
case Version7: | ||
return builtin7.CronActorCodeID, true | ||
} | ||
|
||
case InitKey: | ||
switch av { | ||
|
||
case Version0: | ||
return builtin0.InitActorCodeID, true | ||
|
||
case Version2: | ||
return builtin2.InitActorCodeID, true | ||
|
||
case Version3: | ||
return builtin3.InitActorCodeID, true | ||
|
||
case Version4: | ||
return builtin4.InitActorCodeID, true | ||
|
||
case Version5: | ||
return builtin5.InitActorCodeID, true | ||
|
||
case Version6: | ||
return builtin6.InitActorCodeID, true | ||
|
||
case Version7: | ||
return builtin7.InitActorCodeID, true | ||
} | ||
|
||
case MarketKey: | ||
switch av { | ||
|
||
case Version0: | ||
return builtin0.StorageMarketActorCodeID, true | ||
|
||
case Version2: | ||
return builtin2.StorageMarketActorCodeID, true | ||
|
||
case Version3: | ||
return builtin3.StorageMarketActorCodeID, true | ||
|
||
case Version4: | ||
return builtin4.StorageMarketActorCodeID, true | ||
|
||
case Version5: | ||
return builtin5.StorageMarketActorCodeID, true | ||
|
||
case Version6: | ||
return builtin6.StorageMarketActorCodeID, true | ||
|
||
case Version7: | ||
return builtin7.StorageMarketActorCodeID, true | ||
} | ||
|
||
case MinerKey: | ||
switch av { | ||
|
||
case Version0: | ||
return builtin0.StorageMinerActorCodeID, true | ||
|
||
case Version2: | ||
return builtin2.StorageMinerActorCodeID, true | ||
|
||
case Version3: | ||
return builtin3.StorageMinerActorCodeID, true | ||
|
||
case Version4: | ||
return builtin4.StorageMinerActorCodeID, true | ||
|
||
case Version5: | ||
return builtin5.StorageMinerActorCodeID, true | ||
|
||
case Version6: | ||
return builtin6.StorageMinerActorCodeID, true | ||
|
||
case Version7: | ||
return builtin7.StorageMinerActorCodeID, true | ||
} | ||
|
||
case MultisigKey: | ||
switch av { | ||
|
||
case Version0: | ||
return builtin0.MultisigActorCodeID, true | ||
|
||
case Version2: | ||
return builtin2.MultisigActorCodeID, true | ||
|
||
case Version3: | ||
return builtin3.MultisigActorCodeID, true | ||
|
||
case Version4: | ||
return builtin4.MultisigActorCodeID, true | ||
|
||
case Version5: | ||
return builtin5.MultisigActorCodeID, true | ||
|
||
case Version6: | ||
return builtin6.MultisigActorCodeID, true | ||
|
||
case Version7: | ||
return builtin7.MultisigActorCodeID, true | ||
} | ||
|
||
case PaychKey: | ||
switch av { | ||
|
||
case Version0: | ||
return builtin0.PaymentChannelActorCodeID, true | ||
|
||
case Version2: | ||
return builtin2.PaymentChannelActorCodeID, true | ||
|
||
case Version3: | ||
return builtin3.PaymentChannelActorCodeID, true | ||
|
||
case Version4: | ||
return builtin4.PaymentChannelActorCodeID, true | ||
|
||
case Version5: | ||
return builtin5.PaymentChannelActorCodeID, true | ||
|
||
case Version6: | ||
return builtin6.PaymentChannelActorCodeID, true | ||
|
||
case Version7: | ||
return builtin7.PaymentChannelActorCodeID, true | ||
} | ||
|
||
case PowerKey: | ||
switch av { | ||
|
||
case Version0: | ||
return builtin0.StoragePowerActorCodeID, true | ||
|
||
case Version2: | ||
return builtin2.StoragePowerActorCodeID, true | ||
|
||
case Version3: | ||
return builtin3.StoragePowerActorCodeID, true | ||
|
||
case Version4: | ||
return builtin4.StoragePowerActorCodeID, true | ||
|
||
case Version5: | ||
return builtin5.StoragePowerActorCodeID, true | ||
|
||
case Version6: | ||
return builtin6.StoragePowerActorCodeID, true | ||
|
||
case Version7: | ||
return builtin7.StoragePowerActorCodeID, true | ||
} | ||
|
||
case RewardKey: | ||
switch av { | ||
|
||
case Version0: | ||
return builtin0.RewardActorCodeID, true | ||
|
||
case Version2: | ||
return builtin2.RewardActorCodeID, true | ||
|
||
case Version3: | ||
return builtin3.RewardActorCodeID, true | ||
|
||
case Version4: | ||
return builtin4.RewardActorCodeID, true | ||
|
||
case Version5: | ||
return builtin5.RewardActorCodeID, true | ||
|
||
case Version6: | ||
return builtin6.RewardActorCodeID, true | ||
|
||
case Version7: | ||
return builtin7.RewardActorCodeID, true | ||
} | ||
|
||
case SystemKey: | ||
switch av { | ||
|
||
case Version0: | ||
return builtin0.SystemActorCodeID, true | ||
|
||
case Version2: | ||
return builtin2.SystemActorCodeID, true | ||
|
||
case Version3: | ||
return builtin3.SystemActorCodeID, true | ||
|
||
case Version4: | ||
return builtin4.SystemActorCodeID, true | ||
|
||
case Version5: | ||
return builtin5.SystemActorCodeID, true | ||
|
||
case Version6: | ||
return builtin6.SystemActorCodeID, true | ||
|
||
case Version7: | ||
return builtin7.SystemActorCodeID, true | ||
} | ||
|
||
case VerifregKey: | ||
switch av { | ||
|
||
case Version0: | ||
return builtin0.VerifiedRegistryActorCodeID, true | ||
|
||
case Version2: | ||
return builtin2.VerifiedRegistryActorCodeID, true | ||
|
||
case Version3: | ||
return builtin3.VerifiedRegistryActorCodeID, true | ||
|
||
case Version4: | ||
return builtin4.VerifiedRegistryActorCodeID, true | ||
|
||
case Version5: | ||
return builtin5.VerifiedRegistryActorCodeID, true | ||
|
||
case Version6: | ||
return builtin6.VerifiedRegistryActorCodeID, true | ||
|
||
case Version7: | ||
return builtin7.VerifiedRegistryActorCodeID, true | ||
} | ||
} | ||
|
||
return cid.Undef, false | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file will need to exist until a lotus release containing filecoin-project/lotus#8941 is cut. It ensures the correct actor CID's are returned for actors v8 since their CID's will differ depending on the network: mainnet, calibnet, buttnet, etc. Actors v7-0 remain unchanged ofcourse