Skip to content

Flatten sei-tendermint go mod into sei-chain#2817

Merged
masih merged 23 commits intomainfrom
masih/go-mod-tm-flattened
Feb 11, 2026
Merged

Flatten sei-tendermint go mod into sei-chain#2817
masih merged 23 commits intomainfrom
masih/go-mod-tm-flattened

Conversation

@masih
Copy link
Collaborator

@masih masih commented Feb 6, 2026

Flatten the sei-tendermint go module into sei-chain tin reduce dependency management complexity and error-prone multi layer replace directives.

Part of PLT-6

Flatten the sei-tendermint go module into sei-chain tin reduce
dependency management complexity and error-prone multi layer replace
directives.

Part of PLT-6
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedFeb 11, 2026, 3:55 PM

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 48.13%. Comparing base (28bc1c0) to head (321d417).

Files with missing lines Patch % Lines
sei-cosmos/server/rosetta/client_online.go 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (28bc1c0) and HEAD (321d417). Click for more details.

HEAD has 3 uploads less than BASE
Flag BASE (28bc1c0) HEAD (321d417)
sei-tendermint 1 0
sei-chain 1 0
sei-db 1 0
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2817       +/-   ##
===========================================
- Coverage   56.77%   48.13%    -8.65%     
===========================================
  Files        2070      666     -1404     
  Lines      168274    50121   -118153     
===========================================
- Hits        95542    24126    -71416     
+ Misses      64247    23885    -40362     
+ Partials     8485     2110     -6375     
Flag Coverage Δ
sei-chain ?
sei-cosmos 48.13% <0.00%> (+0.01%) ⬆️
sei-db ?
sei-tendermint ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-cosmos/baseapp/abci.go 65.50% <ø> (-0.76%) ⬇️
sei-cosmos/baseapp/baseapp.go 71.37% <ø> (-3.39%) ⬇️
sei-cosmos/baseapp/grpcrouter.go 91.66% <ø> (ø)
sei-cosmos/baseapp/grpcrouter_helpers.go 59.09% <ø> (ø)
sei-cosmos/baseapp/p2p.go 65.38% <ø> (ø)
sei-cosmos/baseapp/params.go 38.02% <ø> (ø)
sei-cosmos/baseapp/test_helpers.go 76.92% <ø> (ø)
sei-cosmos/client/broadcast.go 62.22% <ø> (ø)
sei-cosmos/client/cmd.go 78.90% <ø> (ø)
sei-cosmos/client/config/cmd.go 48.83% <ø> (ø)
... and 77 more

... and 1507 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 43.04636% with 86 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.11%. Comparing base (a138aeb) to head (803a838).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/seid/cmd/iavl_parser.go 0.00% 31 Missing ⚠️
loadtest/sign.go 0.00% 25 Missing ⚠️
loadtest/loadtest_client.go 0.00% 14 Missing ⚠️
evmrpc/tests/mock_accounts.go 28.57% 5 Missing and 5 partials ⚠️
app/app.go 50.00% 2 Missing ⚠️
evmrpc/tests/utils.go 33.33% 1 Missing and 1 partial ⚠️
oracle/price-feeder/oracle/jail.go 0.00% 1 Missing ⚠️
sei-cosmos/server/rosetta/client_online.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2817      +/-   ##
==========================================
+ Coverage   52.22%   57.11%   +4.88%     
==========================================
  Files        2027     2088      +61     
  Lines      160424   171077   +10653     
==========================================
+ Hits        83778    97705   +13927     
+ Misses      68732    64693    -4039     
- Partials     7914     8679     +765     
Flag Coverage Δ
sei-chain 52.56% <43.04%> (+11.69%) ⬆️
sei-cosmos 48.13% <0.00%> (?)
sei-db 68.72% <ø> (ø)
sei-tendermint ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
app/abci.go 66.92% <ø> (ø)
app/ante/cosmos_checktx.go 36.14% <ø> (+0.54%) ⬆️
app/ante/evm_checktx.go 33.75% <ø> (ø)
app/apptesting/test_suite.go 24.44% <ø> (ø)
app/benchmark.go 44.82% <ø> (ø)
app/benchmark/benchmark.go 60.00% <ø> (ø)
app/benchmark/generator.go 46.04% <ø> (ø)
app/benchmark/logger.go 93.33% <ø> (ø)
app/eth_replay.go 0.00% <ø> (ø)
app/export.go 0.00% <ø> (ø)
... and 141 more

... and 448 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@masih masih marked this pull request as ready for review February 9, 2026 22:00
@pompon0 pompon0 self-requested a review February 10, 2026 05:39
dumpDebugData(ctx, logger, rpc, dumpArgs)
}
ticker := time.NewTicker(time.Duration(frequency) * time.Second) //nolint: gosec
defer ticker.Stop()
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: not needed since 1.23

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Although it is not strictly needed after 1.23, there are a few reasons to still call stop: communication of intent, defensive programming in case of refactoring that may move the ticker and so on.
But the main functional reason to call it is that it would stop the ticker immediately, instead of leaving it to GC. It makes up a more predictable code behaviour.

