@@ -155,7 +155,7 @@ func pruneState(ctx *cli.Context) error {
155
155
chaindb := utils .MakeChainDatabase (ctx , stack , false )
156
156
pruner , err := pruner .NewPruner (chaindb , stack .ResolvePath ("" ), stack .ResolvePath (config .Eth .TrieCleanCacheJournal ), ctx .GlobalUint64 (utils .BloomFilterSizeFlag .Name ))
157
157
if err != nil {
158
- log .Error ("Failed to open snapshot tree" , "error " , err )
158
+ log .Error ("Failed to open snapshot tree" , "err " , err )
159
159
return err
160
160
}
161
161
if ctx .NArg () > 1 {
@@ -166,12 +166,12 @@ func pruneState(ctx *cli.Context) error {
166
166
if ctx .NArg () == 1 {
167
167
targetRoot , err = parseRoot (ctx .Args ()[0 ])
168
168
if err != nil {
169
- log .Error ("Failed to resolve state root" , "error " , err )
169
+ log .Error ("Failed to resolve state root" , "err " , err )
170
170
return err
171
171
}
172
172
}
173
173
if err = pruner .Prune (targetRoot ); err != nil {
174
- log .Error ("Failed to prune state" , "error " , err )
174
+ log .Error ("Failed to prune state" , "err " , err )
175
175
return err
176
176
}
177
177
return nil
@@ -189,7 +189,7 @@ func verifyState(ctx *cli.Context) error {
189
189
}
190
190
snaptree , err := snapshot .New (chaindb , trie .NewDatabase (chaindb ), 256 , headBlock .Root (), false , false , false )
191
191
if err != nil {
192
- log .Error ("Failed to open snapshot tree" , "error " , err )
192
+ log .Error ("Failed to open snapshot tree" , "err " , err )
193
193
return err
194
194
}
195
195
if ctx .NArg () > 1 {
@@ -200,15 +200,15 @@ func verifyState(ctx *cli.Context) error {
200
200
if ctx .NArg () == 1 {
201
201
root , err = parseRoot (ctx .Args ()[0 ])
202
202
if err != nil {
203
- log .Error ("Failed to resolve state root" , "error " , err )
203
+ log .Error ("Failed to resolve state root" , "err " , err )
204
204
return err
205
205
}
206
206
}
207
207
if err := snaptree .Verify (root ); err != nil {
208
- log .Error ("Failed to verfiy state" , "error " , err )
208
+ log .Error ("Failed to verfiy state" , "root" , root , "err " , err )
209
209
return err
210
210
}
211
- log .Info ("Verified the state" )
211
+ log .Info ("Verified the state" , "root" , root )
212
212
return nil
213
213
}
214
214
@@ -236,7 +236,7 @@ func traverseState(ctx *cli.Context) error {
236
236
if ctx .NArg () == 1 {
237
237
root , err = parseRoot (ctx .Args ()[0 ])
238
238
if err != nil {
239
- log .Error ("Failed to resolve state root" , "error " , err )
239
+ log .Error ("Failed to resolve state root" , "err " , err )
240
240
return err
241
241
}
242
242
log .Info ("Start traversing the state" , "root" , root )
@@ -247,7 +247,7 @@ func traverseState(ctx *cli.Context) error {
247
247
triedb := trie .NewDatabase (chaindb )
248
248
t , err := trie .NewSecure (root , triedb )
249
249
if err != nil {
250
- log .Error ("Failed to open trie" , "root" , root , "error " , err )
250
+ log .Error ("Failed to open trie" , "root" , root , "err " , err )
251
251
return err
252
252
}
253
253
var (
@@ -262,21 +262,21 @@ func traverseState(ctx *cli.Context) error {
262
262
accounts += 1
263
263
var acc state.Account
264
264
if err := rlp .DecodeBytes (accIter .Value , & acc ); err != nil {
265
- log .Error ("Invalid account encountered during traversal" , "error " , err )
265
+ log .Error ("Invalid account encountered during traversal" , "err " , err )
266
266
return err
267
267
}
268
268
if acc .Root != emptyRoot {
269
269
storageTrie , err := trie .NewSecure (acc .Root , triedb )
270
270
if err != nil {
271
- log .Error ("Failed to open storage trie" , "root" , acc .Root , "error " , err )
271
+ log .Error ("Failed to open storage trie" , "root" , acc .Root , "err " , err )
272
272
return err
273
273
}
274
274
storageIter := trie .NewIterator (storageTrie .NodeIterator (nil ))
275
275
for storageIter .Next () {
276
276
slots += 1
277
277
}
278
278
if storageIter .Err != nil {
279
- log .Error ("Failed to traverse storage trie" , "root" , acc .Root , "error " , storageIter .Err )
279
+ log .Error ("Failed to traverse storage trie" , "root" , acc .Root , "err " , storageIter .Err )
280
280
return storageIter .Err
281
281
}
282
282
}
@@ -294,7 +294,7 @@ func traverseState(ctx *cli.Context) error {
294
294
}
295
295
}
296
296
if accIter .Err != nil {
297
- log .Error ("Failed to traverse state trie" , "root" , root , "error " , accIter .Err )
297
+ log .Error ("Failed to traverse state trie" , "root" , root , "err " , accIter .Err )
298
298
return accIter .Err
299
299
}
300
300
log .Info ("State is complete" , "accounts" , accounts , "slots" , slots , "codes" , codes , "elapsed" , common .PrettyDuration (time .Since (start )))
@@ -326,7 +326,7 @@ func traverseRawState(ctx *cli.Context) error {
326
326
if ctx .NArg () == 1 {
327
327
root , err = parseRoot (ctx .Args ()[0 ])
328
328
if err != nil {
329
- log .Error ("Failed to resolve state root" , "error " , err )
329
+ log .Error ("Failed to resolve state root" , "err " , err )
330
330
return err
331
331
}
332
332
log .Info ("Start traversing the state" , "root" , root )
@@ -337,7 +337,7 @@ func traverseRawState(ctx *cli.Context) error {
337
337
triedb := trie .NewDatabase (chaindb )
338
338
t , err := trie .NewSecure (root , triedb )
339
339
if err != nil {
340
- log .Error ("Failed to open trie" , "root" , root , "error " , err )
340
+ log .Error ("Failed to open trie" , "root" , root , "err " , err )
341
341
return err
342
342
}
343
343
var (
@@ -368,13 +368,13 @@ func traverseRawState(ctx *cli.Context) error {
368
368
accounts += 1
369
369
var acc state.Account
370
370
if err := rlp .DecodeBytes (accIter .LeafBlob (), & acc ); err != nil {
371
- log .Error ("Invalid account encountered during traversal" , "error " , err )
371
+ log .Error ("Invalid account encountered during traversal" , "err " , err )
372
372
return errors .New ("invalid account" )
373
373
}
374
374
if acc .Root != emptyRoot {
375
375
storageTrie , err := trie .NewSecure (acc .Root , triedb )
376
376
if err != nil {
377
- log .Error ("Failed to open storage trie" , "root" , acc .Root , "error " , err )
377
+ log .Error ("Failed to open storage trie" , "root" , acc .Root , "err " , err )
378
378
return errors .New ("missing storage trie" )
379
379
}
380
380
storageIter := storageTrie .NodeIterator (nil )
@@ -397,7 +397,7 @@ func traverseRawState(ctx *cli.Context) error {
397
397
}
398
398
}
399
399
if storageIter .Error () != nil {
400
- log .Error ("Failed to traverse storage trie" , "root" , acc .Root , "error " , storageIter .Error ())
400
+ log .Error ("Failed to traverse storage trie" , "root" , acc .Root , "err " , storageIter .Error ())
401
401
return storageIter .Error ()
402
402
}
403
403
}
@@ -416,7 +416,7 @@ func traverseRawState(ctx *cli.Context) error {
416
416
}
417
417
}
418
418
if accIter .Error () != nil {
419
- log .Error ("Failed to traverse state trie" , "root" , root , "error " , accIter .Error ())
419
+ log .Error ("Failed to traverse state trie" , "root" , root , "err " , accIter .Error ())
420
420
return accIter .Error ()
421
421
}
422
422
log .Info ("State is complete" , "nodes" , nodes , "accounts" , accounts , "slots" , slots , "codes" , codes , "elapsed" , common .PrettyDuration (time .Since (start )))
0 commit comments