Cosmos-sdk: Dynamic capability key store (ADR / implementation)

Created on 8 Nov 2019  路  4Comments  路  Source: cosmos/cosmos-sdk

Ref https://github.com/cosmos/cosmos-sdk/pull/5230#discussion_r343978513

Blocks IBC 1.0.0.

Does the SDK have any way of allocating & tracking store keys at runtime (e.g. dynamically)?
It seems like the current mechanism can only handle static allocation (where all store keys are passed to keepers in app.go)
I can envision a mechanism where keepers have a private map of store keys that can be altered at runtime, although some initialisation logic will need to exist to track what store keys need to be passed to keepers when someone starts the chain without syncing from genesis.

ICS 5 needs the ability for capability keys (memory addresses) to be dynamically generated as transactions are processed and to be passed around the state machine - but they cannot be serialised to the public Merkle store since they are memory addresses (will vary per machine, intentional for capability-ness).
Maybe a new abstraction of a "Capability Store" of some sort would help out here, that could keep a public map of identifiers and a private map of memory addresses, and reallocate appropriately on start-up.

ADR blocked ibc

All 4 comments

cc: @alexanderbez @rigelrozanski thoughts?

This needs an ADR @cwgoes, do you have some time to take up this work?

Yes, although I think it is lower priority than light client work & IBC interface finalisation.

Working on this now. It will be a bit complicated though, we could always elect to just support static ports for the first SDK release of IBC.

If we want examples with e.g. WASM contracts, we pretty much need this, though.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

faboweb picture faboweb  路  3Comments

ValarDragon picture ValarDragon  路  3Comments

fedekunze picture fedekunze  路  3Comments

ValarDragon picture ValarDragon  路  3Comments

rigelrozanski picture rigelrozanski  路  3Comments