Skip to content

Commit

Permalink
try another fix
Browse files Browse the repository at this point in the history
  • Loading branch information
manav2401 committed Dec 2, 2024
1 parent 5aef538 commit af6c630
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,6 @@ func (s *StateDB) ApplyMVWriteSet(writes []blockstm.WriteDescriptor) {

switch path.GetSubpath() {
case BalancePath:
// todo: @anshalshukla || @cffls - check balance change reason
s.SetBalance(addr, sr.GetBalance(addr), tracing.BalanceChangeUnspecified)
case NoncePath:
s.SetNonce(addr, sr.GetNonce(addr))
Expand Down Expand Up @@ -1082,6 +1081,10 @@ func (s *StateDB) mvRecordWritten(object *stateObject) *stateObject {
// createObject creates a new state object. The assumption is held there is no
// existing account with the given address, otherwise it will be silently overwritten.
func (s *StateDB) createObject(addr common.Address) *stateObject {
prev := s.getStateObject(addr)
if prev != nil {
MVWrite(s, blockstm.NewSubpathKey(addr, BalancePath))
}
obj := newObject(s, addr, nil)
s.journal.append(createObjectChange{account: &addr})
s.setStateObject(obj)
Expand All @@ -1097,7 +1100,7 @@ func (s *StateDB) CreateAccount(addr common.Address) {
s.createObject(addr)
// todo: @anshalshukla || @cffls
// Check the below MV Write, balance path change have been removed
MVWrite(s, blockstm.NewAddressKey(addr))
// MVWrite(s, blockstm.NewAddressKey(addr))
}

// CreateContract is used whenever a contract is created. This may be preceded
Expand Down

0 comments on commit af6c630

Please sign in to comment.