From 39d72d581144b1b98487b012ec6b7255c5839c50 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Sun, 3 Apr 2016 04:51:44 -0700 Subject: [PATCH] Remove fees --- consensus/replay_test.go | 20 ++++++++++++-------- consensus/state.go | 1 - types/block.go | 6 +----- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/consensus/replay_test.go b/consensus/replay_test.go index 133d92b95..40ec34ca8 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -10,6 +10,10 @@ import ( ) /* + The easiest way to generate this data is to copy ~/.tendermint_test/somedir/* to ~/.tendermint + and to run a local node. + Be sure to set the db to "leveldb" to create a cswal file in ~/.tendermint/data/cswal. + If you need to change the signatures, you can use a script as follows: The privBytes comes from config/tendermint_test/... @@ -41,14 +45,14 @@ import ( ``` */ -var testLog = `{"time":"2016-01-18T20:46:00.774Z","msg":[3,{"duration":982632969,"height":1,"round":0,"step":1}]} -{"time":"2016-01-18T20:46:00.776Z","msg":[1,{"height":1,"round":0,"step":"RoundStepPropose"}]} -{"time":"2016-01-18T20:46:00.776Z","msg":[2,{"msg":[17,{"Proposal":{"height":1,"round":0,"block_parts_header":{"total":1,"hash":"B6227255FF20758326B0B7DFF529F20E33E58F45"},"pol_round":-1,"signature":"A1803A1364F6398C154FE45D5649A89129039F18A0FE42B211BADFDF6E81EA53F48F83D3610DDD848C3A5284D3F09BDEB26FA1D856BDF70D48C507BF2453A70E"}}],"peer_key":""}]} -{"time":"2016-01-18T20:46:00.777Z","msg":[2,{"msg":[19,{"Height":1,"Round":0,"Part":{"index":0,"bytes":"0101010F74656E6465726D696E745F746573740101142AA030B15DDFC000000000000000000000000000000114C4B01D3810579550997AC5641E759E20D99B51C10001000100","proof":{"aunts":[]}}}],"peer_key":""}]} -{"time":"2016-01-18T20:46:00.781Z","msg":[1,{"height":1,"round":0,"step":"RoundStepPrevote"}]} -{"time":"2016-01-18T20:46:00.781Z","msg":[2,{"msg":[20,{"ValidatorIndex":0,"Vote":{"height":1,"round":0,"type":1,"block_hash":"BE5D799C8F50D5FE8536C4392FDC8E7B3B180768","block_parts_header":{"total":1,"hash":"B6227255FF20758326B0B7DFF529F20E33E58F45"},"signature":"A63A15D9155C6C97762E65559E8CD34D853ED5FE22DA8540519453F9B7BE23C9287110929EDAA430DA30183768C60D4CF2811128C9D2E4B6A173EFE28FB54F05"}}],"peer_key":""}]} -{"time":"2016-01-18T20:46:00.786Z","msg":[1,{"height":1,"round":0,"step":"RoundStepPrecommit"}]} -{"time":"2016-01-18T20:46:00.786Z","msg":[2,{"msg":[20,{"ValidatorIndex":0,"Vote":{"height":1,"round":0,"type":2,"block_hash":"BE5D799C8F50D5FE8536C4392FDC8E7B3B180768","block_parts_header":{"total":1,"hash":"B6227255FF20758326B0B7DFF529F20E33E58F45"},"signature":"7190035C558F7173946581E6121E1EEB6EE91F03F04F2858FD5CBDAC006521FDC50366ED920B69C7357D9EF7621F9578F00E5350757CBC0AE6D441C39170CC07"}}],"peer_key":""}]} +var testLog = `{"time":"2016-04-03T11:23:54.387Z","msg":[3,{"duration":972835254,"height":1,"round":0,"step":1}]} +{"time":"2016-04-03T11:23:54.388Z","msg":[1,{"height":1,"round":0,"step":"RoundStepPropose"}]} +{"time":"2016-04-03T11:23:54.388Z","msg":[2,{"msg":[17,{"Proposal":{"height":1,"round":0,"block_parts_header":{"total":1,"hash":"3BA1E90CB868DA6B4FD7F3589826EC461E9EB4EF"},"pol_round":-1,"signature":"3A2ECD5023B21EC144EC16CFF1B992A4321317B83EEDD8969FDFEA6EB7BF4389F38DDA3E7BB109D63A07491C16277A197B241CF1F05F5E485C59882ECACD9E07"}}],"peer_key":""}]} +{"time":"2016-04-03T11:23:54.389Z","msg":[2,{"msg":[19,{"Height":1,"Round":0,"Part":{"index":0,"bytes":"0101010F74656E6465726D696E745F7465737401011441D59F4B718AC00000000000000114C4B01D3810579550997AC5641E759E20D99B51C10001000100","proof":{"aunts":[]}}}],"peer_key":""}]} +{"time":"2016-04-03T11:23:54.390Z","msg":[1,{"height":1,"round":0,"step":"RoundStepPrevote"}]} +{"time":"2016-04-03T11:23:54.390Z","msg":[2,{"msg":[20,{"ValidatorIndex":0,"Vote":{"height":1,"round":0,"type":1,"block_hash":"4291966B8A9DFBA00AEC7C700F2718E61DF4331D","block_parts_header":{"total":1,"hash":"3BA1E90CB868DA6B4FD7F3589826EC461E9EB4EF"},"signature":"47D2A75A4E2F15DB1F0D1B656AC0637AF9AADDFEB6A156874F6553C73895E5D5DC948DBAEF15E61276C5342D0E638DFCB77C971CD282096EA8735A564A90F008"}}],"peer_key":""}]} +{"time":"2016-04-03T11:23:54.392Z","msg":[1,{"height":1,"round":0,"step":"RoundStepPrecommit"}]} +{"time":"2016-04-03T11:23:54.392Z","msg":[2,{"msg":[20,{"ValidatorIndex":0,"Vote":{"height":1,"round":0,"type":2,"block_hash":"4291966B8A9DFBA00AEC7C700F2718E61DF4331D","block_parts_header":{"total":1,"hash":"3BA1E90CB868DA6B4FD7F3589826EC461E9EB4EF"},"signature":"39147DA595F08B73CF8C899967C8403B5872FD9042FFA4E239159E0B6C5D9665C9CA81D766EACA2AE658872F94C2FCD1E34BF51859CD5B274DA8512BACE4B50D"}}],"peer_key":""}]} ` func TestReplayCatchup(t *testing.T) { diff --git a/consensus/state.go b/consensus/state.go index 51d0f7b61..aafef7ec0 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -885,7 +885,6 @@ func (cs *ConsensusState) createProposalBlock() (block *types.Block, blockParts ChainID: cs.state.ChainID, Height: cs.Height, Time: time.Now(), - Fees: 0, // TODO fees NumTxs: len(txs), LastBlockHash: cs.state.LastBlockHash, LastBlockParts: cs.state.LastBlockParts, diff --git a/types/block.go b/types/block.go index 45640908f..1e197c621 100644 --- a/types/block.go +++ b/types/block.go @@ -36,7 +36,6 @@ func (b *Block) ValidateBasic(chainID string, lastBlockHeight int, lastBlockHash return errors.New("Invalid Block.Header.Time") } */ - // TODO: validate Fees if b.NumTxs != len(b.Data.Txs) { return errors.New(Fmt("Wrong Block.Header.NumTxs. Expected %v, got %v", len(b.Data.Txs), b.NumTxs)) } @@ -76,6 +75,7 @@ func (b *Block) FillHeader() { // Computes and returns the block hash. // If the block is incomplete, block hash is nil for safety. func (b *Block) Hash() []byte { + fmt.Println(">>", b.Data) if b.Header == nil || b.Data == nil || b.LastCommit == nil { return nil } @@ -133,7 +133,6 @@ type Header struct { ChainID string `json:"chain_id"` Height int `json:"height"` Time time.Time `json:"time"` - Fees int64 `json:"fees"` NumTxs int `json:"num_txs"` LastBlockHash []byte `json:"last_block_hash"` LastBlockParts PartSetHeader `json:"last_block_parts"` @@ -152,7 +151,6 @@ func (h *Header) Hash() []byte { "ChainID": h.ChainID, "Height": h.Height, "Time": h.Time, - "Fees": h.Fees, "NumTxs": h.NumTxs, "LastBlock": h.LastBlockHash, "LastBlockParts": h.LastBlockParts, @@ -171,7 +169,6 @@ func (h *Header) StringIndented(indent string) string { %s ChainID: %v %s Height: %v %s Time: %v -%s Fees: %v %s NumTxs: %v %s LastBlock: %X %s LastBlockParts: %v @@ -183,7 +180,6 @@ func (h *Header) StringIndented(indent string) string { indent, h.ChainID, indent, h.Height, indent, h.Time, - indent, h.Fees, indent, h.NumTxs, indent, h.LastBlockHash, indent, h.LastBlockParts,