-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
chore(server/v2): create v2 subpackage in core #19499
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f5858aa
add appmodule v2
testinginprod f27418d
update
testinginprod ae64a57
v1 preblock is different than v2
tac0turtle bc067a8
fix build
tac0turtle 0cd479d
gas meter
tac0turtle fe591e1
Merge branch 'server_modular' into tip/serverv2/appmodulev2
tac0turtle bc56bc6
Merge branch 'server_modular' into tip/serverv2/appmodulev2
tac0turtle adca043
Merge branch 'server_modular' into tip/serverv2/appmodulev2
tac0turtle 4b2aa9b
cleanup
tac0turtle 0230dec
add non consensus database
tac0turtle 3bffa71
lint fix
tac0turtle c98f475
use v2 in modules
tac0turtle b8a0b7c
Update core/store/database.go
tac0turtle ad1bf8a
Update core/store/database.go
tac0turtle 30e2bf6
Merge branch 'server_modular' into tip/serverv2/appmodulev2
tac0turtle 354f841
remove new preblocker
tac0turtle 93b4094
add todo
tac0turtle 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,8 @@ | ||
package appmodule | ||
|
||
import ( | ||
"cosmossdk.io/core/branch" | ||
"cosmossdk.io/core/event" | ||
"cosmossdk.io/core/gas" | ||
"cosmossdk.io/core/header" | ||
"cosmossdk.io/core/store" | ||
"cosmossdk.io/log" | ||
"cosmossdk.io/core/appmodule/v2" | ||
) | ||
|
||
// Environment is used to get all services to their respective module | ||
type Environment struct { | ||
BranchService branch.Service | ||
EventService event.Service | ||
GasService gas.Service | ||
HeaderService header.Service | ||
KVStoreService store.KVStoreService | ||
MemStoreService store.MemoryStoreService | ||
Logger log.Logger | ||
} | ||
type Environment = appmodule.Environment |
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 |
---|---|---|
@@ -1,22 +1,13 @@ | ||
package appmodule | ||
|
||
import "context" | ||
import ( | ||
"cosmossdk.io/core/appmodule/v2" | ||
) | ||
|
||
type MigrationRegistrar interface { | ||
// Register registers an in-place store migration for a module. The | ||
// handler is a migration script to perform in-place migrations from version | ||
// `fromVersion` to version `fromVersion+1`. | ||
// | ||
// EACH TIME a module's ConsensusVersion increments, a new migration MUST | ||
// be registered using this function. If a migration handler is missing for | ||
// a particular function, the upgrade logic (see RunMigrations function) | ||
// will panic. If the ConsensusVersion bump does not introduce any store | ||
// changes, then a no-op function must be registered here. | ||
Register(moduleName string, fromVersion uint64, handler MigrationHandler) error | ||
} | ||
type MigrationRegistrar = appmodule.MigrationRegistrar | ||
|
||
// MigrationHandler is the migration function that each module registers. | ||
type MigrationHandler func(context.Context) error | ||
type MigrationHandler = appmodule.MigrationHandler | ||
|
||
// VersionMap is a map of moduleName -> version | ||
type VersionMap map[string]uint64 | ||
type VersionMap = appmodule.VersionMap |
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,21 @@ | ||
package appmodule | ||
|
||
import ( | ||
"cosmossdk.io/core/branch" | ||
"cosmossdk.io/core/event" | ||
"cosmossdk.io/core/gas" | ||
"cosmossdk.io/core/header" | ||
"cosmossdk.io/core/store" | ||
"cosmossdk.io/log" | ||
) | ||
|
||
// Environment is used to get all services to their respective module | ||
type Environment struct { | ||
BranchService branch.Service | ||
EventService event.Service | ||
GasService gas.Service | ||
HeaderService header.Service | ||
KVStoreService store.KVStoreService | ||
MemStoreService store.MemoryStoreService | ||
Logger log.Logger | ||
} |
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,15 @@ | ||
package appmodule | ||
|
||
import ( | ||
"context" | ||
) | ||
|
||
// HasGenesis defines a custom genesis handling API implementation. | ||
// TODO: finalize this API | ||
type HasGenesis interface { | ||
AppModule | ||
DefaultGenesis() Message | ||
ValidateGenesis(data Message) error | ||
InitGenesis(ctx context.Context, data Message) error | ||
ExportGenesis(ctx context.Context) (Message, error) | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are we going to do about genesis in core v1?
I feel like we should delete if when there is consensus about the api, as we never pushed people to use it.
However, I don't think we agreed on this proposed api yet 👀.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leaving a todo here and we can discuss on the server call