Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
8337319
add dbmigrate cmd
JayT106 Oct 28, 2025
6633724
extend migration to cover cometBFT db
JayT106 Oct 29, 2025
60e26a1
add flushing of rocksdb to sst files when migrating to rocksdb
randy-cro Oct 30, 2025
a83ee02
add databases flag
JayT106 Oct 31, 2025
da2a1c3
extend db migrate with designated height
JayT106 Oct 31, 2025
689218e
update docs
JayT106 Oct 31, 2025
b35cff0
patch feature supports dryrun and key conflict actions
JayT106 Nov 3, 2025
7808432
fix missing txhash patch in tx_index.db
JayT106 Nov 5, 2025
f98c16a
fix missing ethereumTX event key patch
JayT106 Nov 5, 2025
748f42e
fix patch ethereumTx event data and add tests
JayT106 Nov 8, 2025
6e9e634
fix rebase conflict
JayT106 Nov 12, 2025
115dc01
lint-fix
JayT106 Nov 12, 2025
891bb17
remove unneed script, refine code
JayT106 Nov 12, 2025
9358a34
fix code by coderabbit review and remove memdb pebbledb support
JayT106 Nov 12, 2025
3f5a860
nit
JayT106 Nov 12, 2025
20d80e3
fix error and nit
JayT106 Nov 12, 2025
15ffdfe
fix rocksdb open issue
JayT106 Nov 12, 2025
5870ee9
fix coderabbit check
JayT106 Nov 12, 2025
d84f3ed
update changelog
JayT106 Nov 12, 2025
3703cfe
fix code base on coderabbit review
JayT106 Nov 12, 2025
6c4fb78
fix code base on coderabbit review
JayT106 Nov 12, 2025
3e0ccde
lint
JayT106 Nov 12, 2025
38cd682
fix potential panic
JayT106 Nov 12, 2025
e12cb79
fix CI errors
JayT106 Nov 12, 2025
d192a72
fix code by coderabbit's suggestion
JayT106 Nov 12, 2025
e6c0456
fix cronos keeper iter not close
JayT106 Nov 12, 2025
d9d4faa
Apply golangci-lint formatting fixes
JayT106 Nov 12, 2025
950a34c
Update cmd/cronosd/cmd/patch_db.go
JayT106 Nov 12, 2025
6753bda
fix potential missing patch keys
JayT106 Nov 13, 2025
d343f40
remove unneed function
JayT106 Nov 13, 2025
65c8725
fix iterator walk issue and remove height filter support logic in db …
JayT106 Nov 13, 2025
a45a96d
missing file commit
JayT106 Nov 13, 2025
2667e0c
fix print error
JayT106 Nov 13, 2025
658b540
fix by code review
JayT106 Nov 14, 2025
7303a8b
refine log
JayT106 Nov 14, 2025
18b4ee5
refactor patchTxIndexData and update cmd description
JayT106 Nov 14, 2025
df0350d
revert linting changes unrelate to this PR
JayT106 Nov 14, 2025
b30cdaa
revert iter fix unrelated to this PR
JayT106 Nov 14, 2025
938c37e
fix readme errors
JayT106 Nov 14, 2025
21e0dcd
update readme
JayT106 Nov 14, 2025
4d1bf97
fix README markdown
JayT106 Nov 14, 2025
fd86199
constraint BackendType and DBType
JayT106 Nov 17, 2025
87bfd25
constaint database name
JayT106 Nov 17, 2025
1bdd518
patchdb path validation
JayT106 Nov 17, 2025
174b8e3
fix-lint
JayT106 Nov 18, 2025
bc9cb04
fix target path not checking
JayT106 Nov 18, 2025
d762779
Merge branch 'main' into jt/dbmigrate
JayT106 Nov 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## UNRELEASED

* [#1908](https://github.com/crypto-org-chain/cronos/pull/1908) Add db migration/patch CLI tool
* [#1869](https://github.com/crypto-org-chain/cronos/pull/1869) Add missing tx context during vm initialisation
* [#1872](https://github.com/crypto-org-chain/cronos/pull/1872) Support 4byteTracer for tracer
* [#1875](https://github.com/crypto-org-chain/cronos/pull/1875) Support for preinstalls
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@ build: check-network print-ledger go.sum
install: check-network print-ledger go.sum
@go install -mod=readonly $(BUILD_FLAGS) ./cmd/cronosd

test: test-memiavl test-store
test: test-memiavl test-store test-versiondb
@go test -tags=objstore -v -mod=readonly $(PACKAGES) -coverprofile=$(COVERAGE) -covermode=atomic

test-memiavl:
@cd memiavl; go test -tags=objstore -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic;
@cd memiavl && go test -tags=objstore -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic;

test-store:
@cd store; go test -tags=objstore -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic;
@cd store && go test -tags=objstore -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic;

test-versiondb:
@cd versiondb; go test -tags=objstore,rocksdb -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic;
@cd versiondb && go test -tags=objstore,rocksdb -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic;

.PHONY: clean build install test test-memiavl test-store test-versiondb

Expand Down
29 changes: 29 additions & 0 deletions cmd/cronosd/cmd/database.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package cmd

import (
"github.com/spf13/cobra"
)

// DatabaseCmd returns the database command with subcommands
func DatabaseCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "database",
Short: "Database management commands",
Long: `Commands for managing Cronos databases.

Available subcommands:
migrate - Migrate databases between different backend types
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be migratedb and patchdb or migrate and patch? in my opinion can use migrate and patch since we know they are database commands already

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't understand what do you mean here, can you explain more? I put migrate/patch under database cause I don't want the command list of cronos too long.

patch - Patch specific block heights into existing databases

Use "cronosd database [command] --help" for more information about a command.`,
Aliases: []string{"db"},
}

// Add subcommands
cmd.AddCommand(
MigrateCmd(),
PatchCmd(),
)

return cmd
}
Loading
Loading