Skip to content

App plugged into autobahn#3151

Merged
pompon0 merged 37 commits intomainfrom
gprusak-exe2
Apr 2, 2026
Merged

App plugged into autobahn#3151
pompon0 merged 37 commits intomainfrom
gprusak-exe2

Conversation

@pompon0
Copy link
Copy Markdown
Contributor

@pompon0 pompon0 commented Mar 31, 2026

Made GigaRouter send finalized blocks for execution to Application. Currently Application calls are still synchronous, but it will be trivial to migrate to async execution one it is supported. This is a PoC, given that there is no intergration tests of Autobahn with sei-chain app yet. Integration tests will be set up once Autobahn is integrated with Mempool as well.

Additionally added an AGENTS.md stub for sei-tendermint to navigate code generation from now on.

@pompon0 pompon0 changed the base branch from main to gprusak-exe3 March 31, 2026 13:54
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 31, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 2, 2026, 5:08 PM

@pompon0 pompon0 requested review from arajasek and wen-coding March 31, 2026 16:52
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 58.59873% with 65 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.67%. Comparing base (ac5ad8d) to head (2caebaf).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sei-tendermint/internal/p2p/giga_router.go 69.14% 15 Missing and 14 partials ⚠️
sei-tendermint/internal/autobahn/data/state.go 25.00% 11 Missing and 1 partial ⚠️
sei-tendermint/abci/types/mocks/application.go 0.00% 11 Missing ⚠️
sei-tendermint/internal/p2p/conv.go 25.00% 3 Missing ⚠️
app/app.go 75.00% 1 Missing and 1 partial ⚠️
sei-cosmos/baseapp/abci.go 0.00% 2 Missing ⚠️
sei-tendermint/abci/types/application.go 0.00% 2 Missing ⚠️
sei-tendermint/internal/p2p/router.go 50.00% 1 Missing and 1 partial ⚠️
sei-tendermint/internal/proxy/client.go 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3151      +/-   ##
==========================================
+ Coverage   58.62%   58.67%   +0.05%     
==========================================
  Files        2055     2055              
  Lines      168299   168425     +126     
==========================================
+ Hits        98660    98821     +161     
+ Misses      60865    60822      -43     
- Partials     8774     8782       +8     
Flag Coverage Δ
sei-chain-pr 67.29% <58.59%> (?)
sei-db 70.41% <ø> (ø)

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

Files with missing lines Coverage Δ
...ei-cosmos/x/distribution/keeper/alias_functions.go 100.00% <100.00%> (ø)
sei-tendermint/internal/consensus/replay.go 68.85% <100.00%> (-0.93%) ⬇️
sei-tendermint/internal/rpc/core/abci.go 73.33% <100.00%> (ø)
sei-tendermint/internal/statesync/syncer.go 68.03% <100.00%> (ø)
sei-tendermint/libs/utils/testonly.go 71.96% <100.00%> (+0.26%) ⬆️
sei-tendermint/types/genesis.go 87.65% <100.00%> (+1.16%) ⬆️
sei-tendermint/version/version.go 100.00% <ø> (ø)
app/app.go 68.96% <75.00%> (+0.03%) ⬆️
sei-cosmos/baseapp/abci.go 61.52% <0.00%> (-0.22%) ⬇️
sei-tendermint/abci/types/application.go 45.45% <0.00%> (-2.94%) ⬇️
... and 6 more

... and 3 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.

@pompon0 pompon0 marked this pull request as ready for review March 31, 2026 16:53
Base automatically changed from gprusak-exe3 to main April 1, 2026 13:47
// TODO: retry the handshake/replay if it fails ?
func (h *Handshaker) Handshake(ctx context.Context, appClient abci.Application) error {
res, err := appClient.Info(ctx, &proxy.RequestInfo)
res, err := appClient.Info(ctx, &version.RequestInfo)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just curious: what's the difference between proxy.RequestInfo and version.RequestInfo?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is the same global constant, I've just moved into another, imo more relevant, package.


type GigaNodeAddr struct {
Key NodePublicKey
HostPort tcp.HostPort
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I remember in your p2p PR, one pubkey can have more than one IP:port, but guess we can only config one in config?

Copy link
Copy Markdown
Contributor Author

@pompon0 pompon0 Apr 2, 2026

Choose a reason for hiding this comment

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

multiple addrs per node key are supported there, because we have multiple SoT - every peer can declare whatever address they think is the correct one - same node can be available under a private IP and public IP, or the peer may be simply malicious (and lie about the correct IP). Here we trust our config. The situation will change though, once we support proxies for validators, in which case a single validator will be able to have multiple endpoints (but then the validator addresses will be discovered dynamically).

return fmt.Errorf("App.InitChain(): %w", err)
}
var ok bool
next, ok = utils.SafeCast[atypes.GlobalBlockNumber](r.cfg.GenDoc.InitialHeight)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When would this happen? Does last==0 mean starting from genesis? Or it means we haven't committed anything?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it will happen if InitialHeight is negative, which is an invalid configuration anyway. This is just defense-in-depth check against overflows.

hash := b.Header().Hash()
var proposerAddress types.Address
if vals := r.cfg.App.GetValidators(); len(vals) > 0 {
// Deterministically select a proposer from the app's validator committee.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this just a placeholder for now? We will calculate the real proposer later right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The autobahn committee is not currently related to App committee in any sense. Even if it was the same at block 0, we do not support the dynamic committee rn, so it would diverge. Application interface contract expects the proposer to belong to the App committee (although this relation is rather fragile, and only causes error log in sei-chain App), so we are just trying to adhere to the contract here for the sake of PoC.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Eventually we could read the proposer from the CommitQC, however afaict we will need a new reward mechanism anyway, so the actual information about tipcut proposer might be no longer relevant to the App.

}
resp, err := r.cfg.App.FinalizeBlock(ctx, &abci.RequestFinalizeBlock{
Txs: b.Payload().Txs(),
// Empty DecidedLastCommit is does not indicate missing votes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: is does -> does
Where is DecidedLastCommit normally set?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

By design, each tendermint block (except for the first one) contains a Commit (set of votes, unilaterally chosen by the proposer) for the previous block. DecidedLastCommit is by design a digest from that Commit (essentially information about who voted who did not), which is then used to decide which validators are offline and should be jailed. Here we use a degenerated DecidedLastCommit which just does not disclose anything about the Commit of the previous block (especially since autobahn blocks do not contain such information).

if !r.cfg.InboundPeers[key] {
ok := false
for _, addr := range r.cfg.ValidatorAddrs {
if addr.Key == key {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So for now we only allow inbound connection from validators? How do RPCs connect in loadtest?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For now only validator nodes are supported. For the sake of the loadtest/local cluster we can model RPC nodes as inactive validator nodes (which do not belong to the committee). This should be a small change. Alternatively we can go ahead and divide Giga TCP connections into validator connections and regular p2p connections (without avail/consensus messages).

@pompon0 pompon0 requested a review from wen-coding April 2, 2026 17:00
@pompon0 pompon0 added this pull request to the merge queue Apr 2, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 2, 2026
@pompon0 pompon0 added this pull request to the merge queue Apr 2, 2026
Merged via the queue into main with commit 3ccf8e6 Apr 2, 2026
40 of 41 checks passed
@pompon0 pompon0 deleted the gprusak-exe2 branch April 2, 2026 18:27
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.

3 participants