Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3155 +/- ##
==========================================
+ Coverage 58.58% 58.60% +0.01%
==========================================
Files 2055 2099 +44
Lines 168301 173447 +5146
==========================================
+ Hits 98594 101642 +3048
- Misses 60917 62662 +1745
- Partials 8790 9143 +353
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| return filepath.Join(baseDir, subDir) | ||
| } | ||
|
|
||
| func pathExists(path string) bool { |
There was a problem hiding this comment.
You mean this one and the one in sei-db? I think this is fine we don't wanna couple sei-tendemrint and sei-db. Tendermint manages their own db separately than sei-db
| if !os.FileExists(filepath.Join(cfg.DBDir(), "blockstore.db")) { | ||
| blockstoreDir := tmcfg.ResolveDBDir("blockstore", cfg.DBDir()) | ||
| if !os.FileExists(filepath.Join(blockstoreDir, "blockstore.db")) { | ||
| return nil, nil, fmt.Errorf("no blockstore found in %v", cfg.DBDir()) |
There was a problem hiding this comment.
the error msg seems to should be against blockstoreDir instead of cfg.DBDir()
| return nil, nil, fmt.Errorf("no blockstore found in %v", cfg.DBDir()) | ||
| stateDir := tmcfg.ResolveDBDir("state", cfg.DBDir()) | ||
| if !os.FileExists(filepath.Join(stateDir, "state.db")) { | ||
| return nil, nil, fmt.Errorf("no state store found in %v", cfg.DBDir()) |
There was a problem hiding this comment.
same as above, error msg against stateDir instead of cfg.DBDir()
| } | ||
| // ResetState removes all blocks, tendermint state, indexed transactions and evidence. | ||
| // It handles both the legacy flat layout and the new subdirectory layout. | ||
| func ResetState(dbDir string) error { |
There was a problem hiding this comment.
consider updating reset related unit testings
app/receipt_store_config.go
Outdated
| } | ||
| if receiptConfig.DBDirectory == "" { | ||
| receiptConfig.DBDirectory = filepath.Join(homePath, "data", "receipt.db") | ||
| receiptConfig.DBDirectory = utils.GetReceiptStorePath(homePath) |
There was a problem hiding this comment.
readReceiptStoreConfig() was changed to default to data/ledger/receipt.db, but the emitted config template still says /data/receipt.db
need to update the related toml.go
* main: plt-228 fixed static check on app and evmrpc package (#3154) flatkv cache (#3027) Make cryptosim state store backend configurable + No Op Wrapper + Read Disable Config (#3145) Add warning message for IAVL deprecation (#3159) Change default min valid per window to zero (#3157) support for starting autobahn from non-zero global block (#3136) Fix upgrade list comparison to respect semver (#3153)
| func GetStateStorePath(homePath string, backend string) string { | ||
| return filepath.Join(homePath, "data", backend) | ||
| legacyPath := filepath.Join(homePath, "data", backend) | ||
| if PathExists(legacyPath) { |
There was a problem hiding this comment.
Minor: Is there ever a case where an abrupt node failure could cause the creation of an empty directory here?
If so, for robustness i recommend checking if this dir is empty and proceed with legacy path iff it is not empty.
| return filepath.Join(homePath, "data", "committer.db") | ||
| // PathExists returns true if the given path exists on disk. | ||
| func PathExists(path string) bool { | ||
| _, err := os.Stat(path) |
There was a problem hiding this comment.
Harden this by requiring the type of path? e.g. directory? file etc.
This is racy in that it doesn't atomically check and it repeatedly checks but hopefully the probability of race is low enough that we can accept the race condition as negligible.
cody-littley
left a comment
There was a problem hiding this comment.
Does this PR handle migration (i.e. moving memiavl data from original location to new location)?
Describe your changes and provide context
The current data folder is not intuitive and not very clean for Giga storage. It currently looks like this:

The goal of this PR is to restructure the data folder for Giga into this new structure while also making it backward compatible:

Testing performed to validate your change
Added unit test to make sure it works for both new nodes and existing nodes which has the old path