Skip to content

Commit 8a524e5

Browse files
authored
Fix ci dead links (#1390)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. --> ## Overview <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. --> ## Checklist <!-- Please complete the checklist to ensure that the PR is ready to be reviewed. IMPORTANT: PRs should be left in Draft until the below checklist is completed. --> - [ ] New and updated code has appropriate documentation - [ ] New and updated code has new and/or updated testing - [ ] Required CI checks are passing - [ ] Visual proof for any user facing features like CLI or documentation updates - [ ] Linked issues closed with keywords <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Updated the mempool module documentation with the correct URL reference. - Replaced `state.md` with `block-executor.md` to reflect the current system structure. - Removed outdated assumption from Full Node documentation and updated service references. - Introduced `DAClient` wrapper in DA documentation for improved interaction with data availability systems. - **New Features** - Implemented new methods in `BlockExecutor` for enhanced block management. - Added `ProcessProposal` function to `BlockExecutor` for processing proposals. - Added `CheckBounds` function for boundary checking in event queries. - **Bug Fixes** - Improved error handling in `block/manager.go` with context cancellation checks. - Updated transaction validation logic in `FullNode` to handle context completion. - Enhanced `FullClient` functions with context cancellation handling. - **Refactor** - Removed the `ResultCheckBlock` type from the DA layer client interface. - Updated test assertions from `assert` to `require` for stricter error checking in `ws_test.go`. - **Chores** - Updated CI pipeline to use Go version 1.21. - Modified `protoc.sh` script to reflect changes in protobuf generation for new modules. - **Style** - No visible style changes to end-users. - **Tests** - No direct changes to end-user testing. - **Revert** - No reverts in this release. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 4b531f7 + b109aee commit 8a524e5

20 files changed

Lines changed: 232 additions & 1397 deletions

File tree

.github/workflows/ci_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
runs-on: ubuntu-latest
2929
env:
3030
# use consistent go version throughout pipeline here
31-
GO_VERSION: "1.20"
31+
GO_VERSION: "1.21"
3232
outputs:
3333
go-version: ${{ steps.set-vars.outputs.go-version }}
3434
steps:

block/manager.go

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/cometbft/cometbft/proxy"
1717
cmtypes "github.com/cometbft/cometbft/types"
1818
"github.com/libp2p/go-libp2p/core/crypto"
19+
"github.com/pkg/errors"
1920
"go.uber.org/multierr"
2021

2122
"github.com/rollkit/rollkit/config"
@@ -426,6 +427,17 @@ func (m *Manager) BlockStoreRetrieveLoop(ctx context.Context) {
426427
}
427428
daHeight := atomic.LoadUint64(&m.daHeight)
428429
for _, block := range blocks {
430+
// Check for shut down event prior to logging
431+
// and sending block to blockInCh. The reason
432+
// for checking for the shutdown event
433+
// separately is due to the inconsistent nature
434+
// of the select statement when multiple cases
435+
// are satisfied.
436+
select {
437+
case <-ctx.Done():
438+
return
439+
default:
440+
}
429441
m.logger.Debug("block retrieved from p2p block sync", "blockHeight", block.Height(), "daHeight", daHeight)
430442
m.blockInCh <- newBlockEvent{block, daHeight}
431443
}
@@ -501,6 +513,17 @@ func (m *Manager) processNextDABlock(ctx context.Context) error {
501513
m.blockCache.setDAIncluded(blockHash)
502514
m.logger.Info("block marked as DA included", "blockHeight", block.Height(), "blockHash", blockHash)
503515
if !m.blockCache.isSeen(blockHash) {
516+
// Check for shut down event prior to logging
517+
// and sending block to blockInCh. The reason
518+
// for checking for the shutdown event
519+
// separately is due to the inconsistent nature
520+
// of the select statement when multiple cases
521+
// are satisfied.
522+
select {
523+
case <-ctx.Done():
524+
return errors.WithMessage(ctx.Err(), "unable to send block to blockInCh, context done")
525+
default:
526+
}
504527
m.blockInCh <- newBlockEvent{block, daHeight}
505528
}
506529
}
@@ -689,11 +712,13 @@ func (m *Manager) publishBlock(ctx context.Context) error {
689712
if err != nil {
690713
return err
691714
}
692-
693-
// Check if the node has shutdown prior to publishing to channels
715+
// Check for shut down event prior to sending the header and block to
716+
// their respective channels. The reason for checking for the shutdown
717+
// event separately is due to the inconsistent nature of the select
718+
// statement when multiple cases are satisfied.
694719
select {
695720
case <-ctx.Done():
696-
return nil
721+
return errors.WithMessage(ctx.Err(), "unable to send header and block, context done")
697722
default:
698723
}
699724

da/da.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ type ResultSubmitBlocks struct {
4949
// Hash hash.Hash
5050
}
5151

52-
// ResultCheckBlock contains information about block availability, returned from DA layer client.
53-
type ResultCheckBlock struct {
54-
BaseResult
55-
// DataAvailable is the actual answer whether the block is available or not.
56-
// It can be true if and only if Code is equal to StatusSuccess.
57-
DataAvailable bool
58-
}
59-
6052
// ResultRetrieveBlocks contains batch of blocks returned from DA layer client.
6153
type ResultRetrieveBlocks struct {
6254
BaseResult

da/da.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,35 @@
11
# DA
2+
3+
Rollkit provides a wrapper for [go-da][go-da], a generic data availability interface for modular blockchains, called `DAClient` with wrapper functionalities like `SubmitBlocks` and `RetrieveBlocks` to help block manager interact with DA more easily.
4+
5+
## Details
6+
7+
`DAClient` under the hood uses a GRPC implementation of the [go-da][go-da] DA interface. Using the `DAAddress` specified in the node's config, node creates a GRPC connection to it using go-da's gprc implementation [grpc-proxy][grpc-proxy] which is then used under the hood of `DAClient` to communicated with the underlying DA.
8+
9+
Given a set of blocks to be submitted to DA by the block manager, the `SubmitBlocks` first encodes the blocks using protobuf (the encoded data are called blobs) and invokes the `Submit` method on the underlying DA implementation. On successful submission (`StatusSuccess`), the DA block height which included in the rollup blocks is returned.
10+
11+
The `Submit` call may result in an error (`StatusError`) based on the underlying DA implementations on following scenarios:
12+
13+
* the total blobs size exceeds the underlying DA's limits (includes empty blobs)
14+
* the implementation specific failures, e.g., for [celestia-da][celestia-da], invalid namespace, unable to create the commitment or proof, setting low gas price, etc, could return error.
15+
16+
The `RetrieveBlocks` retrieves the rollup blocks for a given DA height using [go-da][go-da] `GetIDs` and `Get` methods. If there are no blocks available for a given DA height, `StatusNotFound` is returned (which is not an error case). The retrieved blobs are converted back to rollup blocks and returned on successful retrieval.
17+
18+
Both `SubmitBlocks` and `RetrieveBlocks` may be unsuccessful if the DA node and the DA blockchain that the DA implementation is using have failures. For example, failures such as, DA mempool is full, DA submit transaction is nonce clashing with other transaction from the DA submitter account, DA node is not synced, etc.
19+
20+
## Implementation
21+
22+
See [da implementation]
23+
24+
## References
25+
26+
[1] [go-da][go-da]
27+
28+
[2] [celestia-da][celestia-da]
29+
30+
[3] [grpc-proxy][grpc-proxy]
31+
32+
[da implementation]: https://github.com/rollkit/rollkit/blob/main/da/da.go
33+
[go-da]: https://github.com/rollkit/go-da
34+
[celestia-da]: https://github.com/rollkit/celestia-da
35+
[grpc-proxy]: https://github.com/rollkit/go-da/tree/main/proxy

go.mod

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/cosmos/gogoproto v1.4.11
1212
github.com/dgraph-io/badger/v3 v3.2103.5
1313
github.com/go-kit/kit v0.13.0
14-
github.com/gogo/protobuf v1.3.3
14+
github.com/gogo/protobuf v1.3.2
1515
github.com/gorilla/rpc v1.2.1
1616
github.com/gorilla/websocket v1.5.1
1717
github.com/ipfs/go-datastore v0.6.0
@@ -21,6 +21,7 @@ require (
2121
github.com/libp2p/go-libp2p-kad-dht v0.23.0
2222
github.com/libp2p/go-libp2p-pubsub v0.9.3
2323
github.com/multiformats/go-multiaddr v0.12.0
24+
github.com/pkg/errors v0.9.1
2425
github.com/prometheus/client_golang v1.17.0
2526
github.com/rollkit/go-da v0.0.0-20231117151938-ee3b613d7a3a
2627
github.com/rs/cors v1.10.1
@@ -132,7 +133,6 @@ require (
132133
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
133134
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
134135
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
135-
github.com/pkg/errors v0.9.1 // indirect
136136
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
137137
github.com/polydawn/refmt v0.89.0 // indirect
138138
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
@@ -177,5 +177,3 @@ require (
177177
gopkg.in/yaml.v3 v3.0.1 // indirect
178178
lukechampine.com/blake3 v1.2.1 // indirect
179179
)
180-
181-
replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.2-alpha.regen.4

go.sum

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,13 @@ github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x
429429
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
430430
github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
431431
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
432+
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
433+
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
434+
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
435+
github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
436+
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
437+
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
438+
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
432439
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
433440
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
434441
github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8=
@@ -767,7 +774,9 @@ github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSX
767774
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
768775
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k=
769776
github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0=
777+
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
770778
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
779+
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
771780
github.com/kisielk/errcheck v1.6.1/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw=
772781
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
773782
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
@@ -1331,8 +1340,6 @@ github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqn
13311340
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
13321341
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
13331342
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
1334-
github.com/regen-network/protobuf v1.3.2-alpha.regen.4 h1:c9jEnU+xm6vqyrQe3M94UFWqiXxRIKKnqBOh2EACmBE=
1335-
github.com/regen-network/protobuf v1.3.2-alpha.regen.4/go.mod h1:/J8/bR1T/NXyIdQDLUaq15LjNE83nRzkyrLAMcPewig=
13361343
github.com/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5/go.mod h1:+u151txRmLpwxBmpYn9z3d1sdJdjRPQpsXuYeY9jNls=
13371344
github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96/go.mod h1:90HvCY7+oHHUKkbeMCiHt1WuFR2/hPJ9QrljDG+v6ls=
13381345
github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e/go.mod h1:80FQABjoFzZ2M5uEa6FUaJYEmqU2UOKojlFVak1UAwI=
@@ -2012,6 +2019,7 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb
20122019
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
20132020
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
20142021
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
2022+
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
20152023
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
20162024
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
20172025
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -2056,7 +2064,6 @@ golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapK
20562064
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
20572065
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
20582066
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
2059-
golang.org/x/tools v0.0.0-20200110213125-a7a6caa82ab2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
20602067
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
20612068
golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
20622069
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
@@ -2077,6 +2084,7 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY
20772084
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
20782085
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
20792086
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
2087+
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
20802088
golang.org/x/tools v0.0.0-20200622203043-20e05c1c8ffa/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
20812089
golang.org/x/tools v0.0.0-20200624225443-88f3c62a19ff/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
20822090
golang.org/x/tools v0.0.0-20200625211823-6506e20df31f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
@@ -2102,6 +2110,7 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f
21022110
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
21032111
golang.org/x/tools v0.0.0-20201230224404-63754364767c/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
21042112
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
2113+
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
21052114
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
21062115
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
21072116
golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU=
@@ -2216,7 +2225,6 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfG
22162225
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
22172226
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
22182227
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
2219-
google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
22202228
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
22212229
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
22222230
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=

mempool/mempool.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Abstract
44

5-
The mempool module stores transactions which have not yet been included in a block, and provides an interface to check the validity of incoming transactions. It's defined by an interface [here](https://github.com/rollkit/rollkit/blob/main/mempool/mempool.go#L16), with an implementation [here](https://github.com/rollkit/rollkit/blob/main/mempool/v1/mempool.go).
5+
The mempool module stores transactions which have not yet been included in a block, and provides an interface to check the validity of incoming transactions. It's defined by an interface [here](https://github.com/rollkit/rollkit/blob/main/mempool/mempool.go#L16), with an implementation [here](https://github.com/rollkit/rollkit/blob/main/mempool/mempool.go).
66

77
## Component Description
88

node/full.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,11 @@ func (n *FullNode) newTxValidator() p2p.GossipValidator {
400400
n.Logger.Debug("transaction received", "bytes", len(m.Data))
401401
checkTxResCh := make(chan *abci.ResponseCheckTx, 1)
402402
err := n.Mempool.CheckTx(m.Data, func(resp *abci.ResponseCheckTx) {
403-
checkTxResCh <- resp
403+
select {
404+
case <-n.ctx.Done():
405+
return
406+
case checkTxResCh <- resp:
407+
}
404408
}, mempool.TxInfo{
405409
SenderID: n.mempoolIDs.GetForPeer(m.From),
406410
SenderP2PID: corep2p.ID(m.From),

node/full_client.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ func (c *FullClient) BroadcastTxCommit(ctx context.Context, tx cmtypes.Tx) (*cty
120120
// add to mempool and wait for CheckTx result
121121
checkTxResCh := make(chan *abci.ResponseCheckTx, 1)
122122
err = c.node.Mempool.CheckTx(tx, func(res *abci.ResponseCheckTx) {
123-
checkTxResCh <- res
123+
select {
124+
case <-ctx.Done():
125+
return
126+
case checkTxResCh <- res:
127+
}
124128
}, mempool.TxInfo{})
125129
if err != nil {
126130
c.Logger.Error("Error on broadcastTxCommit", "err", err)
@@ -198,7 +202,11 @@ func (c *FullClient) BroadcastTxAsync(ctx context.Context, tx cmtypes.Tx) (*ctyp
198202
func (c *FullClient) BroadcastTxSync(ctx context.Context, tx cmtypes.Tx) (*ctypes.ResultBroadcastTx, error) {
199203
resCh := make(chan *abci.ResponseCheckTx, 1)
200204
err := c.node.Mempool.CheckTx(tx, func(res *abci.ResponseCheckTx) {
201-
resCh <- res
205+
select {
206+
case <-ctx.Done():
207+
return
208+
case resCh <- res:
209+
}
202210
}, mempool.TxInfo{})
203211
if err != nil {
204212
return nil, err

node/full_node.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The Full Node communicates with other nodes in the network using the P2P client.
6060

6161
## Assumptions and Considerations
6262

63-
The Full Node assumes that the configuration, private keys, client creator, genesis document, and logger are correctly passed in by the Cosmos SDK. It also assumes that the P2P client, data availability layer client, mempool, block manager, and other services can be started and stopped without errors. The DA layer specified in the node configuration should be in the list of registered clients in the [DA registry].
63+
The Full Node assumes that the configuration, private keys, client creator, genesis document, and logger are correctly passed in by the Cosmos SDK. It also assumes that the P2P client, data availability layer client, mempool, block manager, and other services can be started and stopped without errors.
6464

6565
## Implementation
6666

@@ -88,11 +88,9 @@ See [full node]
8888

8989
[10] [Data Availability Layer Client][dalc]
9090

91-
[11] [DA registry][DA registry]
91+
[11] [Header Sync Service][Header Sync Service]
9292

93-
[12] [Header Sync Service][Header Sync Service]
94-
95-
[13] [Block Sync Service][Block Sync Service]
93+
[12] [Block Sync Service][Block Sync Service]
9694

9795
[full node]: https://github.com/rollkit/rollkit/blob/main/node/full.go
9896
[ABCI app connections]: https://github.com/cometbft/cometbft/blob/main/spec/abci/abci%2B%2B_basic_concepts.md
@@ -104,6 +102,5 @@ See [full node]
104102
[store interface]: https://github.com/rollkit/rollkit/blob/main/store/types.go
105103
[Block Manager]: https://github.com/rollkit/rollkit/blob/main/block/manager.go
106104
[dalc]: https://github.com/rollkit/rollkit/blob/main/da/da.go
107-
[DA registry]: https://github.com/rollkit/rollkit/blob/main/da/registry/registry.go
108105
[Header Sync Service]: https://github.com/rollkit/rollkit/blob/main/block/header_sync.go
109106
[Block Sync Service]: https://github.com/rollkit/rollkit/blob/main/block/block_sync.go

0 commit comments

Comments
 (0)