From 7cd4577a1c4e831ed4d7c5b31ba3f6e6e4425b2c Mon Sep 17 00:00:00 2001 From: Jasmina Malicevic Date: Fri, 24 Jun 2022 10:07:38 +0200 Subject: [PATCH] Applied PR comments --- mempool/ids.go | 76 +--------------------------------------- test/e2e/pkg/manifest.go | 3 ++ 2 files changed, 4 insertions(+), 75 deletions(-) diff --git a/mempool/ids.go b/mempool/ids.go index d50337710..b97f51083 100644 --- a/mempool/ids.go +++ b/mempool/ids.go @@ -1,77 +1,3 @@ package mempool -// import ( -// "fmt" - -// tmsync "github.com/tendermint/tendermint/internal/libs/sync" -// "github.com/tendermint/tendermint/types" -// ) - -// // nolint: revive -// // TODO: Rename type. -// type MempoolIDs struct { -// mtx tmsync.RWMutex -// peerMap map[types.NodeID]uint16 -// nextID uint16 // assumes that a node will never have over 65536 active peers -// activeIDs map[uint16]struct{} // used to check if a given peerID key is used -// } - -// func NewMempoolIDs() *MempoolIDs { -// return &MempoolIDs{ -// peerMap: make(map[types.NodeID]uint16), - -// // reserve UnknownPeerID for mempoolReactor.BroadcastTx -// activeIDs: map[uint16]struct{}{UnknownPeerID: {}}, -// nextID: 1, -// } -// } - -// // ReserveForPeer searches for the next unused ID and assigns it to the provided -// // peer. -// func (ids *MempoolIDs) ReserveForPeer(peerID types.NodeID) { -// ids.mtx.Lock() -// defer ids.mtx.Unlock() - -// curID := ids.nextPeerID() -// ids.peerMap[peerID] = curID -// ids.activeIDs[curID] = struct{}{} -// } - -// // Reclaim returns the ID reserved for the peer back to unused pool. -// func (ids *MempoolIDs) Reclaim(peerID types.NodeID) { -// ids.mtx.Lock() -// defer ids.mtx.Unlock() - -// removedID, ok := ids.peerMap[peerID] -// if ok { -// delete(ids.activeIDs, removedID) -// delete(ids.peerMap, peerID) -// } -// } - -// // GetForPeer returns an ID reserved for the peer. -// func (ids *MempoolIDs) GetForPeer(peerID types.NodeID) uint16 { -// ids.mtx.RLock() -// defer ids.mtx.RUnlock() - -// return ids.peerMap[peerID] -// } - -// // nextPeerID returns the next unused peer ID to use. We assume that the mutex -// // is already held. -// func (ids *MempoolIDs) nextPeerID() uint16 { -// if len(ids.activeIDs) == MaxActiveIDs { -// panic(fmt.Sprintf("node has maximum %d active IDs and wanted to get one more", MaxActiveIDs)) -// } - -// _, idExists := ids.activeIDs[ids.nextID] -// for idExists { -// ids.nextID++ -// _, idExists = ids.activeIDs[ids.nextID] -// } - -// curID := ids.nextID -// ids.nextID++ - -// return curID -// } +// These functiosn were moved into v0/reactor.go and v1/reactor.go \ No newline at end of file diff --git a/test/e2e/pkg/manifest.go b/test/e2e/pkg/manifest.go index a61206632..ab9073d62 100644 --- a/test/e2e/pkg/manifest.go +++ b/test/e2e/pkg/manifest.go @@ -91,8 +91,11 @@ type ManifestNode struct { // FastSync specifies the fast sync mode: "" (disable), "v0", "v1", or "v2". // Defaults to disabled. FastSync string `toml:"fast_sync"` + // Mempool specifies which version of mempool to use. Either "v0" or "v1" + // This defaults to v0. Mempool string `toml:"mempool_version"` + // StateSync enables state sync. The runner automatically configures trusted // block hashes and RPC servers. At least one node in the network must have // SnapshotInterval set to non-zero, and the state syncing node must have