Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change list of Silei/v0.33.2 #19

Open
wants to merge 34 commits into
base: tendermint/v0.33.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c8b84f0
apply the changset
Jul 23, 2019
f867ede
fix compatibility problems
Jul 23, 2019
51cdbb6
Merge pull request #6 from cjqpker/0.32.1
wukongcheng Jul 23, 2019
54b7925
set variable DefaultEvent exported
Tri-stone Jul 25, 2019
1779f2f
Merge pull request #7 from Tri-stone/silei/v0.32.1
wukongcheng Jul 25, 2019
22d926c
allow reap blocks
Jul 25, 2019
265fcfc
Merge pull request #8 from cjqpker/0.32.1
wukongcheng Jul 25, 2019
b34ce37
debug mempool
Aug 12, 2019
aa7d747
add txs into abci beginblock
Aug 13, 2019
61d86f1
Merge pull request #9 from cjqpker/0.32.1
wukongcheng Aug 13, 2019
5cd92bc
Merge pull request #10 from wukongcheng/silei/v0.32.1
wukongcheng Aug 13, 2019
6bf7629
debug mempool
Aug 13, 2019
2882f35
Merge branch 'silei/mempool' of https://github.com/wukongcheng/tender…
Aug 13, 2019
488460e
change some default params and don't checktx() when recieve from othe…
Aug 14, 2019
d14f2c2
Merge pull request #11 from wukongcheng/silei/mempool
wukongcheng Aug 16, 2019
0c7b6af
modify nodekey
Aug 26, 2019
a7dbf0f
Merge pull request #12 from cjqpker/silei/v0.32.1
wukongcheng Aug 26, 2019
e5fad72
default param optimization
Sep 5, 2019
23bb282
Merge pull request #15 from cjqpker/silei/v0.32.1
wukongcheng Sep 5, 2019
e684766
func to get all tags
Nov 1, 2019
f0925c1
Merge branch 'silei/v0.32.1' of https://github.com/wukongcheng/tender…
Nov 1, 2019
6f2ba62
tx_search rpc desc
Nov 4, 2019
4baef02
Merge pull request #16 from preminem/silei/v0.32.1
wukongcheng Nov 4, 2019
89f0d3a
Not checkout peer filter for the outbounding addPeer
Dec 25, 2019
08f5aff
P2P: Remove deleted peers after commit
Dec 26, 2019
ae431a3
P2P: Remove deleted peers after commit
Dec 26, 2019
0be442e
Merge pull request #17 from preminem/xiaohe/v0.32.1
wukongcheng Dec 26, 2019
f9b7fd8
Merge pull request #1 from wukongcheng/silei/v0.32.1
Tri-stone Jan 7, 2020
1e4a7f5
set http server's maxBodyBytes 32MB
Tri-stone Jan 7, 2020
ffe00e3
Merge pull request #18 from Tri-stone/silei/v0.32.1
wukongcheng Jan 7, 2020
a6f22ae
Merge branch 'silei/v0.32.1' of https://github.com/wukongcheng/tender…
Mar 24, 2020
c787a30
Merge branch 'silei/v0.32.1' of https://github.com/wukongcheng/tender…
Mar 24, 2020
eaa1658
update colors
Mar 25, 2020
c5bdcb3
Merge branch 'silei/v0.33.2' of https://github.com/wukongcheng/tender…
Mar 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 52 additions & 8 deletions abci/types/types.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions abci/types/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ message RequestBeginBlock {
Header header = 2 [(gogoproto.nullable) = false];
LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false];
repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false];
repeated bytes txs = 5;
}

