Skip to content
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

feat: ABCI Execution Client Implementation #9

Draft
wants to merge 5 commits into
base: main
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
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Architecture

```mermaid
graph TB
subgraph go-execution
R[Execute Interface]
end
subgraph "go-execution-abci"
AEC[ABCIExecutionClient]
PC[ProxyClient]
end
subgraph "CometBFT"
ABCI[ABCI Application]
MP[Mempool]
EB[EventBus]
end
R -->|implements| AEC
AEC -->|Delegates| PC
PC -->|ABCI Calls| ABCI
PC -->|Tx Management| MP
PC -->|Events| EB
classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px;
classDef highlight fill:#e1f7d5,stroke:#333,stroke-width:2px;
class AEC,PC highlight;
```
49 changes: 49 additions & 0 deletions execution.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package execution

import (
"time"

execution "github.com/rollkit/go-execution"
rollkitTypes "github.com/rollkit/rollkit/types"
)

type ABCIExecutionClient struct {
execute execution.Execute
}

func NewABCIExecutionClient(execute execution.Execute) *ABCIExecutionClient {
return &ABCIExecutionClient{
execute: execute,
}
}

var _ execution.Execute = (*ABCIExecutionClient)(nil)

// InitChain initializes the blockchain with genesis information.
func (c *ABCIExecutionClient) InitChain(
genesisTime time.Time,
initialHeight uint64,
chainID string,
) (rollkitTypes.Hash, uint64, error) {
return c.execute.InitChain(genesisTime, initialHeight, chainID)
}

// GetTxs retrieves transactions from the transaction pool.
func (c *ABCIExecutionClient) GetTxs() ([]rollkitTypes.Tx, error) {
return c.execute.GetTxs()
}

// ExecuteTxs executes the given transactions and returns the new state root and gas used.
func (c *ABCIExecutionClient) ExecuteTxs(
txs []rollkitTypes.Tx,
blockHeight uint64,
timestamp time.Time,
prevStateRoot rollkitTypes.Hash,
) (rollkitTypes.Hash, uint64, error) {
return c.execute.ExecuteTxs(txs, blockHeight, timestamp, prevStateRoot)
}

// SetFinal marks a block at the given height as final.
func (c *ABCIExecutionClient) SetFinal(blockHeight uint64) error {
return c.execute.SetFinal(blockHeight)
}
104 changes: 102 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,103 @@
module github.com/rollkit/template-da-repo
module github.com/rollkit/go-execution-abci

go 1.21.0
go 1.22.7

toolchain go1.22.8

replace github.com/rollkit/go-execution => github.com/lastdotnet/go-execution v0.0.0-20241029045146-b7513b533b24

require (
github.com/cometbft/cometbft v0.38.13
github.com/rollkit/go-execution v0.0.0-00010101000000-000000000000
github.com/rollkit/rollkit v0.13.8-0.20241021170619-fc65faf646a7
)

require (
github.com/DataDog/zstd v1.4.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/celestiaorg/go-header v0.6.2 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v1.1.1 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft-db v0.14.1 // indirect
github.com/cosmos/gogoproto v1.7.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/dgraph-io/badger/v4 v4.2.1-0.20231013074411-fb1b00959581 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/go-kit/kit v0.13.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.2.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/flatbuffers v1.12.1 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/ipfs/go-cid v0.4.1 // indirect
github.com/ipfs/go-datastore v0.6.0 // indirect
github.com/ipfs/go-ds-badger4 v0.1.5 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/jbenet/goprocess v0.1.4 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-libp2p v0.36.2 // indirect
github.com/libp2p/go-libp2p-pubsub v0.12.0 // indirect
github.com/libp2p/go-msgio v0.3.0 // indirect
github.com/linxGnu/grocksdb v1.8.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multiaddr v0.13.0 // indirect
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
github.com/multiformats/go-multibase v0.2.0 // indirect
github.com/multiformats/go-multicodec v0.9.0 // indirect
github.com/multiformats/go-multihash v0.2.3 // indirect
github.com/multiformats/go-multistream v0.5.0 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae // indirect
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.20.4 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.59.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rollkit/go-sequencing v0.2.1-0.20241010053131-3134457dc4e5 // indirect
github.com/sasha-s/go-deadlock v0.3.5 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.18.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.3.0 // indirect
)
Loading
Loading