@@ -93,14 +93,14 @@ func (v *BlockValidator) ValidateBlock(block *types.Block) error {
93
93
// Verify UncleHash before running other uncle validations
94
94
unclesSha := types .CalcUncleHash (block .Uncles ())
95
95
if unclesSha != header .UncleHash {
96
- return fmt .Errorf ("invalid uncles root hash. received= %x calculated=%x " , header .UncleHash , unclesSha )
96
+ return fmt .Errorf ("invalid uncles root hash (remote: %x local: %x) " , header .UncleHash , unclesSha )
97
97
}
98
98
99
99
// The transactions Trie's root (R = (Tr [[i, RLP(T1)], [i, RLP(T2)], ... [n, RLP(Tn)]]))
100
100
// can be used by light clients to make sure they've received the correct Txs
101
101
txSha := types .DeriveSha (block .Transactions ())
102
102
if txSha != header .TxHash {
103
- return fmt .Errorf ("invalid transaction root hash. received= %x calculated=%x " , header .TxHash , txSha )
103
+ return fmt .Errorf ("invalid transaction root hash (remote: %x local: %x) " , header .TxHash , txSha )
104
104
}
105
105
106
106
return nil
@@ -113,23 +113,23 @@ func (v *BlockValidator) ValidateBlock(block *types.Block) error {
113
113
func (v * BlockValidator ) ValidateState (block , parent * types.Block , statedb * state.StateDB , receipts types.Receipts , usedGas * big.Int ) (err error ) {
114
114
header := block .Header ()
115
115
if block .GasUsed ().Cmp (usedGas ) != 0 {
116
- return ValidationError (fmt .Sprintf ("gas used error ( %v / %v)" , block .GasUsed (), usedGas ))
116
+ return ValidationError (fmt .Sprintf ("invalid gas used (remote: %v local: %v)" , block .GasUsed (), usedGas ))
117
117
}
118
118
// Validate the received block's bloom with the one derived from the generated receipts.
119
119
// For valid blocks this should always validate to true.
120
120
rbloom := types .CreateBloom (receipts )
121
121
if rbloom != header .Bloom {
122
- return fmt .Errorf ("unable to replicate block's bloom= %x vs calculated bloom=%x " , header .Bloom , rbloom )
122
+ return fmt .Errorf ("invalid bloom (remote: %x local: %x) " , header .Bloom , rbloom )
123
123
}
124
124
// Tre receipt Trie's root (R = (Tr [[H1, R1], ... [Hn, R1]]))
125
125
receiptSha := types .DeriveSha (receipts )
126
126
if receiptSha != header .ReceiptHash {
127
- return fmt .Errorf ("invalid receipt root hash. received= %x calculated=%x " , header .ReceiptHash , receiptSha )
127
+ return fmt .Errorf ("invalid receipt root hash (remote: %x local: %x) " , header .ReceiptHash , receiptSha )
128
128
}
129
129
// Validate the state root against the received state root and throw
130
130
// an error if they don't match.
131
131
if root := statedb .IntermediateRoot (v .config .IsEIP158 (header .Number )); header .Root != root {
132
- return fmt .Errorf ("invalid merkle root: header= %x computed=%x " , header .Root , root )
132
+ return fmt .Errorf ("invalid merkle root (remote: %x local: %x) " , header .Root , root )
133
133
}
134
134
return nil
135
135
}
@@ -223,7 +223,7 @@ func ValidateHeader(config *params.ChainConfig, pow pow.PoW, header *types.Heade
223
223
224
224
expd := CalcDifficulty (config , header .Time .Uint64 (), parent .Time .Uint64 (), parent .Number , parent .Difficulty )
225
225
if expd .Cmp (header .Difficulty ) != 0 {
226
- return fmt .Errorf ("Difficulty check failed for header %v, %v " , header .Difficulty , expd )
226
+ return fmt .Errorf ("Difficulty check failed for header (remote: %v local: %v) " , header .Difficulty , expd )
227
227
}
228
228
229
229
a := new (big.Int ).Set (parent .GasLimit )
@@ -232,7 +232,7 @@ func ValidateHeader(config *params.ChainConfig, pow pow.PoW, header *types.Heade
232
232
b := new (big.Int ).Set (parent .GasLimit )
233
233
b = b .Div (b , params .GasLimitBoundDivisor )
234
234
if ! (a .Cmp (b ) < 0 ) || (header .GasLimit .Cmp (params .MinGasLimit ) == - 1 ) {
235
- return fmt .Errorf ("GasLimit check failed for header %v ( %v > %v)" , header .GasLimit , a , b )
235
+ return fmt .Errorf ("GasLimit check failed for header (remote: %v local_max: %v)" , header .GasLimit , b )
236
236
}
237
237
238
238
num := new (big.Int ).Set (parent .Number )
0 commit comments