-
Notifications
You must be signed in to change notification settings - Fork 277
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
feat(api, rawdb): batch clean skipped txs traces #501
Conversation
fe69e31
to
84270e1
Compare
528da52
to
7d908e6
Compare
85caaeb
to
5be70d9
Compare
core/rawdb/accessors_skipped_txs.go
Outdated
mu.Lock() | ||
defer mu.Unlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to lock, the other method only locks because all invocations to WriteSkippedTransaction
(with a capital W) share a single counter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 1b7db00
d47d9f7
to
ed1a10a
Compare
39d42a9
to
82483e5
Compare
faa0a4b
to
1b7db00
Compare
82483e5
to
86e2fb3
Compare
@@ -197,6 +197,11 @@ func WriteSkippedTransaction(db ethdb.Database, tx *types.Transaction, traces *t | |||
} | |||
} | |||
|
|||
func ResetSkippedTransactionTracesByHash(db ethdb.Database, txHash common.Hash) { | |||
stx := ReadSkippedTransaction(db, txHash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stx := ReadSkippedTransaction(db, txHash) | |
stx := ReadSkippedTransaction(db, txHash) | |
if stx == nil { | |
return | |
} |
Sorry, forgot about the nil
case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return error can be better can let the caller know stx
value is empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 108ddc8
eth/api.go
Outdated
return hashes, nil | ||
} | ||
|
||
// ResetSkippedTransactionTracesByHash reset a specified skipped tx's traces stored in db. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// ResetSkippedTransactionTracesByHash reset a specified skipped tx's traces stored in db. | |
// ResetSkippedTransactionTracesByHash resets a specified skipped tx's traces stored in db. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 108ddc8
f243e3e
to
269bac1
Compare
1bb1c04
to
10092a4
Compare
1. Purpose or design rationale of this PR
After #500 we may store traces in DB, and we would like to clean them someday, because the trace size is nonnegligible.
2. PR title
Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:
3. Deployment tag versioning
Has the version in
params/version.go
been updated?4. Breaking change label
Does this PR have the
breaking-change
label?