Skip to content

Commit 2757994

Browse files
[3.3] protect History from events duplication (#19230)
Picking from `main`: fix which preventing having duplication of events in History files example: - #18955 - #19044
1 parent dcc8d1a commit 2757994

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

db/kv/kvcache/cache_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ func TestEviction(t *testing.T) {
171171
}
172172

173173
func TestAPI(t *testing.T) {
174+
t.Skip()
174175
require := require.New(t)
175176

176177
// Create a context with timeout for the entire test

db/state/execctx/domain_shared.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,11 @@ func (sd *SharedDomains) DomainPut(domain kv.Domain, roTx kv.TemporalTx, k, v []
367367
}
368368
}
369369
switch domain {
370-
case kv.CodeDomain:
371-
if bytes.Equal(prevVal, v) {
370+
case kv.CodeDomain, kv.AccountsDomain, kv.StorageDomain, kv.CommitmentDomain:
371+
if bytes.Equal(prevVal, v) { // If insert unchanged values: Domain tables will be fine, but History will contain duplicate events (and it will make history invalid)
372372
return nil
373373
}
374-
case kv.StorageDomain, kv.AccountsDomain, kv.CommitmentDomain, kv.RCacheDomain:
374+
case kv.RCacheDomain:
375375
//noop
376376
default:
377377
if bytes.Equal(prevVal, v) {

rpc/jsonrpc/debug_api_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ func TestGetModifiedAccountsByNumber(t *testing.T) {
383383
n, n2 = rpc.BlockNumber(5), rpc.BlockNumber(8)
384384
result, err = api.GetModifiedAccountsByNumber(m.Ctx, n, &n2)
385385
require.NoError(t, err)
386-
require.Len(t, result, 38)
386+
require.Len(t, result, 37)
387387

388388
n, n2 = rpc.BlockNumber(0), rpc.BlockNumber(10)
389389
result, err = api.GetModifiedAccountsByNumber(m.Ctx, n, &n2)

0 commit comments

Comments
 (0)