mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 11:20:45 +00:00
core: add accounts_deleted and storage_slots_deleted metrics
Add deletion metrics to slow block JSON output: - accounts_deleted: count of accounts destroyed (SELFDESTRUCT) - storage_slots_deleted: count of storage slots set to zero These metrics align with the cross-client test vectors for standardized execution metrics.
This commit is contained in:
parent
85a1e132a9
commit
690e526c30
1 changed files with 11 additions and 1 deletions
|
|
@ -185,7 +185,7 @@ func TestLogSlowBlockEIP7702(t *testing.T) {
|
|||
}
|
||||
block := types.NewBlockWithHeader(header)
|
||||
|
||||
// Create test stats with EIP-7702 delegation data
|
||||
// Create test stats with EIP-7702 delegation data and deletion metrics
|
||||
stats := &ExecuteStats{
|
||||
Execution: 500 * time.Millisecond,
|
||||
TotalTime: 1200 * time.Millisecond,
|
||||
|
|
@ -195,7 +195,9 @@ func TestLogSlowBlockEIP7702(t *testing.T) {
|
|||
CodeLoaded: 20,
|
||||
CodeBytesRead: 4096,
|
||||
AccountUpdated: 50,
|
||||
AccountDeleted: 2,
|
||||
StorageUpdated: 200,
|
||||
StorageDeleted: 7,
|
||||
CodeUpdated: 5,
|
||||
CodeBytesWrite: 2048,
|
||||
Eip7702DelegationsSet: 3,
|
||||
|
|
@ -241,6 +243,14 @@ func TestLogSlowBlockEIP7702(t *testing.T) {
|
|||
if logEntry.StateWrites.Code != 5 {
|
||||
t.Errorf("Expected code writes 5, got %d", logEntry.StateWrites.Code)
|
||||
}
|
||||
|
||||
// Verify deletion metrics
|
||||
if logEntry.StateWrites.AccountsDeleted != 2 {
|
||||
t.Errorf("Expected accounts_deleted 2, got %d", logEntry.StateWrites.AccountsDeleted)
|
||||
}
|
||||
if logEntry.StateWrites.StorageSlotsDeleted != 7 {
|
||||
t.Errorf("Expected storage_slots_deleted 7, got %d", logEntry.StateWrites.StorageSlotsDeleted)
|
||||
}
|
||||
}
|
||||
|
||||
// TestLogSlowBlockThreshold tests that logSlow respects the threshold.
|
||||
|
|
|
|||
Loading…
Reference in a new issue