I observed a recent change in behavior for the in-memory database. For commit 63b1802 the following piece of code produces a different outcome than in older versions (e.g., 396f1dd8):
db := rawdb.NewMemoryDatabase()
sdb, _ = state.New(common.Hash{}, state.NewDatabase(db))
addr := common.HexToAddress("0xaffeaffeaffeaffeaffeaffeaffeaffeaffeaffe")
sdb.SetBalance(addr, big.NewInt(42))
fmt.Printf("balance: %v\n", sdb.GetBalance(addr))
nsdb := sdb.Copy()
nsdb.Commit(false)
cnsdb := nsdb.Copy()
fmt.Printf("balance: %v\n", cnsdb.GetBalance(addr))
This looks like a possible regression.
System information
OS & Version: Windows
Commit hash : 63b1802
Expected behaviour
The code should probably print the following:
Actual behaviour
The code prints the following:
Steps to reproduce the behaviour
Run the piece of code above.