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

Spike: contract state export/import [continue] #344

Closed
wants to merge 5 commits into from
Closed

Conversation

pinosu
Copy link
Contributor

@pinosu pinosu commented Apr 13, 2022

No description provided.

@alpe alpe changed the base branch from main to export_spike April 25, 2022 09:05
Copy link
Contributor

@alpe alpe left a 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
Copy link
Contributor

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
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

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,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add this again.

@alpe alpe mentioned this pull request Apr 26, 2022
@alpe
Copy link
Contributor

alpe commented Apr 28, 2022

Closing this in favour of #348

@alpe alpe closed this Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants