-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat!: ADR-040: Refactor App to use v2.MultiStore
#10174
Closed
Closed
Changes from 1 commit
Commits
Show all changes
93 commits
Select commit
Hold shift + click to select a range
a549522
[WIP] refactor multistore => root store
roysc ec5d41e
baseapp - disable snapshot tests
roysc 9db21a5
store updates, fixes
roysc ceabd08
updates, rf
roysc ab531ff
changelog + docs
roysc 47330c5
Merge remote-tracking branch 'upstream/master' into refactor-multistore
roysc 929f5ad
fixes
roysc 3876113
Merge branch 'master' into roysc/adr-040-refactor-multistore
roysc 25d0a9f
changelog fix
roysc 355f181
cleanup
roysc 8cbf4b2
nit, StoreConfig =>StoreParams
roysc 4e431eb
store doc
roysc 861b24c
store rearrange
roysc f45ce0f
godoc nits
roysc 79bea1d
rm StoreConstructor
roysc e912111
compatibility wrapper for original MultiStore interface
roysc 704570b
rename BasicMultiStore -> MultiStore
roysc b36c8f5
patch multistore
roysc d035fb8
patch compat store
roysc bfa7b88
multi store- use StoreKey instances, not strings
roysc ccb908d
wrap v1 MultiStore in v2 interface; use in baseapp
roysc 532a6ad
viewstore.CacheStore() replaces CacheMultiStoreWithVersion
roysc 5f6fe12
test cleanup
roysc b200867
trace context fence
roysc 9cdd990
get all versions
roysc 2c59d34
Merge branch 'master' of github.com:cosmos/cosmos-sdk into refactor-m…
roysc 2627ce3
Merge remote-tracking branch 'upstream/master' into refactor-multistore
roysc 555be73
patches
roysc b631a9a
Merge branch 'master' of github.com:cosmos/cosmos-sdk into refactor-m…
roysc 83cd109
patches
roysc 71a9bb9
fix v1asv2 commit
roysc 78b0a12
PR revisions
roysc ddf8d0f
fix simd export
roysc 3ddf675
open db at data/application/
roysc def4107
db cleanup
roysc 880a4ee
badgerdb fix
roysc 8f58686
Merge branch 'master' of github.com:cosmos/cosmos-sdk into refactor-m…
roysc fcb9ff9
Merge remote-tracking branch 'upstream/master' into refactor-multistore
roysc 332c3e9
change rocksdb build tag to "rocksdb"
roysc d7a51f5
badgerdb - handle ErrTxnTooBig
roysc 5102f92
remove multistore reverse index
roysc 81642a5
rename tmdb adapter
roysc b33b162
GetAllVersions patch
roysc df2e47b
db/adapter - return discard error
roysc 1dd7de8
multistore - minor additions
roysc 4c34467
spelling
roysc 44fafb2
Merge remote-tracking branch 'upstream/master' into refactor-multistore
roysc 86929d3
badgerdb: fix versions file write
roysc 4cdd5ee
version manager - DeleteAbove() & implement w/ slice
roysc e36e3ad
DBConnection.RevertTo
roysc f0d31ba
unit test badgerdb.versionmanager
roysc ae5c007
Merge remote-tracking branch 'upstream/master' into refactor-multistore
roysc 620728f
refactor multistore: fix state sync
roysc 9e2152e
refactor multistore: fix store migration
roysc 68da759
fix rename store/{v2 => v2alpha1}
roysc bae2e7a
dbmapstore.Delete should raise smt.InvalidKeyError
roysc 138bd43
Merge remote-tracking branch 'upstream/master' into refactor-multistore
roysc 1295d81
dispatching db constructor
roysc fcf64ed
refactor server rollback cmd
roysc 4dd37ca
go mod tidy
roysc 7eb1f9e
fix app-db-backend config
roysc 0499da2
comment typo
roysc 924d2ec
reorg multistore tests
roysc 7f747ab
check multistore key types
roysc 7de3adf
fix v1asv2 methods
roysc 47ab63f
tests and fixes for v1asv2 adapter
roysc 1568198
force mem & transient stores to use bespoke key type
roysc bb15cd3
godoc copyedit
roysc e103a63
smt store test nits
roysc 1a37cc2
[dev] update SMT library
roysc 7b1e2f3
Merge remote-tracking branch 'upstream/main' into refactor-multistore
roysc db91469
Patch merge
roysc 5c1b566
Patch simapp upgrade handler
roysc 5f83976
Revert "[dev] update SMT library"
roysc 2ad0ee0
Merge remote-tracking branch 'upstream/main' into refactor-multistore
roysc 0b9aadc
put pruning manager into v2/multi store
roysc 538bacb
fixup renames
roysc d7ff909
fix db creators - refactor packages/build directives
roysc 04c832f
clean up v2 store re-exports
roysc 1232d5a
v2 store additions
roysc f007704
add multi.Store.HasKVStore()
roysc bc67cfe
bank keeper: validate account store address
roysc e409ca3
fix typos, docs, rm redundant
roysc 4823d1a
feat: list snapshots query (#246) (#252)
roysc 69fd2f7
Restore baseapp pruning & snapshot tests
roysc d3f6289
pruning manager - decouple db, rm logger, fix test
roysc 0f24e1e
Merge remote-tracking branch 'upstream/main' into refactor-multistore
roysc 23d1a92
Merge branch 'main' into refactor-multistore
roysc db3c28a
fix merge
roysc eaa83be
go.mod/sum
roysc c1e800c
PR clean up
roysc 1a9e194
v2 store: allow shared substore name prefixes
roysc 24dd6c0
Merge remote-tracking branch 'upstream/main' into refactor-multistore
roysc 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
v2 store additions
* remove iterator read lock; doesn't play with orm tests, so just rely on the stated contract: no store writes while iterator open * use v2 store in orm tests * clean up app boilerplate * update NewCommitMultiStore() * fix NewUncachedContext
- Loading branch information
commit 1232d5a1360a23ab36e83be8fedaa65501447969
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,63 @@ | ||
package multi | ||
|
||
import ( | ||
"fmt" | ||
|
||
pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" | ||
types "github.com/cosmos/cosmos-sdk/store/v2alpha1" | ||
) | ||
|
||
// DefaultStoreParams returns a MultiStore config with an empty schema, a single backing DB, | ||
// pruning with PruneDefault, no listeners and no tracer. | ||
func DefaultStoreParams() StoreParams { | ||
return StoreParams{ | ||
Pruning: pruningtypes.NewPruningOptions(pruningtypes.PruningDefault), | ||
SchemaBuilder: newSchemaBuilder(), | ||
storeKeys: storeKeys{}, | ||
traceListenMixin: newTraceListenMixin(), | ||
} | ||
} | ||
|
||
func (par *StoreParams) RegisterSubstore(skey types.StoreKey, typ types.StoreType) error { | ||
if !validSubStoreType(typ) { | ||
return fmt.Errorf("StoreType not supported: %v", typ) | ||
} | ||
var ok bool | ||
switch typ { | ||
case types.StoreTypePersistent: | ||
_, ok = skey.(*types.KVStoreKey) | ||
case types.StoreTypeMemory: | ||
_, ok = skey.(*types.MemoryStoreKey) | ||
case types.StoreTypeTransient: | ||
_, ok = skey.(*types.TransientStoreKey) | ||
} | ||
if !ok { | ||
return fmt.Errorf("invalid StoreKey for %v: %T", typ, skey) | ||
} | ||
if err := par.registerName(skey.Name(), typ); err != nil { | ||
return err | ||
} | ||
par.storeKeys[skey.Name()] = skey | ||
return nil | ||
} | ||
|
||
func (par *StoreParams) storeKey(key string) (types.StoreKey, error) { | ||
skey, ok := par.storeKeys[key] | ||
if !ok { | ||
return nil, fmt.Errorf("StoreKey instance not mapped: %s", key) | ||
} | ||
return skey, nil | ||
} | ||
|
||
func RegisterSubstoresFromMap[T types.StoreKey](par *StoreParams, keys map[string]T) error { | ||
for _, key := range keys { | ||
typ, err := types.StoreKeyToType(key) | ||
if err != nil { | ||
return err | ||
} | ||
if err = par.RegisterSubstore(key, typ); err != nil { | ||
return err | ||
} | ||
} | ||
return nil | ||
} |
This file contains 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
This file contains 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
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.
Check warning
Code scanning / CodeQL
Iteration over map