-
Notifications
You must be signed in to change notification settings - Fork 161
Conversation
Codecov Report
@@ Coverage Diff @@
## development #496 +/- ##
==============================================
Coverage ? 70.15%
==============================================
Files ? 38
Lines ? 2520
Branches ? 0
==============================================
Hits ? 1768
Misses ? 620
Partials ? 132 Continue to review full report at Codecov.
|
// remove from the slice | ||
s.stateObjects = append(s.stateObjects[:idx], s.stateObjects[idx+1:]...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we were deleting the object from the slice but we weren't deleting the item from the map nor updating the corresponding indexes of the other elements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is probably the fix for the issue yesterday, can remove the idx < len(csdb.stateObjects)
check in getStateObject
and setStateObject
in #458
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! let me add a few tests so that we can merge this to development
@@ -685,27 +693,29 @@ func (csdb *CommitStateDB) Copy() *CommitStateDB { | |||
ctx: csdb.ctx, | |||
storeKey: csdb.storeKey, | |||
accountKeeper: csdb.accountKeeper, | |||
stateObjects: make([]stateEntry, len(csdb.journal.dirties)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the length/capacity and replaced it with append
address: dirty.address, | ||
stateObject: csdb.stateObjects[idx].stateObject.deepCopy(state), | ||
} | ||
}) | ||
state.addressToObjectIndex[dirty.address] = len(state.stateObjects) - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the addressToObjectIndex
was not being updated either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why append should reduce by 1.
@@ -721,8 +731,9 @@ func (csdb *CommitStateDB) Copy() *CommitStateDB { | |||
} | |||
|
|||
// copy pre-images | |||
for hash, preimage := range csdb.preimages { | |||
state.preimages[hash] = preimage | |||
for i, preimageEntry := range csdb.preimages { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced to slice to prevent non-determinism
Closes: #XXX
Description
For contributor use:
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerFor admin use:
WIP
,R4R
,docs
, etc)