diff --git a/CHANGELOG.md b/CHANGELOG.md index 380cfa42220..9d1c5ab7ccb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ - Fixed: [#5627](https://github.com/ethereum/aleth/pull/5627) Correct testeth --help log output indentation. - Fixed: [#5644](https://github.com/ethereum/aleth/pull/5644) Avoid attempting to sync with disconnected peers. - Fixed: [#5647](https://github.com/ethereum/aleth/pull/5647) test_importRawBlock RPC method correctly fails in case of import failure. +- Fixed: [#5652](https://github.com/ethereum/aleth/pull/5652) Behavior in corner case tests about touching empty Precompiles now agrees with geth's results. ## [1.6.0] - 2019-04-16 diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 3a9f8e4d91a..6fb9519984c 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -36,6 +36,11 @@ using namespace dev; using namespace dev::eth; namespace fs = boost::filesystem; +namespace +{ +Address const c_RipemdPrecompiledAddress{0x03}; +} + State::State(u256 const& _accountStartNonce, OverlayDB const& _db, BaseState _bs): m_db(_db), m_state(&m_db), @@ -589,8 +594,16 @@ void State::rollback(size_t _savepoint) account.resetCode(); break; case Change::Touch: - account.untouch(); - m_unchangedCacheEntries.emplace_back(change.address); + // Empty RIPEMD contract needs to be deleted even in case of exception. + // This doesn't affect main net, but is needed for some consensus tests. + // https://github.com/ethereum/go-ethereum/pull/3341/files#diff-2433aa143ee4772026454b8abd76b9dd + // https://github.com/ethereum/EIPs/issues/716 + // https://github.com/ethereum/aleth/pull/5652 + if (change.address != c_RipemdPrecompiledAddress) + { + account.untouch(); + m_unchangedCacheEntries.emplace_back(change.address); + } break; } m_changeLog.pop_back(); diff --git a/test/jsontests b/test/jsontests index 5018b8f30e9..7da7d745b3c 160000 --- a/test/jsontests +++ b/test/jsontests @@ -1 +1 @@ -Subproject commit 5018b8f30e9e57a0d136ed40bc6ceab51b61e144 +Subproject commit 7da7d745b3cf0dbd944cf909a68bda293e6143c3