-
Notifications
You must be signed in to change notification settings - Fork 274
fix: staking optimization #1907
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -137,11 +137,11 @@ schema = 3 | |
| version = "v1.22.0" | ||
| hash = "sha256-lY1K29h4vlAmJVvwKgbTG8BTACYGjFaginCszN+ST6w=" | ||
| [mod."github.com/btcsuite/btcd"] | ||
| version = "v0.24.2" | ||
| hash = "sha256-ahlpwEr4KfyrEA899X07QtuSDnC8U+SnwL+z72DiK5E=" | ||
| version = "v0.25.0" | ||
| hash = "sha256-Yh3UJ8HmzY+5WXZHhcl3oFcXl2PkBTd4O4s8FYyNbos=" | ||
| [mod."github.com/btcsuite/btcd/btcec/v2"] | ||
| version = "v2.3.4" | ||
| hash = "sha256-9fV41jYeTUrpoyu19LPuGBG/N9wFv6D6wVBE8R5WzRI=" | ||
| version = "v2.3.5" | ||
| hash = "sha256-stpoaGQ1PNPqtLYIQc96YH24s8owcV+PoSo6xREi9LI=" | ||
| [mod."github.com/btcsuite/btcd/btcutil"] | ||
| version = "v1.1.6" | ||
| hash = "sha256-TYbwJLNX/+63nm+b3RqPH3ZIvTBnsm9peqJP05v9Z90=" | ||
|
|
@@ -213,8 +213,8 @@ schema = 3 | |
| version = "v1.0.0-beta.5" | ||
| hash = "sha256-Fy/PbsOsd6iq0Njy3DVWK6HqWsogI+MkE8QslHGWyVg=" | ||
| [mod."github.com/cosmos/cosmos-sdk"] | ||
| version = "v0.50.6-0.20251119062431-8d0a31ef043d" | ||
| hash = "sha256-VxQus9ynUK8nAZh3ubNXRcxJsITzgndjd7UYYgMt6C0=" | ||
| version = "v0.0.0-20251121110054-d5e74b9954c1" | ||
| hash = "sha256-XzBX/BIFpKZWMBqyGML0RpSBHMnQu1QVY9+dMi85mws=" | ||
| replaced = "github.com/crypto-org-chain/cosmos-sdk" | ||
| [mod."github.com/cosmos/go-bip39"] | ||
| version = "v1.0.0" | ||
|
|
@@ -223,8 +223,8 @@ schema = 3 | |
| version = "v1.2.0" | ||
| hash = "sha256-Hd19V0RCiMoCL67NsqvWIsvWF8KM3LnuJTbYjWtQkEo=" | ||
| [mod."github.com/cosmos/gogoproto"] | ||
| version = "v1.7.0" | ||
| hash = "sha256-ZkEUImxBBo8Q/6c7tVR0rybpLbtlplzvgfLl5xvtV00=" | ||
| version = "v1.7.2" | ||
| hash = "sha256-L9sJZoQGWaix43AJ7rsm1DUng8uoD8HJ6Mb92Ynq8+s=" | ||
| [mod."github.com/cosmos/iavl"] | ||
| version = "v1.2.6" | ||
| hash = "sha256-9kLtVepU5b3m2Sne8pBQNvF9LxM374LEmvuLWeYBfFU=" | ||
|
|
@@ -312,9 +312,9 @@ schema = 3 | |
| version = "v0.2.2" | ||
| hash = "sha256-0MLfSJKdeK3Z7tWAXTdzwB4091dmyxIX38S5SKH5QAw=" | ||
| [mod."github.com/evmos/ethermint"] | ||
| version = "v0.22.1-0.20251007011737-164da0caf703" | ||
| hash = "sha256-lWvRrVuhssOIMCv07iXwJLfN2gFRgsbK8HBiqMBTMew=" | ||
| replaced = "github.com/crypto-org-chain/ethermint" | ||
| version = "v0.0.0-20251121082919-46c057ac4dde" | ||
| hash = "sha256-8eJk4xUTm1aRKJiuHdTv0ZGg4kwTUrTiO8E/NyHlU8A=" | ||
| replaced = "github.com/randy-cro/ethermint" | ||
|
Comment on lines
+315
to
+317
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: ethermint module replacement still points to personal fork. The For production releases, use the organization-owned fork or upstream module. Update the replacement target to point to 🤖 Prompt for AI Agents |
||
| [mod."github.com/fatih/color"] | ||
| version = "v1.17.0" | ||
| hash = "sha256-QsKMy3MsvjbYNcA9jP8w6c3wpmWDZ0079bybAEzmXR0=" | ||
|
|
@@ -780,7 +780,7 @@ schema = 3 | |
| version = "v0.0.0-20250707201910-8d1bb00bc6a7" | ||
| hash = "sha256-xtTBmzlyynWQa0KtuQpNZ4fzSTB/5ozXclE3SuP3naI=" | ||
| [mod."google.golang.org/genproto/googleapis/rpc"] | ||
| version = "v0.0.0-20250707201910-8d1bb00bc6a7" | ||
| version = "v0.0.0-20250804133106-a7a43d27e69b" | ||
| hash = "sha256-WK7iDtAhH19NPe3TywTQlGjDawNaDKWnxhFL9PgVUwM=" | ||
| [mod."google.golang.org/grpc"] | ||
| version = "v1.75.1" | ||
|
|
||
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.
🧩 Analysis chain
Verify the FlagStakingCacheSize flag exists.
The staking keeper initialization retrieves a cache size using
server.FlagStakingCacheSizeand passes it to the keeper constructor along with a memory store service. Ensure that this flag is defined in the cosmos-sdk server package or in this codebase.Run the following script to verify the flag exists:
🏁 Script executed:
Length of output: 442
🏁 Script executed:
Length of output: 2580
🌐 Web query:
💡 Result:
Short answer: There is no built‑in server flag named FlagStakingCacheSize in the upstream cosmos-sdk server package. The server flags list in cosmos-sdk does not include a "staking cache size" flag. [1]
What exists in practice: some application chains add a staking cache-size configuration under their staking section (app.toml) or as an app-level config (e.g., Cronos added a [staking] cache-size option in its releases to control the module’s cache). That is an app/chain-level config, not a built-in cosmos-sdk server flag. [2][3]
Sources
🏁 Script executed:
Length of output: 2327
🏁 Script executed:
Length of output: 689
🏁 Script executed:
Length of output: 235
🏁 Script executed:
Length of output: 3321
FlagStakingCacheSize is undefined and will cause a runtime error.
The code at line 504 attempts to retrieve
server.FlagStakingCacheSize, but this flag constant is not defined in the codebase and does not exist in the cosmos-sdk server package. This will cause either a compilation error or a nil value at runtime, resulting in undefined behavior when the staking keeper is initialized.Required fixes:
FlagStakingCacheSizeconstant in the appropriate location (likely in a srvflags package or cronos module flags)addModuleInitFlags()or a similar flag registration function)Verify that similar flags like
FlagMempoolMaxTxsandFlagIAVLCacheSizefollow the same pattern for reference.🤖 Prompt for AI Agents