enum CheckTxType {
Expand Down Expand Up @@ -186,10 +187,20 @@ message ResponseCheckTx {
string codespace = 8;
}

message VMEvent {
bytes address = 1;
bytes data = 2;
repeated bytes topics = 3;
uint64 block_number = 4;
bytes tx_hash = 5;
bytes block_hash = 6;
}

message ResponseDeliverTx {
uint32 code = 1;
bytes data = 2;
string log = 3; // nondeterministic
repeated VMEvent vmevents = 9;
string info = 4; // nondeterministic
int64 gas_wanted = 5;
int64 gas_used = 6;
Expand Down
52 changes: 52 additions & 0 deletions abci/types/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ package types
import (
"bytes"
"sort"
"github.com/tendermint/tendermint/libs/kv"
)

const (
DefaultEvent = "origin-tags"
)

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -32,3 +37,50 @@ func (v ValidatorUpdates) Swap(i, j int) {
v[i] = v[j]
v[j] = v1
}

func GetTagByKey(events []Event, key string) (kv.Pair, bool) {
for _, event := range events {
if event.GetType() != DefaultEvent {
continue
}
for _, tag := range event.Attributes {
if bytes.Equal(tag.Key, []byte(key)) {
return tag, true
}
}
}

return kv.Pair{}, false
}

func TagsToDefaultEvent(events []Event, tags ...kv.Pair) []Event {
if len(events) == 0 {
events = append(events, Event{Type: DefaultEvent})
}
for i, v := range events {
if v.Type == DefaultEvent {
events[i].Attributes = append(events[i].Attributes, tags...)
}
}
return events
}

func GetDefaultTags(events []Event) []kv.Pair {
for _, v := range events {
if v.Type == DefaultEvent {
pairs := make([]kv.Pair, len(v.Attributes))
copy(pairs, v.Attributes)
return pairs
}
}
return nil
}

func GetAllTags(events []Event) (pairs []kv.Pair) {
for _, v := range events {
ps := make([]kv.Pair, len(v.Attributes))
copy(ps, v.Attributes)
pairs = append(pairs, ps...)
}
return pairs
}
2 changes: 1 addition & 1 deletion blockchain/v0/reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ FOR_LOOP:
bcR.pool.PopRequest()

// TODO: batch saves so we dont persist to disk every block
bcR.store.SaveBlock(first, firstParts, second.LastCommit)
bcR.store.SaveBlock(first, firstParts, second.LastCommit, true)

// TODO: same thing for app - but we would need a way to
// get the hash without persisting the state
Expand Down
2 changes: 1 addition & 1 deletion blockchain/v1/reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ func (bcR *BlockchainReactor) processBlock() error {
return errBlockVerificationFailure
}

bcR.store.SaveBlock(first, firstParts, second.LastCommit)
bcR.store.SaveBlock(first, firstParts, second.LastCommit, true)

bcR.state, err = bcR.blockExec.ApplyBlock(bcR.state, firstID, first)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions cmd/tendermint/commands/run_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ func AddNodeFlags(cmd *cobra.Command) {
[]byte{},
"Optional SHA-256 hash of the genesis file")

cmd.Flags().Bool("deprecated", config.Deprecated, "Mark blockchain as deprecated")
cmd.Flags().Int64("replay_height", config.ReplayHeight, "Specify which height to replay to, this is useful for exporting at any height")

// abci flags
cmd.Flags().String(
"proxy_app",
Expand Down
21 changes: 15 additions & 6 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ type BaseConfig struct { //nolint: maligned
// and verifying their commits
FastSyncMode bool `mapstructure:"fast_sync"`

// If the blockchain is deprecated, run node with Deprecated will
// work in query only mode. Consensus engine and p2p gossip will be
// shutdown
Deprecated bool `mapstructure:"deprecated"`

ReplayHeight int64 `mapstructure:"replay_height"`

// Database backend: goleveldb | cleveldb | boltdb | rocksdb
// * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
// - pure go
Expand Down Expand Up @@ -211,7 +218,7 @@ type BaseConfig struct { //nolint: maligned

// If true, query the ABCI app on connecting to a new peer
// so the app can decide if we should keep the connection or not
FilterPeers bool `mapstructure:"filter_peers"` // false
// FilterPeers bool `mapstructure:"filter_peers"` // false
}

// DefaultBaseConfig returns a default base configuration for a Tendermint node
Expand All @@ -228,7 +235,9 @@ func DefaultBaseConfig() BaseConfig {
LogFormat: LogFormatPlain,
ProfListenAddress: "",
FastSyncMode: true,
FilterPeers: false,
//FilterPeers: false,
Deprecated: false,
ReplayHeight: -1,
DBBackend: "goleveldb",
DBPath: "data",
}
Expand Down Expand Up @@ -660,14 +669,14 @@ type MempoolConfig struct {
// DefaultMempoolConfig returns a default configuration for the Tendermint mempool
func DefaultMempoolConfig() *MempoolConfig {
return &MempoolConfig{
Recheck: true,
Recheck: false,
Broadcast: true,
WalPath: "",
// Each signature verification takes .5ms, Size reduced until we implement
// ABCI Recheck
Size: 5000,
Size: 20000,
MaxTxsBytes: 1024 * 1024 * 1024, // 1GB
CacheSize: 10000,
CacheSize: 20000,
MaxTxBytes: 1024 * 1024, // 1MB
}
}
Expand Down Expand Up @@ -773,7 +782,7 @@ type ConsensusConfig struct {
func DefaultConsensusConfig() *ConsensusConfig {
return &ConsensusConfig{
WalPath: filepath.Join(defaultDataDir, "cs.wal", "wal"),
TimeoutPropose: 3000 * time.Millisecond,
TimeoutPropose: 1000 * time.Millisecond,
TimeoutProposeDelta: 500 * time.Millisecond,
TimeoutPrevote: 1000 * time.Millisecond,
TimeoutPrevoteDelta: 500 * time.Millisecond,
Expand Down
9 changes: 5 additions & 4 deletions config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ moniker = "{{ .BaseConfig.Moniker }}"
# and verifying their commits
fast_sync = {{ .BaseConfig.FastSyncMode }}

# If the blockchain is deprecated, run node with Deprecated will
# work in query only mode. Consensus engine and p2p gossip will be
# shutdown
deprecated = {{ .BaseConfig.Deprecated }}

# Database backend: goleveldb | cleveldb | boltdb | rocksdb
# * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
# - pure go
Expand Down Expand Up @@ -137,10 +142,6 @@ abci = "{{ .BaseConfig.ABCI }}"
# TCP or UNIX socket address for the profiling server to listen on
prof_laddr = "{{ .BaseConfig.ProfListenAddress }}"

# If true, query the ABCI app on connecting to a new peer
# so the app can decide if we should keep the connection or not
filter_peers = {{ .BaseConfig.FilterPeers }}

##### advanced configuration options #####

##### rpc server configuration options #####
Expand Down
Loading