@@ -219,11 +219,11 @@ func NewDatabaseWithNodeDB(db ethdb.Database, triedb *trie.Database) Database {
219219}
220220
221221func (db * cachingDB ) InTransition () bool {
222- return db .CurrentTransitionState != nil && db .CurrentTransitionState .started && ! db .CurrentTransitionState .ended
222+ return db .CurrentTransitionState != nil && db .CurrentTransitionState .Started && ! db .CurrentTransitionState .Ended
223223}
224224
225225func (db * cachingDB ) Transitioned () bool {
226- return db .CurrentTransitionState != nil && db .CurrentTransitionState .ended
226+ return db .CurrentTransitionState != nil && db .CurrentTransitionState .Ended
227227}
228228
229229// Fork implements the fork
@@ -236,7 +236,7 @@ func (db *cachingDB) StartVerkleTransition(originalRoot, translatedRoot common.H
236236 |____| |___| /\___ \___ |____/\___ | __/|___| (____ |___| |__| |___| (____ /_____/ \/\_/ |__|___| /_____//_____/
237237 |__|` )
238238 db .CurrentTransitionState = & TransitionState {
239- started : true ,
239+ Started : true ,
240240 // initialize so that the first storage-less accounts are processed
241241 StorageProcessed : true ,
242242 }
@@ -255,15 +255,15 @@ func (db *cachingDB) ReorgThroughVerkleTransition() {
255255
256256func (db * cachingDB ) InitTransitionStatus (started , ended bool ) {
257257 db .CurrentTransitionState = & TransitionState {
258- ended : ended ,
259- started : started ,
258+ Ended : ended ,
259+ Started : started ,
260260 // TODO add other fields when we handle mid-transition interrupts
261261 }
262262}
263263
264264func (db * cachingDB ) EndVerkleTransition () {
265- if ! db .CurrentTransitionState .started {
266- db .CurrentTransitionState .started = true
265+ if ! db .CurrentTransitionState .Started {
266+ db .CurrentTransitionState .Started = true
267267 }
268268
269269 fmt .Println (`
@@ -273,14 +273,14 @@ func (db *cachingDB) EndVerkleTransition() {
273273 | | | Y \ ___/ \ ___/| |_\ ___/| |_> | Y \/ __ \| | | | | Y \/ __ \_\___ \ | |__/ __ \| | / /_/ \ ___// /_/ |
274274 |____| |___| /\___ \___ |____/\___ | __/|___| (____ |___| |__| |___| (____ /_____/ |____(____ |___| \____ |\___ \____ |
275275 |__|` )
276- db .CurrentTransitionState .ended = true
276+ db .CurrentTransitionState .Ended = true
277277}
278278
279279type TransitionState struct {
280280 CurrentAccountAddress * common.Address // addresss of the last translated account
281281 CurrentSlotHash common.Hash // hash of the last translated storage slot
282282 CurrentPreimageOffset int64 // next byte to read from the preimage file
283- started , ended bool
283+ Started , Ended bool
284284
285285 // Mark whether the storage for an account has been processed. This is useful if the
286286 // maximum number of leaves of the conversion is reached before the whole storage is
@@ -290,8 +290,8 @@ type TransitionState struct {
290290
291291func (ts * TransitionState ) Copy () * TransitionState {
292292 ret := & TransitionState {
293- started : ts .started ,
294- ended : ts .ended ,
293+ Started : ts .Started ,
294+ Ended : ts .Ended ,
295295 CurrentSlotHash : ts .CurrentSlotHash ,
296296 CurrentPreimageOffset : ts .CurrentPreimageOffset ,
297297 StorageProcessed : ts .StorageProcessed ,
@@ -334,14 +334,14 @@ func (db *cachingDB) openMPTTrie(root common.Hash) (Trie, error) {
334334func (db * cachingDB ) openVKTrie (root common.Hash ) (Trie , error ) {
335335 payload , err := db .DiskDB ().Get (trie .FlatDBVerkleNodeKeyPrefix )
336336 if err != nil {
337- return trie .NewVerkleTrie (verkle .New (), db .triedb , db .addrToPoint , db .CurrentTransitionState .ended ), nil
337+ return trie .NewVerkleTrie (verkle .New (), db .triedb , db .addrToPoint , db .CurrentTransitionState .Ended ), nil
338338 }
339339
340340 r , err := verkle .ParseNode (payload , 0 )
341341 if err != nil {
342342 panic (err )
343343 }
344- return trie .NewVerkleTrie (r , db .triedb , db .addrToPoint , db .CurrentTransitionState .ended ), err
344+ return trie .NewVerkleTrie (r , db .triedb , db .addrToPoint , db .CurrentTransitionState .Ended ), err
345345}
346346
347347// OpenTrie opens the main account trie at a specific root hash.
@@ -364,7 +364,7 @@ func (db *cachingDB) OpenTrie(root common.Hash) (Trie, error) {
364364
365365 // If the verkle conversion has ended, return a single
366366 // verkle trie.
367- if db .CurrentTransitionState .ended {
367+ if db .CurrentTransitionState .Ended {
368368 log .Debug ("transition ended, returning a simple verkle tree" )
369369 return vkt , nil
370370 }
@@ -572,7 +572,7 @@ func (db *cachingDB) SaveTransitionState(root common.Hash) {
572572 rawdb .WriteVerkleTransitionState (db .DiskDB (), root , buf .Bytes ())
573573 }
574574
575- log .Debug ("saving transition state" , "storage processed" , db .CurrentTransitionState .StorageProcessed , "addr" , db .CurrentTransitionState .CurrentAccountAddress , "slot hash" , db .CurrentTransitionState .CurrentSlotHash , "root" , root , "ended" , db .CurrentTransitionState .ended , "started" , db .CurrentTransitionState .started )
575+ log .Debug ("saving transition state" , "storage processed" , db .CurrentTransitionState .StorageProcessed , "addr" , db .CurrentTransitionState .CurrentAccountAddress , "slot hash" , db .CurrentTransitionState .CurrentSlotHash , "root" , root , "ended" , db .CurrentTransitionState .Ended , "started" , db .CurrentTransitionState .Started )
576576 }
577577}
578578
@@ -590,7 +590,7 @@ func (db *cachingDB) LoadTransitionState(root common.Hash) {
590590 return
591591 }
592592
593- // if a state could be read from the db, attempt to decode it
593+ // if a state could be read from the db, attempt to decode it
594594 if len (data ) > 0 {
595595 var (
596596 newts TransitionState
@@ -613,15 +613,15 @@ func (db *cachingDB) LoadTransitionState(root common.Hash) {
613613 // as a verkle database.
614614 log .Debug ("no transition state found, starting fresh" , "is verkle" , db .triedb .IsVerkle ())
615615 // Start with a fresh state
616- ts = & TransitionState {ended : db .triedb .IsVerkle ()}
616+ ts = & TransitionState {Ended : db .triedb .IsVerkle ()}
617617 }
618618 }
619619
620620 // Copy so that the CurrentAddress pointer in the map
621621 // doesn't get overwritten.
622622 db .CurrentTransitionState = ts .Copy ()
623623
624- log .Debug ("loaded transition state" , "storage processed" , db .CurrentTransitionState .StorageProcessed , "addr" , db .CurrentTransitionState .CurrentAccountAddress , "slot hash" , db .CurrentTransitionState .CurrentSlotHash , "root" , root , "ended" , db .CurrentTransitionState .ended , "started" , db .CurrentTransitionState .started )
624+ log .Debug ("loaded transition state" , "storage processed" , db .CurrentTransitionState .StorageProcessed , "addr" , db .CurrentTransitionState .CurrentAccountAddress , "slot hash" , db .CurrentTransitionState .CurrentSlotHash , "root" , root , "ended" , db .CurrentTransitionState .Ended , "started" , db .CurrentTransitionState .Started )
625625 debug .PrintStack ()
626626}
627627
0 commit comments