Skip to content

Commit

Permalink
A
Browse files Browse the repository at this point in the history
  • Loading branch information
xxo1shine committed Dec 8, 2021
1 parent a9d9037 commit ef36b06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ package consensus
import (
"bytes"
"fmt"
"reflect"
"runtime/debug"
"sync"
"time"

"github.com/pkg/errors"

cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/fail"
"github.com/tendermint/tendermint/libs/log"
tmtime "github.com/tendermint/tendermint/types/time"
"reflect"
"runtime/debug"
"sync"
"time"

cfg "github.com/tendermint/tendermint/config"
cstypes "github.com/tendermint/tendermint/consensus/types"
Expand Down Expand Up @@ -993,6 +991,7 @@ func (cs *ConsensusState) createProposalBlock() (block *types.Block, blockParts
}

proposerAddr := cs.privValidator.GetPubKey().Address()
//sizeof := unsafe.Sizeof(cs.state.SideTxResponses)
return cs.blockExec.CreateProposalBlock(cs.Height, cs.state, commit, proposerAddr)
}

Expand Down
6 changes: 3 additions & 3 deletions state/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ package state
import (
"bytes"
"fmt"
"time"

abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/fail"
"github.com/tendermint/tendermint/libs/log"
mempl "github.com/tendermint/tendermint/mempool"
"github.com/tendermint/tendermint/proxy"
"github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"
"time"
)

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -104,7 +103,8 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
evidence := blockExec.evpool.PendingEvidence(maxNumEvidence)

// Fetch a limited amount of valid txs
maxDataBytes := types.MaxDataBytes(maxBytes, state.Validators.Size(), len(evidence))
size := len(state.SideTxResponses)
maxDataBytes := types.MaxDataBytes(maxBytes - int64(size) * 223, state.Validators.Size(), len(evidence))
txs := blockExec.mempool.ReapMaxBytesMaxGas(maxDataBytes, maxGas)

return state.MakeBlock(height, txs, commit, evidence, proposerAddr)
Expand Down

0 comments on commit ef36b06

Please sign in to comment.