@@ -153,19 +153,19 @@ func ProofFromProto(pb *tmcrypto.Proof) (*Proof, error) {
// Recursive impl.
func computeHashFromAunts(index, total int64, leafHash []byte, innerHashes [][]byte) ([]byte, error) {
if index >= total || index < 0 || total <= 0 {
return nil, fmt.Errorf("Calling computeHashFromAunts() with invalid index (%d) and total (%d)", index, total)
return nil, fmt.Errorf("calling computeHashFromAunts() with invalid index (%d) and total (%d)", index, total)
Copy link
Contributor

Choose a reason for hiding this comment

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

fyi, the lint which checks that the first letter of the error is lowercase is imprecise and super annoying - sometimes the first letter simply has to be uppercase (like when the first word is a name of a public type, or sth). I'd recommend to disable it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed that ST1005 can be annoying, but I'd push back on disabling it entirely; the consistency alone is worth it. The general practice is to instead capitalise the first letter in logs, because they typically are a list of sentences. See:

The "(unless beginning with proper nouns or acronyms)" is loose. As a reference, I very rarely come across Go SDK implementation that falls in that exceptional category.

In this specific case, the error should indeed start with lower case.

Copy link
Contributor

Choose a reason for hiding this comment

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

I disagree that it is worth it, but I can work with that - in worst case I can prefix every message with "q".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Glad to hear that. Also Go community is pretty active, maybe you could submit a proposal and hear what the community has to say on this.

@@ -336,7 +336,7 @@ func newValidBlockMessageFromProto(pb *tmcons.NewValidBlock) (*NewValidBlockMess
func proposalMessageFromProto(pb *tmcons.Proposal) (*ProposalMessage, error) {
proposal, err := types.ProposalFromProto(&pb.Proposal)
if err != nil {
return nil, fmt.Errorf("Proposal: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

like here: the field is "Proposal", not "proposal". Lowercasing is not helpful.

Copy link
Collaborator Author

@masih masih Feb 10, 2026

Choose a reason for hiding this comment

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

Sure, we can keep it uppercase and add a lint ignore. But looking at the repo, the error strings are already inconsistent. Rather than adding lint ignores case by case, I'd suggest adopting a consistent "verb noun/Noun: %w" pattern; example

fmt.Errorf("converting Proposal: %w", err)

This reads well when errors chain and eventually logged; e.g. :

Failed to process peer message: converting Proposal: invalid signature length

vs.

Failed to process peer message: Proposal: invalid signature length

...and naturally avoids the capitalization lint issue entirely. It also matches the Go stdlib pattern (e.g. "tls: failed to find certificate...") where error strings compose mid-sentence as described in the Go Code Review Comments.

This repo doesn't have a logging convention yet. Adopting "verb noun/Noun/WhatEver: %w" now means fewer lint ignores going forward and clearer log lines for debugging.

Copy link
Contributor

Choose a reason for hiding this comment

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

as far as I'm concerned verbs are almost always meaningless - all we care in practice is a stack trace, and mangling it into a human readable message is just another layer of obfuscation that we have to get through to actually locate where the error comes from.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

as far as I'm concerned verbs are almost always meaningless -

A tad over generalised 😅

actually locate where the error comes from.

Yep; logging is a mess all over the repo and this is a great test to make sure logging is useful.

@@ -394,7 +395,7 @@ func (ps *PeerState) ApplyNewRoundStepMessage(msg *NewRoundStepMessage) {
defer ps.mtx.Unlock()

// ignore duplicates or decreases
if msg.HRS.Cmp(ps.PRS.HRS) <= 0 {
if msg.Cmp(ps.PRS.HRS) <= 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

this lint does something weird - we compare HRS embedded fields here. Hiding that fact harms readability.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is from QF1008 staticcheck linter. Its rationale is rooted in Effective Go, where the entire point of embedding is promotion; to avoid bookkeeping and decouple from internals.

I'm against always using the explicit form, because that defeats the purpose of the language feature. In this case, HRS is a core type with no clashing receiver functions on both embedder and embedded types in this repo.
If HRS is more than an implementation detail, then my recommendation is to not embed it; use a named field instead. That forces callers to always spell out "I want to compare X and Y by their progress in terms of height, round, step". What harms readability most is allowing two ways of doing the same thing when the intent is to always use one. Keeping QF1008 enabled helps enforce that consistency.

Happy to revert this change in any case.

Copy link
Contributor

Choose a reason for hiding this comment

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

here embedding is used to group a bunch of fields, especially so that you can grab them and compare them against a group of fields of another struct. The point is that this call is asymmetric now - we promote the receiver but not the argument. And it will stop working if we define another Cmp on the msg itself.

Copy link
Collaborator Author

@masih masih Feb 12, 2026

Choose a reason for hiding this comment

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

And it will stop working if we define another Cmp on the msg itself.

Correct. emphasis on if.

as I pointed out, defining HRS as a named struct field is the concrete way to make sure that can't happen in that the compiler will error out. Having it embedded, and worrying about overrides seems like a racy way to assert intent. I would encourage thinking deeper about the intent of embedding.

Copy link
Contributor

@pompon0 pompon0 left a comment

Choose a reason for hiding this comment

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

LGTM for code in sei-tendermint dir.

# Conflicts:
#	go.mod
#	go.sum
#	go.work.sum
#	sei-cosmos/go.mod
#	sei-cosmos/go.sum
@masih
Copy link
Collaborator Author

masih commented Feb 11, 2026

Landing this to avid further merge conflicts with main. Happy to discuss any changes retroactively, specifically this one considering logging revamp is on the horizon.

@masih masih enabled auto-merge (squash) February 11, 2026 14:08
@masih masih merged commit 55c0254 into main Feb 11, 2026
39 of 40 checks passed
@masih masih deleted the masih/go-mod-tm-flattened branch February 11, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants