Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supply delta live tracer #29347

Merged
merged 30 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c686e30
add BalanceChangeReason String() for better logging
ziogaschr Mar 26, 2024
a4117a8
add supply delta live tracer
ziogaschr Mar 26, 2024
55a9f40
change `[]byte` to `json.RawMessage` in test
ziogaschr Mar 26, 2024
5db2083
fix temp path on Windows by converting backslashes to slashes
ziogaschr Mar 27, 2024
bc983e2
allow test to use different file for tracer output
ziogaschr Mar 27, 2024
3a6cf0a
Revert "allow test to use different file for tracer output"
s1na Mar 27, 2024
53f6152
try alternative tempdir
s1na Mar 27, 2024
9e21e2d
use stringer to generate BalanceChangeReason String method
ziogaschr Mar 28, 2024
a6cabe1
fix failing test
ziogaschr Mar 28, 2024
df69332
make supply type private
ziogaschr Mar 28, 2024
fb0160b
make SupplyInfo private
ziogaschr Mar 28, 2024
6e7f5bc
typo interalTxsHandler->internalTxsHandler
ziogaschr Mar 28, 2024
91260a7
try a fix for “TempDir RemoveAll cleanup”
ziogaschr Mar 28, 2024
4320189
try a fix for test to pass on Windows
ziogaschr Mar 29, 2024
cba97ef
try a fix for test to pass on Windows
ziogaschr Mar 29, 2024
4708a19
fix test by closing logger file
ziogaschr Mar 29, 2024
00ef42b
add OnTerminate in Hooks which triggered on blockchain Stop
ziogaschr Mar 30, 2024
de1c41d
remove comment
ziogaschr Mar 30, 2024
200f496
Update core/blockchain.go
ziogaschr Mar 31, 2024
f65a19a
log any error during log file close
ziogaschr Mar 31, 2024
e67c3bf
refactor logging
s1na Apr 1, 2024
5ba5254
rename Hook “OnTerminate” to “OnBlockchainTerminate”
ziogaschr Apr 3, 2024
a6541d2
Merge branch 'master' into supply-delta-live-tracer
ziogaschr Apr 25, 2024
a2639b2
s/OnBlockchainTerminate/OnClose
ziogaschr Apr 25, 2024
dec5d3b
supply test compares output as JSON
ziogaschr May 30, 2024
b07ef33
change output JSON schema
ziogaschr May 30, 2024
e4a2c82
output hex values instead of numbers
ziogaschr May 30, 2024
b12c669
Merge branch 'master' into supply-delta-live-tracer
ziogaschr May 30, 2024
3ed1bd8
omitempty fields from supply tracer output
ziogaschr May 31, 2024
405ceae
keep logic of removing empty fields in a single place for tech debt
ziogaschr May 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions core/tracing/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,44 @@ const (
BalanceDecreaseSelfdestructBurn BalanceChangeReason = 14
)

// String returns a string representation of the reason.
func (r BalanceChangeReason) String() string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use https://pkg.go.dev/golang.org/x/tools/cmd/stringer to generate this method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fjl is this what you meant? 9e21e2d

switch r {
case BalanceChangeUnspecified:
return "BalanceChangeUnspecified"
case BalanceIncreaseRewardMineUncle:
return "BalanceIncreaseRewardMineUncle"
case BalanceIncreaseRewardMineBlock:
return "BalanceIncreaseRewardMineBlock"
case BalanceIncreaseWithdrawal:
return "BalanceIncreaseWithdrawal"
case BalanceIncreaseGenesisBalance:
return "BalanceIncreaseGenesisBalance"
case BalanceIncreaseRewardTransactionFee:
return "BalanceIncreaseRewardTransactionFee"
case BalanceDecreaseGasBuy:
return "BalanceDecreaseGasBuy"
case BalanceIncreaseGasReturn:
return "BalanceIncreaseGasReturn"
case BalanceIncreaseDaoContract:
return "BalanceIncreaseDaoContract"
case BalanceDecreaseDaoAccount:
return "BalanceDecreaseDaoAccount"
case BalanceChangeTransfer:
return "BalanceChangeTransfer"
case BalanceChangeTouchAccount:
return "BalanceChangeTouchAccount"
case BalanceIncreaseSelfdestruct:
return "BalanceIncreaseSelfdestruct"
case BalanceDecreaseSelfdestruct:
return "BalanceDecreaseSelfdestruct"
case BalanceDecreaseSelfdestructBurn:
return "BalanceDecreaseSelfdestructBurn"
default:
return "unknown"
}
}

// GasChangeReason is used to indicate the reason for a gas change, useful
// for tracing and reporting.
//
Expand Down
Loading
Loading