Skip to content

Conversation

@dai1975
Copy link
Contributor

@dai1975 dai1975 commented Jun 13, 2025

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.

…rsion

Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
@dai1975 dai1975 requested a review from Copilot June 13, 2025 06:37

This comment was marked as outdated.

@dai1975 dai1975 force-pushed the buildtag-debug_txpool branch 2 times, most recently from 8ea9a7f to 95bade2 Compare June 13, 2025 06:50
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
@dai1975 dai1975 force-pushed the buildtag-debug_txpool branch from 95bade2 to f25bc08 Compare June 13, 2025 06:51
@dai1975 dai1975 requested a review from Copilot June 13, 2025 06:51
Copy link
Contributor

Copilot AI left a 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" {

@dai1975 dai1975 requested a review from siburu June 13, 2025 06:52
@dai1975 dai1975 closed this Jun 16, 2025
@dai1975 dai1975 reopened this Jun 18, 2025
Daisuke Kanda added 2 commits June 24, 2025 07:28
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Copy link
Contributor

@siburu siburu left a 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>
@siburu
Copy link
Contributor

siburu commented Jul 3, 2025

@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.

Copy link
Contributor

@siburu siburu left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@siburu siburu merged commit 8716271 into main Jul 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants