From d509034fc9089f8c6c9a353a218ecbac30bdc6c0 Mon Sep 17 00:00:00 2001 From: marcello33 Date: Tue, 10 Dec 2024 08:58:30 +0100 Subject: [PATCH 1/3] chg: update version --- packaging/templates/package_scripts/control | 2 +- packaging/templates/package_scripts/control.arm64 | 2 +- packaging/templates/package_scripts/control.profile.amd64 | 2 +- packaging/templates/package_scripts/control.profile.arm64 | 2 +- packaging/templates/package_scripts/control.validator | 2 +- .../templates/package_scripts/control.validator.arm64 | 2 +- params/version.go | 8 ++++---- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packaging/templates/package_scripts/control b/packaging/templates/package_scripts/control index 9008ea5c32..302df7b253 100644 --- a/packaging/templates/package_scripts/control +++ b/packaging/templates/package_scripts/control @@ -1,5 +1,5 @@ Source: bor -Version: 1.5.2 +Version: 1.5.3-beta Section: develop Priority: standard Maintainer: Polygon diff --git a/packaging/templates/package_scripts/control.arm64 b/packaging/templates/package_scripts/control.arm64 index 9b67e9dc56..b33ddbbfa5 100644 --- a/packaging/templates/package_scripts/control.arm64 +++ b/packaging/templates/package_scripts/control.arm64 @@ -1,5 +1,5 @@ Source: bor -Version: 1.5.2 +Version: 1.5.3-beta Section: develop Priority: standard Maintainer: Polygon diff --git a/packaging/templates/package_scripts/control.profile.amd64 b/packaging/templates/package_scripts/control.profile.amd64 index 591848766f..77d4fa1589 100644 --- a/packaging/templates/package_scripts/control.profile.amd64 +++ b/packaging/templates/package_scripts/control.profile.amd64 @@ -1,5 +1,5 @@ Source: bor-profile -Version: 1.5.2 +Version: 1.5.3-beta Section: develop Priority: standard Maintainer: Polygon diff --git a/packaging/templates/package_scripts/control.profile.arm64 b/packaging/templates/package_scripts/control.profile.arm64 index 28c58b93a7..d44b33c2ea 100644 --- a/packaging/templates/package_scripts/control.profile.arm64 +++ b/packaging/templates/package_scripts/control.profile.arm64 @@ -1,5 +1,5 @@ Source: bor-profile -Version: 1.5.2 +Version: 1.5.3-beta Section: develop Priority: standard Maintainer: Polygon diff --git a/packaging/templates/package_scripts/control.validator b/packaging/templates/package_scripts/control.validator index 617c260911..296f2c9807 100644 --- a/packaging/templates/package_scripts/control.validator +++ b/packaging/templates/package_scripts/control.validator @@ -1,5 +1,5 @@ Source: bor-profile -Version: 1.5.2 +Version: 1.5.3-beta Section: develop Priority: standard Maintainer: Polygon diff --git a/packaging/templates/package_scripts/control.validator.arm64 b/packaging/templates/package_scripts/control.validator.arm64 index 8c22ec7920..4236ced085 100644 --- a/packaging/templates/package_scripts/control.validator.arm64 +++ b/packaging/templates/package_scripts/control.validator.arm64 @@ -1,5 +1,5 @@ Source: bor-profile -Version: 1.5.2 +Version: 1.5.3-beta Section: develop Priority: standard Maintainer: Polygon diff --git a/params/version.go b/params/version.go index a6a5e20046..46f5c399cb 100644 --- a/params/version.go +++ b/params/version.go @@ -21,10 +21,10 @@ import ( ) const ( - VersionMajor = 1 // Major version component of the current release - VersionMinor = 5 // Minor version component of the current release - VersionPatch = 2 // Patch version component of the current release - VersionMeta = "" // Version metadata to append to the version string + VersionMajor = 1 // Major version component of the current release + VersionMinor = 5 // Minor version component of the current release + VersionPatch = 3 // Patch version component of the current release + VersionMeta = "beta" // Version metadata to append to the version string ) var GitCommit string From 8f7533076ead5be034da537bc185934e14fcf6ee Mon Sep 17 00:00:00 2001 From: marcello33 Date: Wed, 11 Dec 2024 08:39:16 +0100 Subject: [PATCH 2/3] chg: bump stable version --- packaging/templates/package_scripts/control | 2 +- packaging/templates/package_scripts/control.arm64 | 2 +- packaging/templates/package_scripts/control.profile.amd64 | 2 +- packaging/templates/package_scripts/control.profile.arm64 | 2 +- packaging/templates/package_scripts/control.validator | 2 +- .../templates/package_scripts/control.validator.arm64 | 2 +- params/version.go | 8 ++++---- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packaging/templates/package_scripts/control b/packaging/templates/package_scripts/control index 302df7b253..90e6823dae 100644 --- a/packaging/templates/package_scripts/control +++ b/packaging/templates/package_scripts/control @@ -1,5 +1,5 @@ Source: bor -Version: 1.5.3-beta +Version: 1.5.3 Section: develop Priority: standard Maintainer: Polygon diff --git a/packaging/templates/package_scripts/control.arm64 b/packaging/templates/package_scripts/control.arm64 index b33ddbbfa5..6b964b276f 100644 --- a/packaging/templates/package_scripts/control.arm64 +++ b/packaging/templates/package_scripts/control.arm64 @@ -1,5 +1,5 @@ Source: bor -Version: 1.5.3-beta +Version: 1.5.3 Section: develop Priority: standard Maintainer: Polygon diff --git a/packaging/templates/package_scripts/control.profile.amd64 b/packaging/templates/package_scripts/control.profile.amd64 index 77d4fa1589..40ab62ac87 100644 --- a/packaging/templates/package_scripts/control.profile.amd64 +++ b/packaging/templates/package_scripts/control.profile.amd64 @@ -1,5 +1,5 @@ Source: bor-profile -Version: 1.5.3-beta +Version: 1.5.3 Section: develop Priority: standard Maintainer: Polygon diff --git a/packaging/templates/package_scripts/control.profile.arm64 b/packaging/templates/package_scripts/control.profile.arm64 index d44b33c2ea..16ec4c00ed 100644 --- a/packaging/templates/package_scripts/control.profile.arm64 +++ b/packaging/templates/package_scripts/control.profile.arm64 @@ -1,5 +1,5 @@ Source: bor-profile -Version: 1.5.3-beta +Version: 1.5.3 Section: develop Priority: standard Maintainer: Polygon diff --git a/packaging/templates/package_scripts/control.validator b/packaging/templates/package_scripts/control.validator index 296f2c9807..73a5c0fb3b 100644 --- a/packaging/templates/package_scripts/control.validator +++ b/packaging/templates/package_scripts/control.validator @@ -1,5 +1,5 @@ Source: bor-profile -Version: 1.5.3-beta +Version: 1.5.3 Section: develop Priority: standard Maintainer: Polygon diff --git a/packaging/templates/package_scripts/control.validator.arm64 b/packaging/templates/package_scripts/control.validator.arm64 index 4236ced085..d122a2328e 100644 --- a/packaging/templates/package_scripts/control.validator.arm64 +++ b/packaging/templates/package_scripts/control.validator.arm64 @@ -1,5 +1,5 @@ Source: bor-profile -Version: 1.5.3-beta +Version: 1.5.3 Section: develop Priority: standard Maintainer: Polygon diff --git a/params/version.go b/params/version.go index 46f5c399cb..3bd5d0572a 100644 --- a/params/version.go +++ b/params/version.go @@ -21,10 +21,10 @@ import ( ) const ( - VersionMajor = 1 // Major version component of the current release - VersionMinor = 5 // Minor version component of the current release - VersionPatch = 3 // Patch version component of the current release - VersionMeta = "beta" // Version metadata to append to the version string + VersionMajor = 1 // Major version component of the current release + VersionMinor = 5 // Minor version component of the current release + VersionPatch = 3 // Patch version component of the current release + VersionMeta = "" // Version metadata to append to the version string ) var GitCommit string From 6c75359553b044a87e9a7d10f801097de7f1b6e1 Mon Sep 17 00:00:00 2001 From: Jerry Date: Tue, 10 Dec 2024 05:26:47 -0800 Subject: [PATCH 3/3] Fix incorrect balance when CreateContract is used in block-stm (#1382) * Fix incorrect balance when CreateContract is used in block-stm * address CR comments --- core/state/statedb.go | 9 +++------ core/state/statedb_test.go | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/core/state/statedb.go b/core/state/statedb.go index e477651906..2ea0662ce0 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -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)) @@ -1095,9 +1094,6 @@ func (s *StateDB) createObject(addr common.Address) *stateObject { // consensus bug eventually. 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)) } // CreateContract is used whenever a contract is created. This may be preceded @@ -1107,13 +1103,14 @@ func (s *StateDB) CreateAccount(addr common.Address) { // correctly handle EIP-6780 'delete-in-same-transaction' logic. func (s *StateDB) CreateContract(addr common.Address) { obj := s.getStateObject(addr) + if obj != nil { + obj = s.mvRecordWritten(obj) + } if !obj.newContract { obj.newContract = true s.journal.append(createContractChange{account: addr}) } - // todo: @anshalshukla || @cffls - // Check the below MV Write, balance path change have been removed MVWrite(s, blockstm.NewAddressKey(addr)) } diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go index a514f7c9f4..9fe1cd9995 100644 --- a/core/state/statedb_test.go +++ b/core/state/statedb_test.go @@ -813,6 +813,33 @@ func TestMVHashMapReadWriteDelete(t *testing.T) { assert.Equal(t, uint256.NewInt(0), b) } +func TestMVHashMapCreateContract(t *testing.T) { + t.Parallel() + + db := NewDatabase(rawdb.NewMemoryDatabase()) + mvhm := blockstm.MakeMVHashMap() + s, _ := NewWithMVHashmap(common.Hash{}, db, nil, mvhm) + + states := []*StateDB{s} + + // Create copies of the original state for each transition + for i := 1; i <= 4; i++ { + sCopy := s.Copy() + sCopy.txIndex = i + states = append(states, sCopy) + } + + addr := common.HexToAddress("0x01") + states[0].SetBalance(addr, uint256.NewInt(100), tracing.BalanceChangeTransfer) + states[0].FlushMVWriteSet() + + states[1].CreateContract(addr) + states[1].FlushMVWriteSet() + + b := states[1].GetBalance(addr) + assert.Equal(t, uint256.NewInt(100), b) +} + func TestMVHashMapRevert(t *testing.T) { t.Parallel()