-
Notifications
You must be signed in to change notification settings - Fork 16
debug build not to call txpool_contentFrom api #68
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
Conversation
…rsion Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
8ea9a7f to
95bade2
Compare
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
95bade2 to
f25bc08
Compare
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.
Pull Request Overview
This PR implements a debug build for the txpool_contentFrom API call, which on non-debug builds makes the RPC call as usual but returns an empty result in debug builds when the RELAYER_SKIP_TXPOOL_CONTENT_FROM environment variable is set.
- Introduces a dedicated debug file to handle the debug-specific behavior.
- Removes the redundant ContentFrom implementation from pkg/client/txpool/txpool.go, routing calls to the new implementations as appropriate.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/client/txpool/txpool_content_from.go | Implements the normal behavior for the RPC call |
| pkg/client/txpool/txpool_content_from.debug.go | Implements the debug behavior to skip the RPC call if env is set |
| pkg/client/txpool/txpool.go | Removes previous duplicate implementation of ContentFrom |
Comments suppressed due to low confidence (1)
pkg/client/txpool/txpool_content_from.debug.go:17
- Consider adding an inline comment inside this conditional block to clarify that setting RELAYER_SKIP_TXPOOL_CONTENT_FROM to '1' purposefully skips the txpool_contentFrom RPC call in debug builds.
if ok && val == "1" {
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
siburu
left a comment
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.
@dai1975 Almost ok, but I have put some comments.
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
|
@dai1975 Please rename txpool_content_from*.go into content_from*.go since they are in txpool package and the prefix in the file names are redundant. |
siburu
left a comment
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.
LGTM, thank you!
https://lcpbridge.atlassian.net/browse/LO-7246
Anvil blockchain node is useful for local test, but it does not support txpool_contentFrom api.
In some usecase, txpool_contentFrom call is not required so we prepare debug build not to call the api and use empty data as its response.