Skip to content

[Experiment]: network commits #162

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

Draft
wants to merge 22 commits into
base: alex/val_net_val_sig
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ proto-gen:
@cd modules/proto && \
go tool github.com/bufbuild/buf/cmd/buf generate
@mv modules/github.com/rollkit/go-execution-abci/modules/rollkitmngr/types/** modules/rollkitmngr/types/ && \
mv modules/github.com/rollkit/go-execution-abci/modules/rollkitmngr/module/* modules/rollkitmngr/module/
mv modules/github.com/rollkit/go-execution-abci/modules/rollkitmngr/module/* modules/rollkitmngr/module/ && \
mv modules/github.com/rollkit/go-execution-abci/modules/network/types/** modules/network/types/ && \
mv modules/github.com/rollkit/go-execution-abci/modules/network/module/v1/* modules/network/module/v1
@rm -r modules/github.com

.PHONY: proto-gen
.PHONY: proto-gen
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ graph TD
E[Mempool] <--> B
F[RPC Server] --> B
B --> G[Store]

subgraph "Rollkit"
A
end

subgraph "go-execution-abci"
B
D
E
F
G
end

subgraph "Application"
C
end

style B fill:#f9f,stroke:#333,stroke-width:2px
style A fill:#bbf,stroke:#333,stroke-width:1px
style C fill:#bfb,stroke:#333,stroke-width:1px
Expand Down Expand Up @@ -87,6 +87,8 @@ executor := adapter.NewABCIExecutor(
logger, // Logger
config, // CometBFT config
appGenesis, // Application genesis
nil, // Metrics (optional)
// Optional: custom block publisher, metrics,...
)

// Set up mempool for transaction handling
Expand All @@ -110,26 +112,26 @@ sequenceDiagram
participant Mempool
participant Adapter
participant ABCI App

Client->>P2P Network: Submit Tx
P2P Network->>Mempool: Gossip Tx
Mempool->>Adapter: CheckTx
Adapter->>ABCI App: CheckTx
ABCI App-->>Adapter: Response

Note over Adapter: Block Creation Time

Adapter->>Adapter: GetTxs
Adapter->>ABCI App: PrepareProposal
ABCI App-->>Adapter: Txs

Note over Adapter: Block Execution

Adapter->>ABCI App: ProcessProposal
ABCI App-->>Adapter: Accept/Reject
Adapter->>ABCI App: FinalizeBlock
ABCI App-->>Adapter: AppHash

Adapter->>ABCI App: Commit
```

Expand Down Expand Up @@ -172,15 +174,15 @@ classDiagram
+GetTxs()
+SetFinal()
}

class Executor {
<<interface>>
+InitChain()
+ExecuteTxs()
+GetTxs()
+SetFinal()
}

class ABCI {
<<interface>>
+InitChain()
Expand All @@ -189,18 +191,18 @@ classDiagram
+FinalizeBlock()
+Commit()
}

class Mempool {
+CheckTx()
+ReapMaxBytesMaxGas()
}

class Store {
+Get()
+Set()
+Height()
}

Executor <|.. Adapter : implements
Adapter o-- ABCI : uses
Adapter o-- Mempool : uses
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ require (
golang.org/x/sync v0.15.0
google.golang.org/genproto/googleapis/api v0.0.0-20250505200425-f936aa4a68b2
google.golang.org/grpc v1.73.0
google.golang.org/protobuf v1.36.6
)

require (
Expand Down Expand Up @@ -336,7 +337,6 @@ require (
gonum.org/v1/gonum v0.15.1 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
79 changes: 79 additions & 0 deletions modules/network/autocli.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package network

import (
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"

networkv1 "github.com/rollkit/go-execution-abci/modules/network/types"
)

// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
return &autocliv1.ModuleOptions{
Query: &autocliv1.ServiceCommandDescriptor{
Service: networkv1.Query_serviceDesc.ServiceName,
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Params",
Use: "params",
Short: "Query the current network parameters",
},
{
RpcMethod: "AttestationBitmap",
Use: "attestation [height]",
Short: "Query the attestation bitmap for a specific height",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "height"},
},
},
{
RpcMethod: "EpochInfo",
Use: "epoch [epoch-number]",
Short: "Query information about a specific epoch",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "epoch"},
},
},
{
RpcMethod: "ValidatorIndex",
Use: "validator-index [address]",
Short: "Query the bitmap index for a validator",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "address"},
},
},
{
RpcMethod: "SoftConfirmationStatus",
Use: "soft-confirmation [height]",
Short: "Query if a height is soft-confirmed",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "height"},
},
},
},
},
Tx: &autocliv1.ServiceCommandDescriptor{
Service: networkv1.Msg_serviceDesc.ServiceName,
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Attest",
Use: "attest [height] [vote-base64]",
Short: "Submit an attestation for a checkpoint height",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "height"},
{ProtoField: "vote"},
},
},
{
RpcMethod: "JoinAttesterSet",
Use: "join-attester",
Short: "Join the attester set as a validator",
},
{
RpcMethod: "LeaveAttesterSet",
Use: "leave-attester",
Short: "Leave the attester set as a validator",
},
},
},
}
}
Loading
Loading