cosmos-sdk icon indicating copy to clipboard operation
cosmos-sdk copied to clipboard

EPIC: Collections

Open testinginprod opened this issue 3 years ago • 4 comments

Summary

Since ADR-062 was accepted, we need to port and adapt collections.

Work Breakdown

Phase 1

  • [x] KeyCodec
  • [x] ValueCodec
  • [x] Map
  • [x] #16274
  • [ ] #14672
  • [x] Iterate
  • [x] #14673
  • [x] Item
  • [x] Sequence
  • [x] KeySet
  • [x] #14671
  • [x] https://github.com/cosmos/cosmos-sdk/issues/14670

Phase 2 (module migration requirements)

requirements

  • [x] https://github.com/cosmos/cosmos-sdk/pull/14468
  • [x] Store accessor func
  • [x] Common types value codec and key codec
    • [x] math.Int
    • [x] math.Dec

Phase 3 (migrate modules)

  • [x] https://github.com/cosmos/cosmos-sdk/issues/15315
  • [x] #16368

Auth

  • https://github.com/cosmos/cosmos-sdk/issues/15783
  • https://github.com/cosmos/cosmos-sdk/pull/15830
  • https://github.com/cosmos/cosmos-sdk/pull/16016

Distribution

  • [x] #16210
  • [x] https://github.com/cosmos/cosmos-sdk/pull/16302
  • [ ] #16367

Slashing

  • [x] #16357
  • [ ] #16362
  • [ ] #16363
  • [ ] #16364

Staking

  • [ ] #16372
  • [ ] #16373
  • [ ] #16374
  • [ ] #16391
  • [ ] #16390
  • [ ] #16389
  • [ ] #16388
  • [ ] #16387
  • [ ] #16386
  • [ ] #16384
  • [ ] #16382
  • [ ] #16383
  • [ ] #16385
  • [ ] #16381
  • [ ] #16380
  • [ ] #16379
  • [ ] #16378
  • [ ] #16377
  • [ ] #16376
  • [ ] #16375

Crisis

  • [x] #16358

Mint

  • [x] #16359
  • [x] #16360

Gov

  • [x] https://github.com/cosmos/cosmos-sdk/issues/16117
  • [x] https://github.com/cosmos/cosmos-sdk/issues/16105
  • [x] https://github.com/cosmos/cosmos-sdk/issues/16163
  • [x] https://github.com/cosmos/cosmos-sdk/issues/16172
  • [x] https://github.com/cosmos/cosmos-sdk/issues/16267

Circuit

  • [x] #16365
  • [x] #16366

Feegrant

  • [ ] #16369
  • [ ] #16371

Evidence

  • [x] #16370

Proposal Queue

  • [ ] https://github.com/cosmos/cosmos-sdk/issues/16270

Phase 4 (API improvements)

  • package name: collections might be too long, consider: coll or colls
  • proper PairRange API to cover all the use cases
  • auto query support

testinginprod avatar Dec 14 '22 16:12 testinginprod

During experimentation with bank migration, I found other things which are required before we can effectively start migrating modules:

  • Pagination for collections
  • Math IntValue
  • Add store access function in sdk types maybe

testinginprod avatar Dec 20 '22 10:12 testinginprod

The last bullet point is covered by the store service right?

tac0turtle avatar Dec 20 '22 11:12 tac0turtle

@tac0turtle, I'm not currently 100% sure on how the relationship between core and sdk works, but since sdk cannot depend on core/store, then SDK needs to implement a function that given context.Context it converts it into a core/store.Store, this is how I implemented it whilst trialing the bank migration to collections: https://github.com/cosmos/cosmos-sdk/compare/tip/collections-pairkeys...tip/bank_migration?expand=1#diff-10fabc84ecc74a1e1f8383ab56fb83d48a5528658a27ee5373d05a13d294d438R333-R346

testinginprod avatar Dec 20 '22 11:12 testinginprod

@testinginprod you mentioned that you've created a tool for checking differences in state before and after collections, would be nice to have it so we can move faster on this issue

facundomedica avatar Jul 13 '23 10:07 facundomedica

Next step for this would be to use IndexedMap wherever possible

facundomedica avatar Aug 08 '23 08:08 facundomedica

authz & nft are missing here. Thanks @atheeshp for pointing it out

tac0turtle avatar Sep 12 '23 14:09 tac0turtle

going to close this epic, @testinginprod could you create a new epic for schema related work, or update the issue about schema

tac0turtle avatar Nov 16 '23 10:11 tac0turtle