-
Notifications
You must be signed in to change notification settings - Fork 10
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
Spike: contract state export/import [continue] #344
Conversation
because sanity checks have been removed.
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.
The contract bindings make sense. Please see my comments on privileged/ pinned
@@ -129,12 +131,27 @@ func ExportGenesis(ctx sdk.Context, keeper *Keeper) *types.GenesisState { | |||
contracts[i].ContractState = &types.Contract_CustomModel{CustomModel: &types.CustomModel{Msg: got}} | |||
} | |||
|
|||
var privileged []string |
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.
"pinned" code and "privileged" contract meta data are also stored in the CodeInfo and ContractDetails.
After thinking about this a bit more, we should not fill the pinned/privileged field here in export. This would duplicate the information and may cause issues when humans modify them for existing codes/ contracts.
In "seed" mode we don't have these fields explicitly set in the genesis for PoE contracts. They can be used though for other codes/ contracts that are not pinned/ privileged yet. Maybe some better naming can help?
return false | ||
}) | ||
|
||
var pinned []uint64 |
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.
same as privileged: don't export here
Contracts: contracts, | ||
Sequences: wasmState.Sequences, | ||
GenMsgs: wasmState.GenMsgs, | ||
PrivilegedContractAddresses: privileged, |
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 can be nil
Sequences: wasmState.Sequences, | ||
GenMsgs: wasmState.GenMsgs, | ||
PrivilegedContractAddresses: privileged, | ||
PinnedCodeIDs: pinned, |
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 can be nil
}), | ||
wasmvm: noopMock, | ||
expErr: true, | ||
}, |
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.
Please add this again.
Closing this in favour of #348 |
No description provided.