Skip to content

Commit

Permalink
Remove unused fields in full node (cosmos#1218)
Browse files Browse the repository at this point in the history
<!--
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
Closes: cosmos#1219 

<!-- 
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
- [x] New and updated code has new and/or updated testing
- [x] Required CI checks are passing
- [ ] Visual proof for any user facing features like CLI or
documentation updates
- [x] Linked issues closed with keywords
  • Loading branch information
Manav-Aggarwal authored Oct 4, 2023
1 parent e3f2b40 commit 6c4a346
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 30 deletions.
45 changes: 20 additions & 25 deletions node/full.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ type FullNode struct {
P2P *p2p.Client

// TODO(tzdybal): consider extracting "mempool reactor"
Mempool mempool.Mempool
mempoolIDs *mempoolIDs
incomingTxCh chan *p2p.GossipMessage
Mempool mempool.Mempool
mempoolIDs *mempoolIDs

Store store.Store
blockManager *block.Manager
dalc da.DataAvailabilityLayerClient

// Preserves cometBFT compatibility
TxIndexer txindex.TxIndexer
BlockIndexer indexer.BlockIndexer
IndexerService *txindex.IndexerService
Expand All @@ -84,9 +84,6 @@ type FullNode struct {
ctx context.Context

cancel context.CancelFunc

// For use in Lazy Aggregator
DoneBuildingBlock chan struct{}
}

// newFullNode creates a new Rollkit full node.
Expand Down Expand Up @@ -170,25 +167,23 @@ func newFullNode(
ctx, cancel := context.WithCancel(ctx)

node := &FullNode{
proxyApp: proxyApp,
eventBus: eventBus,
genesis: genesis,
conf: conf,
P2P: client,
blockManager: blockManager,
dalc: dalc,
Mempool: mp,
mempoolIDs: mpIDs,
incomingTxCh: make(chan *p2p.GossipMessage),
Store: s,
TxIndexer: txIndexer,
IndexerService: indexerService,
BlockIndexer: blockIndexer,
hExService: headerExchangeService,
bExService: blockExchangeService,
ctx: ctx,
cancel: cancel,
DoneBuildingBlock: doneBuildingChannel,
proxyApp: proxyApp,
eventBus: eventBus,
genesis: genesis,
conf: conf,
P2P: client,
blockManager: blockManager,
dalc: dalc,
Mempool: mp,
mempoolIDs: mpIDs,
Store: s,
TxIndexer: txIndexer,
IndexerService: indexerService,
BlockIndexer: blockIndexer,
hExService: headerExchangeService,
bExService: blockExchangeService,
ctx: ctx,
cancel: cancel,
}

node.BaseService = *service.NewBaseService(logger, "Node", node)
Expand Down
5 changes: 0 additions & 5 deletions node/full_node_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (

"github.com/rollkit/rollkit/config"
mockda "github.com/rollkit/rollkit/da/mock"
"github.com/rollkit/rollkit/p2p"
"github.com/rollkit/rollkit/store"
test "github.com/rollkit/rollkit/test/log"
"github.com/rollkit/rollkit/test/mocks"
Expand All @@ -46,7 +45,6 @@ func TestAggregatorMode(t *testing.T) {
app.On(Commit, mock.Anything).Return(abci.ResponseCommit{})

key, _, _ := crypto.GenerateEd25519Key(rand.Reader)
anotherKey, _, _ := crypto.GenerateEd25519Key(rand.Reader)
genesisValidators, signingKey := getGenesisValidatorSetWithSigner(1)
blockManagerConfig := config.BlockManagerConfig{
BlockTime: 1 * time.Second,
Expand All @@ -67,8 +65,6 @@ func TestAggregatorMode(t *testing.T) {
}()
assert.True(node.IsRunning())

pid, err := peer.IDFromPrivateKey(anotherKey)
require.NoError(err)
ctx, cancel = context.WithCancel(context.TODO())
defer cancel()
go func() {
Expand All @@ -77,7 +73,6 @@ func TestAggregatorMode(t *testing.T) {
case <-ctx.Done():
return
default:
node.incomingTxCh <- &p2p.GossipMessage{Data: []byte(time.Now().String()), From: pid}
time.Sleep(time.Duration(mrand.Uint32()%20) * time.Millisecond) //nolint:gosec
}
}
Expand Down

0 comments on commit 6c4a346

Please sign in to comment.