mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-11 06:11:07 +00:00
*Adds a flag to the which enables discarding of abci responses Co-authored-by: Callum Waters <cmwaters19@gmail.com> Co-authored-by: Samantha Ricotta <samantharicotta@Samanthas-MacBook-Pro.local> Co-authored-by: Samantha Ricotta <samantharicotta@Samanthas-MBP.fritz.box>
This commit is contained in:
@@ -139,7 +139,7 @@ func makeNode(cfg *config.Config,
|
||||
}
|
||||
closers = append(closers, dbCloser)
|
||||
|
||||
stateStore := sm.NewStore(stateDB)
|
||||
stateStore := sm.NewStore(stateDB, sm.StoreOptions{DiscardABCIResponses: cfg.RPC.DiscardABCIResponses})
|
||||
|
||||
genDoc, err := genesisDocProvider()
|
||||
if err != nil {
|
||||
|
||||
@@ -232,7 +232,9 @@ func TestCreateProposalBlock(t *testing.T) {
|
||||
|
||||
const height int64 = 1
|
||||
state, stateDB, privVals := state(1, height)
|
||||
stateStore := sm.NewStore(stateDB)
|
||||
stateStore := sm.NewStore(stateDB, sm.StoreOptions{
|
||||
DiscardABCIResponses: false,
|
||||
})
|
||||
maxBytes := 16384
|
||||
const partSize uint32 = 256
|
||||
maxEvidenceBytes := int64(maxBytes / 2)
|
||||
@@ -325,7 +327,9 @@ func TestMaxTxsProposalBlockSize(t *testing.T) {
|
||||
|
||||
const height int64 = 1
|
||||
state, stateDB, _ := state(1, height)
|
||||
stateStore := sm.NewStore(stateDB)
|
||||
stateStore := sm.NewStore(stateDB, sm.StoreOptions{
|
||||
DiscardABCIResponses: false,
|
||||
})
|
||||
blockStore := store.NewBlockStore(dbm.NewMemDB())
|
||||
const maxBytes int64 = 16384
|
||||
const partSize uint32 = 256
|
||||
@@ -387,7 +391,9 @@ func TestMaxProposalBlockSize(t *testing.T) {
|
||||
logger := log.TestingLogger()
|
||||
|
||||
state, stateDB, _ := state(types.MaxVotesCount, int64(1))
|
||||
stateStore := sm.NewStore(stateDB)
|
||||
stateStore := sm.NewStore(stateDB, sm.StoreOptions{
|
||||
DiscardABCIResponses: false,
|
||||
})
|
||||
blockStore := store.NewBlockStore(dbm.NewMemDB())
|
||||
const maxBytes int64 = 1024 * 1024 * 2
|
||||
state.ConsensusParams.Block.MaxBytes = maxBytes
|
||||
@@ -625,7 +631,9 @@ func state(nVals int, height int64) (sm.State, dbm.DB, []types.PrivValidator) {
|
||||
|
||||
// save validators to db for 2 heights
|
||||
stateDB := dbm.NewMemDB()
|
||||
stateStore := sm.NewStore(stateDB)
|
||||
stateStore := sm.NewStore(stateDB, sm.StoreOptions{
|
||||
DiscardABCIResponses: false,
|
||||
})
|
||||
if err := stateStore.Save(s); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -648,7 +656,9 @@ func loadStatefromGenesis(t *testing.T) sm.State {
|
||||
t.Helper()
|
||||
|
||||
stateDB := dbm.NewMemDB()
|
||||
stateStore := sm.NewStore(stateDB)
|
||||
stateStore := sm.NewStore(stateDB, sm.StoreOptions{
|
||||
DiscardABCIResponses: false,
|
||||
})
|
||||
cfg, err := config.ResetTestRoot("load_state_from_genesis")
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
@@ -297,7 +297,9 @@ func createEvidenceReactor(
|
||||
logger = logger.With("module", "evidence")
|
||||
reactorShim := p2p.NewReactorShim(logger, "EvidenceShim", evidence.ChannelShims)
|
||||
|
||||
evidencePool, err := evidence.NewPool(logger, evidenceDB, sm.NewStore(stateDB), blockStore)
|
||||
evidencePool, err := evidence.NewPool(logger, evidenceDB, sm.NewStore(stateDB, sm.StoreOptions{
|
||||
DiscardABCIResponses: cfg.RPC.DiscardABCIResponses,
|
||||
}), blockStore)
|
||||
if err != nil {
|
||||
return nil, nil, nil, fmt.Errorf("creating evidence pool: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user