Skip to content

Commit

Permalink
fix(trace): use correct roots in trace of block with one transaction (#…
Browse files Browse the repository at this point in the history
…508)

fix: use correct roots in trace of block with one transaction
  • Loading branch information
Thegaram committed Sep 11, 2023
1 parent 1d824f4 commit 9c1433b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/rawdb/accessors_skipped_txs.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type SkippedTransaction struct {
// BlockNumber is the number of the block in which this transaction was skipped.
BlockNumber uint64

// BlockNumber is the hash of the block in which this transaction was skipped or nil.
// BlockHash is the hash of the block in which this transaction was skipped or nil.
BlockHash *common.Hash
}

Expand All @@ -80,7 +80,7 @@ type SkippedTransactionV2 struct {
// BlockNumber is the number of the block in which this transaction was skipped.
BlockNumber uint64

// BlockNumber is the hash of the block in which this transaction was skipped or nil.
// BlockHash is the hash of the block in which this transaction was skipped or nil.
BlockHash *common.Hash
}

Expand Down
3 changes: 2 additions & 1 deletion core/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ func (env *TraceEnv) getTxResult(state *state.StateDB, index int, block *types.B
// still we have no state root for per tx, only set the head and tail
if index == 0 {
txStorageTrace.RootBefore = state.GetRootHash()
} else if index == len(block.Transactions())-1 {
}
if index == len(block.Transactions())-1 {
txStorageTrace.RootAfter = block.Root()
}

Expand Down
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
const (
VersionMajor = 4 // Major version component of the current release
VersionMinor = 4 // Minor version component of the current release
VersionPatch = 4 // Patch version component of the current release
VersionPatch = 5 // Patch version component of the current release
VersionMeta = "sepolia" // Version metadata to append to the version string
)

Expand Down

0 comments on commit 9c1433b

Please sign in to comment.