Skip to content

test: make Bitcoin inscription based depositAndCall compatible for live network#4040

Merged
ws4charlie merged 9 commits intodevelopfrom
e2e-make-btc-inscription-deposit-work-for-nightly-test
Jul 25, 2025
Merged

test: make Bitcoin inscription based depositAndCall compatible for live network#4040
ws4charlie merged 9 commits intodevelopfrom
e2e-make-btc-inscription-deposit-work-for-nightly-test

Conversation

@ws4charlie
Copy link
Contributor

@ws4charlie ws4charlie commented Jul 22, 2025

Description

The changes in this PR:

  1. Reuse test_dapp_v2 for Bitcoin deposit and call related E2E tests.
  2. Compute depositor fee so as to check deposited zrc20 BTC token amount into ZEVM.
  3. Fix randomPayloadWithSize to return exact length (both odd and even) of payload.
  4. Add helper functions to help the E2E tests to with live networks.
    • SelectUTXOs
    • WaitForTxInclusion
    • CalcReceivedAmount
    • EstimateFeeRate

Closes: #4031

How Has This Been Tested?

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Summary by CodeRabbit

  • Tests

    • Improved Bitcoin and Ethereum end-to-end tests for deposit, withdrawal, and payload handling, including dynamic payload sizing, balance verification, and enhanced transaction confirmation.
    • Increased maximum payload sizes in ETH deposit and withdraw tests to match gateway limits.
    • Added synchronization step for Bitcoin withdrawal tests to ensure transaction confirmation.
    • Updated test logic to use predefined DApp addresses and more robust validation of transaction outcomes.
  • Chores

    • Updated changelog to reflect recent changes and test improvements.
  • Bug Fixes

    • Enhanced Bitcoin node interaction to avoid unnecessary queries when the node is not ready.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 22, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

This update refactors several Bitcoin and Ethereum end-to-end (E2E) tests, focusing on improved payload handling, dynamic fee estimation, and more robust transaction confirmation logic. The Bitcoin E2E runner’s transaction confirmation is now polling-based, and test contracts are replaced with predefined DApp addresses. Changelog and test documentation are updated accordingly.

Changes

File(s) Change Summary
changelog.md Removed entry for PR #4004; added test entry for PR #4040 in UNRELEASED section.
e2e/e2etests/e2etests.go Removed "fee rate" argument from a specific Bitcoin inscription test case.
e2e/e2etests/helpers.go randomPayload now generates 100-char payloads; randomPayloadWithSize reworked for precise hex string sizing and better edge handling.
e2e/e2etests/test_bitcoin_deposit_call.go Refactored test to use predefined DApp address, improved payload sizing, and balance checks.
e2e/e2etests/test_bitcoin_std_deposit_and_call.go Refactored to use fixed test DApp address, dynamic payloads, and actual received amount calculations.
e2e/e2etests/test_bitcoin_std_memo_inscribed_deposit_and_call.go Simplified inputs, dynamic fee estimation, replaced contract deployment with fixed DApp address, and improved payload testing.
e2e/e2etests/test_bitcoin_withdraw_rbf.go Added synchronization after withdrawal initiation to ensure CCTX creation before proceeding.
e2e/e2etests/test_eth_deposit_and_call_big_payload.go
e2e/e2etests/test_eth_withdraw_and_call_big_payload.go
Increased ETH test payload size from 1440 to 2880 bytes to match gateway limits.
e2e/runner/bitcoin.go Refactored transaction confirmation to polling-based logic; added fee estimation and received amount calculation utilities; updated method signatures.
zetaclient/chains/bitcoin/observer/utxos.go Early exit added in UTXO fetch if Bitcoin node is not ready.

Sequence Diagram(s)

sequenceDiagram
    participant Test as E2E Test
    participant Runner as E2ERunner
    participant BTCNode as Bitcoin Node
    participant ZEVM as ZEVM Chain

    Test->>Runner: Initiate BTC deposit/inscription with memo
    Runner->>BTCNode: Send BTC transaction
    Runner->>BTCNode: WaitForTxInclusion (polling)
    BTCNode-->>Runner: Return TxRawResult after inclusion
    Runner->>ZEVM: Wait for CCTX mined
    ZEVM-->>Runner: Confirm DApp called with payload and amount
    Runner-->>Test: Assert balance and payload delivery
Loading

Estimated code review effort

4 (~90 minutes)

  • The changes encompass substantial refactoring in the E2E Bitcoin runner, significant updates to several complex E2E tests, and non-trivial utility enhancements. The review requires careful attention to test correctness, transaction handling logic, and potential side effects across the test suite.
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch e2e-make-btc-inscription-deposit-work-for-nightly-test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link

codecov bot commented Jul 22, 2025

Codecov Report

Attention: Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 64.94%. Comparing base (909ec4e) to head (bdd550b).

Files with missing lines Patch % Lines
zetaclient/chains/bitcoin/observer/utxos.go 25.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #4040   +/-   ##
========================================
  Coverage    64.94%   64.94%           
========================================
  Files          475      475           
  Lines        35139    35142    +3     
========================================
+ Hits         22821    22823    +2     
  Misses       11245    11245           
- Partials      1073     1074    +1     
Files with missing lines Coverage Δ
zetaclient/chains/bitcoin/observer/utxos.go 82.20% <25.00%> (-2.15%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ws4charlie ws4charlie added chain:bitcoin Bitcoin chain related test Tests related refactor labels Jul 22, 2025
@ws4charlie ws4charlie marked this pull request as ready for review July 22, 2025 21:17
@ws4charlie ws4charlie requested a review from a team as a code owner July 22, 2025 21:17
@ws4charlie ws4charlie changed the title test: make Bitcoin inscription based 'depositAndCall' compatible for live network test: make Bitcoin inscription based depositAndCall compatible for live network Jul 22, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (4)
e2e/e2etests/helpers.go (2)

20-20: Clarify that the function returns a hex-encoded string.

The comment should explicitly mention that the returned string is hex-encoded to avoid confusion.

-// randomPayloadWithSize generates a random payload string containing exactly 'size' characters
+// randomPayloadWithSize generates a random hex-encoded string containing exactly 'size' characters

27-50: Simplify the implementation for better readability.

The current implementation handles even and odd sizes separately, but this can be simplified while maintaining the same functionality.

-	var (
-		bytes []byte
-		even  = size%2 == 0
-	)
-
-	// the size will double when converting to hex string, so we just need half the size
-	if even {
-		bytes = make([]byte, size/2)
-	} else {
-		// add 1 more byte if size is odd, we trim it later
-		bytes = make([]byte, (size/2)+1)
-	}
-
-	// generate random bytes
+	// hex encoding doubles the size, so we need ceil(size/2) bytes
+	bytes := make([]byte, (size+1)/2)
 	_, err := rand.Read(bytes)
 	require.NoError(r, err)
 
-	// hex encode the bytes, the size is double
-	if even {
-		return hex.EncodeToString(bytes)
-	}
-
-	// trim the last letter to fit the odd size
-	return hex.EncodeToString(bytes)[:size]
+	// hex encode and trim to exact size
+	return hex.EncodeToString(bytes)[:size]
e2e/runner/bitcoin.go (2)

491-491: Fix typo in comment.

-		// error may occue if the tx is not yet included
+		// error may occur if the tx is not yet included

506-509: Consider documenting the mempool acceptance rationale.

The comment mentions accepting 0 confirmations (mempool transactions) is sufficient. While this is reasonable for E2E tests, consider adding a brief explanation about why this is safe in this context.

 		// as far as tx gets into the mempool (0 confirmations), we consider it included
 		// there's no need to wait for 1 block to be able to send out subsequent transactions
+		// This is safe for E2E tests as we control the test environment and transaction ordering
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5eb258 and 27bb3c3.

📒 Files selected for processing (11)
  • changelog.md (1 hunks)
  • e2e/e2etests/e2etests.go (0 hunks)
  • e2e/e2etests/helpers.go (1 hunks)
  • e2e/e2etests/test_bitcoin_deposit_call.go (2 hunks)
  • e2e/e2etests/test_bitcoin_std_deposit_and_call.go (1 hunks)
  • e2e/e2etests/test_bitcoin_std_memo_inscribed_deposit_and_call.go (2 hunks)
  • e2e/e2etests/test_bitcoin_withdraw_rbf.go (1 hunks)
  • e2e/e2etests/test_eth_deposit_and_call_big_payload.go (1 hunks)
  • e2e/e2etests/test_eth_withdraw_and_call_big_payload.go (1 hunks)
  • e2e/runner/bitcoin.go (4 hunks)
  • zetaclient/chains/bitcoin/observer/utxos.go (1 hunks)
📓 Path-based instructions (1)
**/*.go

⚙️ CodeRabbit Configuration File

Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

Files:

  • e2e/e2etests/test_eth_deposit_and_call_big_payload.go
  • e2e/e2etests/test_bitcoin_withdraw_rbf.go
  • e2e/e2etests/test_eth_withdraw_and_call_big_payload.go
  • zetaclient/chains/bitcoin/observer/utxos.go
  • e2e/e2etests/helpers.go
  • e2e/e2etests/test_bitcoin_std_memo_inscribed_deposit_and_call.go
  • e2e/e2etests/test_bitcoin_std_deposit_and_call.go
  • e2e/runner/bitcoin.go
  • e2e/e2etests/test_bitcoin_deposit_call.go
🧠 Learnings (11)
📓 Common learnings
Learnt from: gartnera
PR: zeta-chain/node#3070
File: cmd/zetae2e/init.go:0-0
Timestamp: 2024-10-30T17:56:16.341Z
Learning: In code reviews for Go files like `cmd/zetae2e/init.go` in the ZetaChain project, avoid suggesting unrelated refactoring. Focus comments on changes relevant to the PR objectives.
Learnt from: skosito
PR: zeta-chain/node#3939
File: go.mod:52-52
Timestamp: 2025-05-30T16:31:30.275Z
Learning: The ethermint dependency updates in the zeta-chain/node repository are typically moves between feature branches and main branch of the same fork, not breaking API changes. CI status should be verified before assuming compilation issues.
Learnt from: gartnera
PR: zeta-chain/node#3632
File: zetaclient/chains/solana/signer/signer.go:304-304
Timestamp: 2025-03-04T22:39:58.395Z
Learning: The Solana signer implementation in zetaclient/chains/solana/signer/signer.go has limited test coverage, particularly for the transaction broadcasting logic with fallback scenarios. Adding this coverage has been acknowledged as a potential future improvement outside the scope of immediate fixes.
Learnt from: ws4charlie
PR: zeta-chain/node#2411
File: zetaclient/orchestrator/chain_activate.go:184-247
Timestamp: 2024-07-05T00:02:31.446Z
Learning: The `CreateSignerObserverBTC` function in `zetaclient/orchestrator/chain_activate.go` is covered by unit tests in `zetaclient/orchestrator/chain_activate_test.go`.
Learnt from: ws4charlie
PR: zeta-chain/node#2899
File: zetaclient/chains/bitcoin/observer/inbound.go:366-371
Timestamp: 2024-09-19T18:28:58.296Z
Learning: The `bitcoin.CalcDepositorFee` function is covered by live tests.
Learnt from: ws4charlie
PR: zeta-chain/node#2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., `IsUTXO()` to `IsBitcoin()`), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.
Learnt from: gartnera
PR: zeta-chain/node#3228
File: zetaclient/orchestrator/orchestrator.go:388-401
Timestamp: 2024-11-27T22:01:49.732Z
Learning: When reviewing code changes in `zetaclient/orchestrator/orchestrator.go`, avoid suggesting refactoring that is unrelated to the current PR.
Learnt from: ws4charlie
PR: zeta-chain/node#4007
File: e2e/runner/sui.go:237-274
Timestamp: 2025-07-14T21:08:08.725Z
Learning: In test code for the ZetaChain project, it's acceptable to use constants for EVM and Sui address lengths rather than adding complex validation logic. This applies to functions like payload construction in E2E tests where the expected lengths are well-defined and documented.
Learnt from: lumtis
PR: zeta-chain/node#2459
File: e2e/config/config.go:285-293
Timestamp: 2024-07-11T13:10:39.153Z
Learning: Tests should not be suggested in the `e2e` package for the `zeta-chain/node` repository.
Learnt from: ws4charlie
PR: zeta-chain/node#2411
File: zetaclient/orchestrator/orchestrator.go:192-217
Timestamp: 2024-07-04T23:46:38.428Z
Learning: The `GetUpdatedSigner` method in `zetaclient/orchestrator/orchestrator.go` is covered by unit tests in `zetaclient/orchestrator/chain_activate_test.go` and `zetaclient/orchestrator/orchestrator_test.go`.
Learnt from: kingpinXD
PR: zeta-chain/node#3503
File: e2e/runner/require.go:0-0
Timestamp: 2025-02-07T19:33:35.631Z
Learning: In e2e tests for the zeta-chain/node repository, minimize computation and avoid redundant checks that are already covered by unit tests to ensure faster execution. For example, ballot sorting is verified in unit tests, so e2e tests can safely assume the order.
Learnt from: gartnera
PR: zeta-chain/node#3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file `e2e/e2etests/test_pause_erc20_custody.go`, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.
Learnt from: ws4charlie
PR: zeta-chain/node#2411
File: zetaclient/orchestrator/orchestrator.go:222-237
Timestamp: 2024-07-04T23:47:56.072Z
Learning: The `GetUpdatedChainObserver` method in the `Orchestrator` class is covered by unit tests in `zetaclient/orchestrator/orchestrator_test.go` and `zetaclient/orchestrator/chain_activate_test.go`.
e2e/e2etests/test_eth_deposit_and_call_big_payload.go (9)

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: ws4charlie
PR: #4007
File: e2e/runner/sui.go:237-274
Timestamp: 2025-07-14T21:08:08.725Z
Learning: In test code for the ZetaChain project, it's acceptable to use constants for EVM and Sui address lengths rather than adding complex validation logic. This applies to functions like payload construction in E2E tests where the expected lengths are well-defined and documented.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:0-0
Timestamp: 2024-10-31T16:21:47.362Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, when handling the error returned by stats.Describe in the TestStressEtherWithdraw function, log the error instead of failing the test.

Learnt from: ws4charlie
PR: #2987
File: pkg/memo/codec_abi.go:0-0
Timestamp: 2024-10-10T18:50:23.406Z
Learning: The constant ABIAlignment has been moved from pkg/memo/codec_abi.go to the testutil package.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:41-42
Timestamp: 2024-10-31T16:23:17.250Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, since some goroutines may fail, we should use a mutex to append durations of successful withdrawals for accurate latency reporting.

Learnt from: ws4charlie
PR: #2987
File: testutil/sample/memo.go:0-0
Timestamp: 2024-10-10T18:54:33.554Z
Learning: In the testutil/sample/memo.go file, unchecked type assertions in the ABIPack function are acceptable because it is designed for unit tests and simplicity.

Learnt from: gartnera
PR: #3070
File: cmd/zetae2e/init.go:0-0
Timestamp: 2024-10-30T17:56:16.341Z
Learning: In code reviews for Go files like cmd/zetae2e/init.go in the ZetaChain project, avoid suggesting unrelated refactoring. Focus comments on changes relevant to the PR objectives.

Learnt from: ws4charlie
PR: #3306
File: pkg/math/integer_test.go:0-0
Timestamp: 2025-01-14T03:37:18.430Z
Learning: Use big.Int for handling large number calculations and edge cases to avoid integer overflow issues.

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

e2e/e2etests/test_bitcoin_withdraw_rbf.go (11)

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:41-42
Timestamp: 2024-10-31T16:23:17.250Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, since some goroutines may fail, we should use a mutex to append durations of successful withdrawals for accurate latency reporting.

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:184-247
Timestamp: 2024-07-05T00:02:31.446Z
Learning: The CreateSignerObserverBTC function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: gartnera
PR: #3105
File: e2e/runner/setup_bitcoin.go:51-69
Timestamp: 2024-11-06T21:10:14.301Z
Learning: In test code (e2e/runner/setup_bitcoin.go), adding security measures for private key handling in the GetBtcAddress method is not required.

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:366-371
Timestamp: 2024-09-19T18:28:58.296Z
Learning: The bitcoin.CalcDepositorFee function is covered by live tests.

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: gartnera
PR: #3632
File: zetaclient/chains/solana/signer/signer.go:304-304
Timestamp: 2025-03-04T22:39:58.395Z
Learning: The Solana signer implementation in zetaclient/chains/solana/signer/signer.go has limited test coverage, particularly for the transaction broadcasting logic with fallback scenarios. Adding this coverage has been acknowledged as a potential future improvement outside the scope of immediate fixes.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:58-59
Timestamp: 2024-10-31T16:19:26.038Z
Learning: In the Go code within e2e/utils/zetacore.go, the function WaitCctxMinedByInboundHash does not return an error.

Learnt from: ws4charlie
PR: #3306
File: zetaclient/chains/bitcoin/signer/sign.go:225-233
Timestamp: 2025-01-14T03:39:29.764Z
Learning: The signature hash calculation in Bitcoin TSS transactions using txscript.NewCannedPrevOutputFetcher([]byte{}, 0) with correct input amounts has been proven to work reliably in production, despite theoretical concerns about empty previous output fetcher.

e2e/e2etests/test_eth_withdraw_and_call_big_payload.go (10)

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:0-0
Timestamp: 2024-10-31T16:21:47.362Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, when handling the error returned by stats.Describe in the TestStressEtherWithdraw function, log the error instead of failing the test.

Learnt from: ws4charlie
PR: #4007
File: e2e/runner/sui.go:237-274
Timestamp: 2025-07-14T21:08:08.725Z
Learning: In test code for the ZetaChain project, it's acceptable to use constants for EVM and Sui address lengths rather than adding complex validation logic. This applies to functions like payload construction in E2E tests where the expected lengths are well-defined and documented.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:41-42
Timestamp: 2024-10-31T16:23:17.250Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, since some goroutines may fail, we should use a mutex to append durations of successful withdrawals for accurate latency reporting.

Learnt from: ws4charlie
PR: #2987
File: pkg/memo/codec_abi.go:0-0
Timestamp: 2024-10-10T18:50:23.406Z
Learning: The constant ABIAlignment has been moved from pkg/memo/codec_abi.go to the testutil package.

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: gartnera
PR: #3105
File: e2e/runner/setup_bitcoin.go:51-69
Timestamp: 2024-11-06T21:10:14.301Z
Learning: In test code (e2e/runner/setup_bitcoin.go), adding security measures for private key handling in the GetBtcAddress method is not required.

Learnt from: gartnera
PR: #3070
File: cmd/zetae2e/init.go:0-0
Timestamp: 2024-10-30T17:56:16.341Z
Learning: In code reviews for Go files like cmd/zetae2e/init.go in the ZetaChain project, avoid suggesting unrelated refactoring. Focus comments on changes relevant to the PR objectives.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

changelog.md (7)

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: skosito
PR: #3939
File: go.mod:52-52
Timestamp: 2025-05-30T16:31:30.275Z
Learning: The ethermint dependency updates in the zeta-chain/node repository are typically moves between feature branches and main branch of the same fork, not breaking API changes. CI status should be verified before assuming compilation issues.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: gartnera
PR: #3632
File: zetaclient/chains/solana/signer/signer.go:304-304
Timestamp: 2025-03-04T22:39:58.395Z
Learning: The Solana signer implementation in zetaclient/chains/solana/signer/signer.go has limited test coverage, particularly for the transaction broadcasting logic with fallback scenarios. Adding this coverage has been acknowledged as a potential future improvement outside the scope of immediate fixes.

Learnt from: kingpinXD
PR: #3503
File: e2e/runner/require.go:0-0
Timestamp: 2025-02-07T19:33:35.631Z
Learning: In e2e tests for the zeta-chain/node repository, minimize computation and avoid redundant checks that are already covered by unit tests to ensure faster execution. For example, ballot sorting is verified in unit tests, so e2e tests can safely assume the order.

Learnt from: lumtis
PR: #2459
File: e2e/config/config.go:285-293
Timestamp: 2024-07-11T13:10:39.153Z
Learning: Tests should not be suggested in the e2e package for the zeta-chain/node repository.

zetaclient/chains/bitcoin/observer/utxos.go (10)

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/orchestrator.go:222-237
Timestamp: 2024-07-04T23:47:56.072Z
Learning: The GetUpdatedChainObserver method in the Orchestrator class is covered by unit tests in zetaclient/orchestrator/orchestrator_test.go and zetaclient/orchestrator/chain_activate_test.go.

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:184-247
Timestamp: 2024-07-05T00:02:31.446Z
Learning: The CreateSignerObserverBTC function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: ws4charlie
PR: #3306
File: zetaclient/chains/bitcoin/observer/db.go:11-25
Timestamp: 2025-01-14T00:09:01.416Z
Learning: In Bitcoin observer, non-critical DB operations (like saving broadcasted transactions) should log errors but not return them to callers, as the errors are already handled appropriately through logging and don't affect the critical in-memory state.

Learnt from: gartnera
PR: #3228
File: zetaclient/orchestrator/orchestrator.go:388-401
Timestamp: 2024-11-27T22:01:49.732Z
Learning: When reviewing code changes in zetaclient/orchestrator/orchestrator.go, avoid suggesting refactoring that is unrelated to the current PR.

Learnt from: ws4charlie
PR: #3306
File: zetaclient/chains/bitcoin/signer/sign.go:225-233
Timestamp: 2025-01-14T03:39:29.764Z
Learning: The signature hash calculation in Bitcoin TSS transactions using txscript.NewCannedPrevOutputFetcher([]byte{}, 0) with correct input amounts has been proven to work reliably in production, despite theoretical concerns about empty previous output fetcher.

Learnt from: ws4charlie
PR: #3306
File: zetaclient/chains/bitcoin/signer/sign.go:43-43
Timestamp: 2025-01-13T23:25:05.336Z
Learning: In the Bitcoin implementation, UTXO amounts are represented as float64 to maintain compatibility with Bitcoin Core's JSON-RPC interface through btcd's ListUnspentResult struct, even though integer arithmetic would typically be preferred for cryptocurrency amounts.

Learnt from: ws4charlie
PR: #3381
File: zetaclient/chains/bitcoin/signer/outbound_data.go:29-29
Timestamp: 2025-01-21T04:34:47.335Z
Learning: In Bitcoin UTXO handling code, float64 must be used for amount fields as it's required by Bitcoin's RPC interface (btcd/btcjson.ListUnspentResult). While floating-point is generally avoided for monetary calculations, Bitcoin's RPC represents amounts in BTC as float64 values, making it a necessary exception in UTXO-related code.

e2e/e2etests/helpers.go (3)

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: ws4charlie
PR: #4007
File: e2e/runner/sui.go:237-274
Timestamp: 2025-07-14T21:08:08.725Z
Learning: In test code for the ZetaChain project, it's acceptable to use constants for EVM and Sui address lengths rather than adding complex validation logic. This applies to functions like payload construction in E2E tests where the expected lengths are well-defined and documented.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:0-0
Timestamp: 2024-10-31T16:21:47.362Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, when handling the error returned by stats.Describe in the TestStressEtherWithdraw function, log the error instead of failing the test.

e2e/e2etests/test_bitcoin_std_memo_inscribed_deposit_and_call.go (13)

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:366-371
Timestamp: 2024-09-19T18:28:58.296Z
Learning: The bitcoin.CalcDepositorFee function is covered by live tests.

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: ws4charlie
PR: #2987
File: testutil/sample/memo.go:0-0
Timestamp: 2024-10-10T18:54:33.554Z
Learning: In the testutil/sample/memo.go file, unchecked type assertions in the ABIPack function are acceptable because it is designed for unit tests and simplicity.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:184-247
Timestamp: 2024-07-05T00:02:31.446Z
Learning: The CreateSignerObserverBTC function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: gartnera
PR: #3105
File: e2e/runner/setup_bitcoin.go:51-69
Timestamp: 2024-11-06T21:10:14.301Z
Learning: In test code (e2e/runner/setup_bitcoin.go), adding security measures for private key handling in the GetBtcAddress method is not required.

Learnt from: ws4charlie
PR: #2987
File: pkg/memo/codec_abi.go:0-0
Timestamp: 2024-10-10T18:50:23.406Z
Learning: The constant ABIAlignment has been moved from pkg/memo/codec_abi.go to the testutil package.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:37-38
Timestamp: 2024-09-19T18:22:35.964Z
Learning: In BTCInboundEvent, it's acceptable to use float64 for monetary values (Value and DepositorFee) because precision is ensured through conversion to integer when building the vote message.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:0-0
Timestamp: 2024-10-31T16:21:47.362Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, when handling the error returned by stats.Describe in the TestStressEtherWithdraw function, log the error instead of failing the test.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:116-181
Timestamp: 2024-07-05T00:02:36.493Z
Learning: The CreateSignerObserverEVM function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: fbac
PR: #2979
File: x/fungible/keeper/zrc20_unlock_token.go:69-72
Timestamp: 2024-10-08T14:57:52.954Z
Learning: In x/fungible/keeper/zrc20_unlock_token.go, when performing type assertions like transferred, ok := ret[0].(bool), using the ok check is sufficient to prevent panics, and additional type handling is not required.

e2e/e2etests/test_bitcoin_std_deposit_and_call.go (13)

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:366-371
Timestamp: 2024-09-19T18:28:58.296Z
Learning: The bitcoin.CalcDepositorFee function is covered by live tests.

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: gartnera
PR: #3105
File: e2e/runner/setup_bitcoin.go:51-69
Timestamp: 2024-11-06T21:10:14.301Z
Learning: In test code (e2e/runner/setup_bitcoin.go), adding security measures for private key handling in the GetBtcAddress method is not required.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:0-0
Timestamp: 2024-10-31T16:21:47.362Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, when handling the error returned by stats.Describe in the TestStressEtherWithdraw function, log the error instead of failing the test.

Learnt from: ws4charlie
PR: #2987
File: testutil/sample/memo.go:0-0
Timestamp: 2024-10-10T18:54:33.554Z
Learning: In the testutil/sample/memo.go file, unchecked type assertions in the ABIPack function are acceptable because it is designed for unit tests and simplicity.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:184-247
Timestamp: 2024-07-05T00:02:31.446Z
Learning: The CreateSignerObserverBTC function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:37-38
Timestamp: 2024-09-19T18:22:35.964Z
Learning: In BTCInboundEvent, it's acceptable to use float64 for monetary values (Value and DepositorFee) because precision is ensured through conversion to integer when building the vote message.

Learnt from: ws4charlie
PR: #2987
File: pkg/memo/codec_abi.go:0-0
Timestamp: 2024-10-10T18:50:23.406Z
Learning: The constant ABIAlignment has been moved from pkg/memo/codec_abi.go to the testutil package.

Learnt from: ws4charlie
PR: #3381
File: zetaclient/chains/bitcoin/signer/outbound_data.go:29-29
Timestamp: 2025-01-21T04:34:47.335Z
Learning: In Bitcoin UTXO handling code, float64 must be used for amount fields as it's required by Bitcoin's RPC interface (btcd/btcjson.ListUnspentResult). While floating-point is generally avoided for monetary calculations, Bitcoin's RPC represents amounts in BTC as float64 values, making it a necessary exception in UTXO-related code.

Learnt from: ws4charlie
PR: #2987
File: testutil/sample/memo.go:108-109
Timestamp: 2024-10-10T19:00:07.093Z
Learning: In testutil/sample/memo.go, BigEndian is used for ABI encoding functions, consistent with ABI specifications, whereas LittleEndian is used in compact encoding functions as appropriate.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

e2e/runner/bitcoin.go (17)

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:366-371
Timestamp: 2024-09-19T18:28:58.296Z
Learning: The bitcoin.CalcDepositorFee function is covered by live tests.

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:37-38
Timestamp: 2024-09-19T18:22:35.964Z
Learning: In BTCInboundEvent, it's acceptable to use float64 for monetary values (Value and DepositorFee) because precision is ensured through conversion to integer when building the vote message.

Learnt from: gartnera
PR: #3105
File: e2e/runner/setup_bitcoin.go:51-69
Timestamp: 2024-11-06T21:10:14.301Z
Learning: In test code (e2e/runner/setup_bitcoin.go), adding security measures for private key handling in the GetBtcAddress method is not required.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #3306
File: zetaclient/chains/bitcoin/observer/outbound.go:28-32
Timestamp: 2025-01-13T23:51:09.334Z
Learning: In Bitcoin observer, minTxConfirmations is set to 0 to allow observing mempool transactions without waiting for block confirmations, which is necessary due to Bitcoin's 10-minute block time. This is a deliberate design choice despite potential security implications, as other safety checks are in place through TSS validation.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:41-42
Timestamp: 2024-10-31T16:23:17.250Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, since some goroutines may fail, we should use a mutex to append durations of successful withdrawals for accurate latency reporting.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:58-59
Timestamp: 2024-10-31T16:19:26.038Z
Learning: In the Go code within e2e/utils/zetacore.go, the function WaitCctxMinedByInboundHash does not return an error.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:184-247
Timestamp: 2024-07-05T00:02:31.446Z
Learning: The CreateSignerObserverBTC function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: ws4charlie
PR: #2987
File: testutil/sample/memo.go:0-0
Timestamp: 2024-10-10T18:54:33.554Z
Learning: In the testutil/sample/memo.go file, unchecked type assertions in the ABIPack function are acceptable because it is designed for unit tests and simplicity.

Learnt from: gartnera
PR: #3105
File: cmd/zetae2e/local/bitcoin.go:8-8
Timestamp: 2024-11-06T21:11:34.420Z
Learning: In the e2e codebase, it's acceptable to use github.com/stretchr/testify/require outside of test files.

Learnt from: ws4charlie
PR: #3306
File: pkg/math/integer_test.go:0-0
Timestamp: 2025-01-14T03:37:18.430Z
Learning: Use big.Int for handling large number calculations and edge cases to avoid integer overflow issues.

Learnt from: gartnera
PR: #3632
File: zetaclient/chains/solana/signer/signer.go:304-304
Timestamp: 2025-03-04T22:39:58.395Z
Learning: The Solana signer implementation in zetaclient/chains/solana/signer/signer.go has limited test coverage, particularly for the transaction broadcasting logic with fallback scenarios. Adding this coverage has been acknowledged as a potential future improvement outside the scope of immediate fixes.

Learnt from: gartnera
PR: #3395
File: .github/workflows/reusable-sim.yml:29-30
Timestamp: 2025-01-22T22:46:58.820Z
Learning: The zeta-chain/node repository uses Go version >= 1.22. Do not suggest downgrading to earlier versions like 1.21.

Learnt from: ws4charlie
PR: #3306
File: zetaclient/chains/bitcoin/signer/sign.go:225-233
Timestamp: 2025-01-14T03:39:29.764Z
Learning: The signature hash calculation in Bitcoin TSS transactions using txscript.NewCannedPrevOutputFetcher([]byte{}, 0) with correct input amounts has been proven to work reliably in production, despite theoretical concerns about empty previous output fetcher.

e2e/e2etests/test_bitcoin_deposit_call.go (15)

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:366-371
Timestamp: 2024-09-19T18:28:58.296Z
Learning: The bitcoin.CalcDepositorFee function is covered by live tests.

Learnt from: gartnera
PR: #3105
File: e2e/runner/setup_bitcoin.go:51-69
Timestamp: 2024-11-06T21:10:14.301Z
Learning: In test code (e2e/runner/setup_bitcoin.go), adding security measures for private key handling in the GetBtcAddress method is not required.

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:184-247
Timestamp: 2024-07-05T00:02:31.446Z
Learning: The CreateSignerObserverBTC function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:0-0
Timestamp: 2024-10-31T16:21:47.362Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, when handling the error returned by stats.Describe in the TestStressEtherWithdraw function, log the error instead of failing the test.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: gartnera
PR: #3070
File: cmd/zetae2e/init.go:0-0
Timestamp: 2024-10-30T17:56:16.341Z
Learning: In code reviews for Go files like cmd/zetae2e/init.go in the ZetaChain project, avoid suggesting unrelated refactoring. Focus comments on changes relevant to the PR objectives.

Learnt from: gartnera
PR: #3632
File: zetaclient/chains/solana/signer/signer.go:304-304
Timestamp: 2025-03-04T22:39:58.395Z
Learning: The Solana signer implementation in zetaclient/chains/solana/signer/signer.go has limited test coverage, particularly for the transaction broadcasting logic with fallback scenarios. Adding this coverage has been acknowledged as a potential future improvement outside the scope of immediate fixes.

Learnt from: ws4charlie
PR: #2987
File: testutil/sample/memo.go:0-0
Timestamp: 2024-10-10T18:54:33.554Z
Learning: In the testutil/sample/memo.go file, unchecked type assertions in the ABIPack function are acceptable because it is designed for unit tests and simplicity.

Learnt from: gartnera
PR: #3105
File: cmd/zetae2e/local/bitcoin.go:8-8
Timestamp: 2024-11-06T21:11:34.420Z
Learning: In the e2e codebase, it's acceptable to use github.com/stretchr/testify/require outside of test files.

Learnt from: ws4charlie
PR: #3306
File: zetaclient/chains/bitcoin/signer/sign.go:225-233
Timestamp: 2025-01-14T03:39:29.764Z
Learning: The signature hash calculation in Bitcoin TSS transactions using txscript.NewCannedPrevOutputFetcher([]byte{}, 0) with correct input amounts has been proven to work reliably in production, despite theoretical concerns about empty previous output fetcher.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:116-181
Timestamp: 2024-07-05T00:02:36.493Z
Learning: The CreateSignerObserverEVM function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: ws4charlie
PR: #3306
File: pkg/math/integer_test.go:0-0
Timestamp: 2025-01-14T03:37:18.430Z
Learning: Use big.Int for handling large number calculations and edge cases to avoid integer overflow issues.

💤 Files with no reviewable changes (1)
  • e2e/e2etests/e2etests.go
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go

⚙️ CodeRabbit Configuration File

Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

Files:

  • e2e/e2etests/test_eth_deposit_and_call_big_payload.go
  • e2e/e2etests/test_bitcoin_withdraw_rbf.go
  • e2e/e2etests/test_eth_withdraw_and_call_big_payload.go
  • zetaclient/chains/bitcoin/observer/utxos.go
  • e2e/e2etests/helpers.go
  • e2e/e2etests/test_bitcoin_std_memo_inscribed_deposit_and_call.go
  • e2e/e2etests/test_bitcoin_std_deposit_and_call.go
  • e2e/runner/bitcoin.go
  • e2e/e2etests/test_bitcoin_deposit_call.go
🧠 Learnings (11)
📓 Common learnings
Learnt from: gartnera
PR: zeta-chain/node#3070
File: cmd/zetae2e/init.go:0-0
Timestamp: 2024-10-30T17:56:16.341Z
Learning: In code reviews for Go files like `cmd/zetae2e/init.go` in the ZetaChain project, avoid suggesting unrelated refactoring. Focus comments on changes relevant to the PR objectives.
Learnt from: skosito
PR: zeta-chain/node#3939
File: go.mod:52-52
Timestamp: 2025-05-30T16:31:30.275Z
Learning: The ethermint dependency updates in the zeta-chain/node repository are typically moves between feature branches and main branch of the same fork, not breaking API changes. CI status should be verified before assuming compilation issues.
Learnt from: gartnera
PR: zeta-chain/node#3632
File: zetaclient/chains/solana/signer/signer.go:304-304
Timestamp: 2025-03-04T22:39:58.395Z
Learning: The Solana signer implementation in zetaclient/chains/solana/signer/signer.go has limited test coverage, particularly for the transaction broadcasting logic with fallback scenarios. Adding this coverage has been acknowledged as a potential future improvement outside the scope of immediate fixes.
Learnt from: ws4charlie
PR: zeta-chain/node#2411
File: zetaclient/orchestrator/chain_activate.go:184-247
Timestamp: 2024-07-05T00:02:31.446Z
Learning: The `CreateSignerObserverBTC` function in `zetaclient/orchestrator/chain_activate.go` is covered by unit tests in `zetaclient/orchestrator/chain_activate_test.go`.
Learnt from: ws4charlie
PR: zeta-chain/node#2899
File: zetaclient/chains/bitcoin/observer/inbound.go:366-371
Timestamp: 2024-09-19T18:28:58.296Z
Learning: The `bitcoin.CalcDepositorFee` function is covered by live tests.
Learnt from: ws4charlie
PR: zeta-chain/node#2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., `IsUTXO()` to `IsBitcoin()`), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.
Learnt from: gartnera
PR: zeta-chain/node#3228
File: zetaclient/orchestrator/orchestrator.go:388-401
Timestamp: 2024-11-27T22:01:49.732Z
Learning: When reviewing code changes in `zetaclient/orchestrator/orchestrator.go`, avoid suggesting refactoring that is unrelated to the current PR.
Learnt from: ws4charlie
PR: zeta-chain/node#4007
File: e2e/runner/sui.go:237-274
Timestamp: 2025-07-14T21:08:08.725Z
Learning: In test code for the ZetaChain project, it's acceptable to use constants for EVM and Sui address lengths rather than adding complex validation logic. This applies to functions like payload construction in E2E tests where the expected lengths are well-defined and documented.
Learnt from: lumtis
PR: zeta-chain/node#2459
File: e2e/config/config.go:285-293
Timestamp: 2024-07-11T13:10:39.153Z
Learning: Tests should not be suggested in the `e2e` package for the `zeta-chain/node` repository.
Learnt from: ws4charlie
PR: zeta-chain/node#2411
File: zetaclient/orchestrator/orchestrator.go:192-217
Timestamp: 2024-07-04T23:46:38.428Z
Learning: The `GetUpdatedSigner` method in `zetaclient/orchestrator/orchestrator.go` is covered by unit tests in `zetaclient/orchestrator/chain_activate_test.go` and `zetaclient/orchestrator/orchestrator_test.go`.
Learnt from: kingpinXD
PR: zeta-chain/node#3503
File: e2e/runner/require.go:0-0
Timestamp: 2025-02-07T19:33:35.631Z
Learning: In e2e tests for the zeta-chain/node repository, minimize computation and avoid redundant checks that are already covered by unit tests to ensure faster execution. For example, ballot sorting is verified in unit tests, so e2e tests can safely assume the order.
Learnt from: gartnera
PR: zeta-chain/node#3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file `e2e/e2etests/test_pause_erc20_custody.go`, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.
Learnt from: ws4charlie
PR: zeta-chain/node#2411
File: zetaclient/orchestrator/orchestrator.go:222-237
Timestamp: 2024-07-04T23:47:56.072Z
Learning: The `GetUpdatedChainObserver` method in the `Orchestrator` class is covered by unit tests in `zetaclient/orchestrator/orchestrator_test.go` and `zetaclient/orchestrator/chain_activate_test.go`.
e2e/e2etests/test_eth_deposit_and_call_big_payload.go (9)

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: ws4charlie
PR: #4007
File: e2e/runner/sui.go:237-274
Timestamp: 2025-07-14T21:08:08.725Z
Learning: In test code for the ZetaChain project, it's acceptable to use constants for EVM and Sui address lengths rather than adding complex validation logic. This applies to functions like payload construction in E2E tests where the expected lengths are well-defined and documented.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:0-0
Timestamp: 2024-10-31T16:21:47.362Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, when handling the error returned by stats.Describe in the TestStressEtherWithdraw function, log the error instead of failing the test.

Learnt from: ws4charlie
PR: #2987
File: pkg/memo/codec_abi.go:0-0
Timestamp: 2024-10-10T18:50:23.406Z
Learning: The constant ABIAlignment has been moved from pkg/memo/codec_abi.go to the testutil package.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:41-42
Timestamp: 2024-10-31T16:23:17.250Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, since some goroutines may fail, we should use a mutex to append durations of successful withdrawals for accurate latency reporting.

Learnt from: ws4charlie
PR: #2987
File: testutil/sample/memo.go:0-0
Timestamp: 2024-10-10T18:54:33.554Z
Learning: In the testutil/sample/memo.go file, unchecked type assertions in the ABIPack function are acceptable because it is designed for unit tests and simplicity.

Learnt from: gartnera
PR: #3070
File: cmd/zetae2e/init.go:0-0
Timestamp: 2024-10-30T17:56:16.341Z
Learning: In code reviews for Go files like cmd/zetae2e/init.go in the ZetaChain project, avoid suggesting unrelated refactoring. Focus comments on changes relevant to the PR objectives.

Learnt from: ws4charlie
PR: #3306
File: pkg/math/integer_test.go:0-0
Timestamp: 2025-01-14T03:37:18.430Z
Learning: Use big.Int for handling large number calculations and edge cases to avoid integer overflow issues.

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

e2e/e2etests/test_bitcoin_withdraw_rbf.go (11)

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:41-42
Timestamp: 2024-10-31T16:23:17.250Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, since some goroutines may fail, we should use a mutex to append durations of successful withdrawals for accurate latency reporting.

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:184-247
Timestamp: 2024-07-05T00:02:31.446Z
Learning: The CreateSignerObserverBTC function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: gartnera
PR: #3105
File: e2e/runner/setup_bitcoin.go:51-69
Timestamp: 2024-11-06T21:10:14.301Z
Learning: In test code (e2e/runner/setup_bitcoin.go), adding security measures for private key handling in the GetBtcAddress method is not required.

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:366-371
Timestamp: 2024-09-19T18:28:58.296Z
Learning: The bitcoin.CalcDepositorFee function is covered by live tests.

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: gartnera
PR: #3632
File: zetaclient/chains/solana/signer/signer.go:304-304
Timestamp: 2025-03-04T22:39:58.395Z
Learning: The Solana signer implementation in zetaclient/chains/solana/signer/signer.go has limited test coverage, particularly for the transaction broadcasting logic with fallback scenarios. Adding this coverage has been acknowledged as a potential future improvement outside the scope of immediate fixes.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:58-59
Timestamp: 2024-10-31T16:19:26.038Z
Learning: In the Go code within e2e/utils/zetacore.go, the function WaitCctxMinedByInboundHash does not return an error.

Learnt from: ws4charlie
PR: #3306
File: zetaclient/chains/bitcoin/signer/sign.go:225-233
Timestamp: 2025-01-14T03:39:29.764Z
Learning: The signature hash calculation in Bitcoin TSS transactions using txscript.NewCannedPrevOutputFetcher([]byte{}, 0) with correct input amounts has been proven to work reliably in production, despite theoretical concerns about empty previous output fetcher.

e2e/e2etests/test_eth_withdraw_and_call_big_payload.go (10)

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:0-0
Timestamp: 2024-10-31T16:21:47.362Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, when handling the error returned by stats.Describe in the TestStressEtherWithdraw function, log the error instead of failing the test.

Learnt from: ws4charlie
PR: #4007
File: e2e/runner/sui.go:237-274
Timestamp: 2025-07-14T21:08:08.725Z
Learning: In test code for the ZetaChain project, it's acceptable to use constants for EVM and Sui address lengths rather than adding complex validation logic. This applies to functions like payload construction in E2E tests where the expected lengths are well-defined and documented.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:41-42
Timestamp: 2024-10-31T16:23:17.250Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, since some goroutines may fail, we should use a mutex to append durations of successful withdrawals for accurate latency reporting.

Learnt from: ws4charlie
PR: #2987
File: pkg/memo/codec_abi.go:0-0
Timestamp: 2024-10-10T18:50:23.406Z
Learning: The constant ABIAlignment has been moved from pkg/memo/codec_abi.go to the testutil package.

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: gartnera
PR: #3105
File: e2e/runner/setup_bitcoin.go:51-69
Timestamp: 2024-11-06T21:10:14.301Z
Learning: In test code (e2e/runner/setup_bitcoin.go), adding security measures for private key handling in the GetBtcAddress method is not required.

Learnt from: gartnera
PR: #3070
File: cmd/zetae2e/init.go:0-0
Timestamp: 2024-10-30T17:56:16.341Z
Learning: In code reviews for Go files like cmd/zetae2e/init.go in the ZetaChain project, avoid suggesting unrelated refactoring. Focus comments on changes relevant to the PR objectives.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

changelog.md (7)

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: skosito
PR: #3939
File: go.mod:52-52
Timestamp: 2025-05-30T16:31:30.275Z
Learning: The ethermint dependency updates in the zeta-chain/node repository are typically moves between feature branches and main branch of the same fork, not breaking API changes. CI status should be verified before assuming compilation issues.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: gartnera
PR: #3632
File: zetaclient/chains/solana/signer/signer.go:304-304
Timestamp: 2025-03-04T22:39:58.395Z
Learning: The Solana signer implementation in zetaclient/chains/solana/signer/signer.go has limited test coverage, particularly for the transaction broadcasting logic with fallback scenarios. Adding this coverage has been acknowledged as a potential future improvement outside the scope of immediate fixes.

Learnt from: kingpinXD
PR: #3503
File: e2e/runner/require.go:0-0
Timestamp: 2025-02-07T19:33:35.631Z
Learning: In e2e tests for the zeta-chain/node repository, minimize computation and avoid redundant checks that are already covered by unit tests to ensure faster execution. For example, ballot sorting is verified in unit tests, so e2e tests can safely assume the order.

Learnt from: lumtis
PR: #2459
File: e2e/config/config.go:285-293
Timestamp: 2024-07-11T13:10:39.153Z
Learning: Tests should not be suggested in the e2e package for the zeta-chain/node repository.

zetaclient/chains/bitcoin/observer/utxos.go (10)

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/orchestrator.go:222-237
Timestamp: 2024-07-04T23:47:56.072Z
Learning: The GetUpdatedChainObserver method in the Orchestrator class is covered by unit tests in zetaclient/orchestrator/orchestrator_test.go and zetaclient/orchestrator/chain_activate_test.go.

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:184-247
Timestamp: 2024-07-05T00:02:31.446Z
Learning: The CreateSignerObserverBTC function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: ws4charlie
PR: #3306
File: zetaclient/chains/bitcoin/observer/db.go:11-25
Timestamp: 2025-01-14T00:09:01.416Z
Learning: In Bitcoin observer, non-critical DB operations (like saving broadcasted transactions) should log errors but not return them to callers, as the errors are already handled appropriately through logging and don't affect the critical in-memory state.

Learnt from: gartnera
PR: #3228
File: zetaclient/orchestrator/orchestrator.go:388-401
Timestamp: 2024-11-27T22:01:49.732Z
Learning: When reviewing code changes in zetaclient/orchestrator/orchestrator.go, avoid suggesting refactoring that is unrelated to the current PR.

Learnt from: ws4charlie
PR: #3306
File: zetaclient/chains/bitcoin/signer/sign.go:225-233
Timestamp: 2025-01-14T03:39:29.764Z
Learning: The signature hash calculation in Bitcoin TSS transactions using txscript.NewCannedPrevOutputFetcher([]byte{}, 0) with correct input amounts has been proven to work reliably in production, despite theoretical concerns about empty previous output fetcher.

Learnt from: ws4charlie
PR: #3306
File: zetaclient/chains/bitcoin/signer/sign.go:43-43
Timestamp: 2025-01-13T23:25:05.336Z
Learning: In the Bitcoin implementation, UTXO amounts are represented as float64 to maintain compatibility with Bitcoin Core's JSON-RPC interface through btcd's ListUnspentResult struct, even though integer arithmetic would typically be preferred for cryptocurrency amounts.

Learnt from: ws4charlie
PR: #3381
File: zetaclient/chains/bitcoin/signer/outbound_data.go:29-29
Timestamp: 2025-01-21T04:34:47.335Z
Learning: In Bitcoin UTXO handling code, float64 must be used for amount fields as it's required by Bitcoin's RPC interface (btcd/btcjson.ListUnspentResult). While floating-point is generally avoided for monetary calculations, Bitcoin's RPC represents amounts in BTC as float64 values, making it a necessary exception in UTXO-related code.

e2e/e2etests/helpers.go (3)

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: ws4charlie
PR: #4007
File: e2e/runner/sui.go:237-274
Timestamp: 2025-07-14T21:08:08.725Z
Learning: In test code for the ZetaChain project, it's acceptable to use constants for EVM and Sui address lengths rather than adding complex validation logic. This applies to functions like payload construction in E2E tests where the expected lengths are well-defined and documented.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:0-0
Timestamp: 2024-10-31T16:21:47.362Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, when handling the error returned by stats.Describe in the TestStressEtherWithdraw function, log the error instead of failing the test.

e2e/e2etests/test_bitcoin_std_memo_inscribed_deposit_and_call.go (13)

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:366-371
Timestamp: 2024-09-19T18:28:58.296Z
Learning: The bitcoin.CalcDepositorFee function is covered by live tests.

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: ws4charlie
PR: #2987
File: testutil/sample/memo.go:0-0
Timestamp: 2024-10-10T18:54:33.554Z
Learning: In the testutil/sample/memo.go file, unchecked type assertions in the ABIPack function are acceptable because it is designed for unit tests and simplicity.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:184-247
Timestamp: 2024-07-05T00:02:31.446Z
Learning: The CreateSignerObserverBTC function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: gartnera
PR: #3105
File: e2e/runner/setup_bitcoin.go:51-69
Timestamp: 2024-11-06T21:10:14.301Z
Learning: In test code (e2e/runner/setup_bitcoin.go), adding security measures for private key handling in the GetBtcAddress method is not required.

Learnt from: ws4charlie
PR: #2987
File: pkg/memo/codec_abi.go:0-0
Timestamp: 2024-10-10T18:50:23.406Z
Learning: The constant ABIAlignment has been moved from pkg/memo/codec_abi.go to the testutil package.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:37-38
Timestamp: 2024-09-19T18:22:35.964Z
Learning: In BTCInboundEvent, it's acceptable to use float64 for monetary values (Value and DepositorFee) because precision is ensured through conversion to integer when building the vote message.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:0-0
Timestamp: 2024-10-31T16:21:47.362Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, when handling the error returned by stats.Describe in the TestStressEtherWithdraw function, log the error instead of failing the test.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:116-181
Timestamp: 2024-07-05T00:02:36.493Z
Learning: The CreateSignerObserverEVM function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: fbac
PR: #2979
File: x/fungible/keeper/zrc20_unlock_token.go:69-72
Timestamp: 2024-10-08T14:57:52.954Z
Learning: In x/fungible/keeper/zrc20_unlock_token.go, when performing type assertions like transferred, ok := ret[0].(bool), using the ok check is sufficient to prevent panics, and additional type handling is not required.

e2e/e2etests/test_bitcoin_std_deposit_and_call.go (13)

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:366-371
Timestamp: 2024-09-19T18:28:58.296Z
Learning: The bitcoin.CalcDepositorFee function is covered by live tests.

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: gartnera
PR: #3105
File: e2e/runner/setup_bitcoin.go:51-69
Timestamp: 2024-11-06T21:10:14.301Z
Learning: In test code (e2e/runner/setup_bitcoin.go), adding security measures for private key handling in the GetBtcAddress method is not required.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:0-0
Timestamp: 2024-10-31T16:21:47.362Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, when handling the error returned by stats.Describe in the TestStressEtherWithdraw function, log the error instead of failing the test.

Learnt from: ws4charlie
PR: #2987
File: testutil/sample/memo.go:0-0
Timestamp: 2024-10-10T18:54:33.554Z
Learning: In the testutil/sample/memo.go file, unchecked type assertions in the ABIPack function are acceptable because it is designed for unit tests and simplicity.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:184-247
Timestamp: 2024-07-05T00:02:31.446Z
Learning: The CreateSignerObserverBTC function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:37-38
Timestamp: 2024-09-19T18:22:35.964Z
Learning: In BTCInboundEvent, it's acceptable to use float64 for monetary values (Value and DepositorFee) because precision is ensured through conversion to integer when building the vote message.

Learnt from: ws4charlie
PR: #2987
File: pkg/memo/codec_abi.go:0-0
Timestamp: 2024-10-10T18:50:23.406Z
Learning: The constant ABIAlignment has been moved from pkg/memo/codec_abi.go to the testutil package.

Learnt from: ws4charlie
PR: #3381
File: zetaclient/chains/bitcoin/signer/outbound_data.go:29-29
Timestamp: 2025-01-21T04:34:47.335Z
Learning: In Bitcoin UTXO handling code, float64 must be used for amount fields as it's required by Bitcoin's RPC interface (btcd/btcjson.ListUnspentResult). While floating-point is generally avoided for monetary calculations, Bitcoin's RPC represents amounts in BTC as float64 values, making it a necessary exception in UTXO-related code.

Learnt from: ws4charlie
PR: #2987
File: testutil/sample/memo.go:108-109
Timestamp: 2024-10-10T19:00:07.093Z
Learning: In testutil/sample/memo.go, BigEndian is used for ABI encoding functions, consistent with ABI specifications, whereas LittleEndian is used in compact encoding functions as appropriate.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

e2e/runner/bitcoin.go (17)

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:366-371
Timestamp: 2024-09-19T18:28:58.296Z
Learning: The bitcoin.CalcDepositorFee function is covered by live tests.

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:37-38
Timestamp: 2024-09-19T18:22:35.964Z
Learning: In BTCInboundEvent, it's acceptable to use float64 for monetary values (Value and DepositorFee) because precision is ensured through conversion to integer when building the vote message.

Learnt from: gartnera
PR: #3105
File: e2e/runner/setup_bitcoin.go:51-69
Timestamp: 2024-11-06T21:10:14.301Z
Learning: In test code (e2e/runner/setup_bitcoin.go), adding security measures for private key handling in the GetBtcAddress method is not required.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #3306
File: zetaclient/chains/bitcoin/observer/outbound.go:28-32
Timestamp: 2025-01-13T23:51:09.334Z
Learning: In Bitcoin observer, minTxConfirmations is set to 0 to allow observing mempool transactions without waiting for block confirmations, which is necessary due to Bitcoin's 10-minute block time. This is a deliberate design choice despite potential security implications, as other safety checks are in place through TSS validation.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:41-42
Timestamp: 2024-10-31T16:23:17.250Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, since some goroutines may fail, we should use a mutex to append durations of successful withdrawals for accurate latency reporting.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:58-59
Timestamp: 2024-10-31T16:19:26.038Z
Learning: In the Go code within e2e/utils/zetacore.go, the function WaitCctxMinedByInboundHash does not return an error.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:184-247
Timestamp: 2024-07-05T00:02:31.446Z
Learning: The CreateSignerObserverBTC function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: ws4charlie
PR: #2987
File: testutil/sample/memo.go:0-0
Timestamp: 2024-10-10T18:54:33.554Z
Learning: In the testutil/sample/memo.go file, unchecked type assertions in the ABIPack function are acceptable because it is designed for unit tests and simplicity.

Learnt from: gartnera
PR: #3105
File: cmd/zetae2e/local/bitcoin.go:8-8
Timestamp: 2024-11-06T21:11:34.420Z
Learning: In the e2e codebase, it's acceptable to use github.com/stretchr/testify/require outside of test files.

Learnt from: ws4charlie
PR: #3306
File: pkg/math/integer_test.go:0-0
Timestamp: 2025-01-14T03:37:18.430Z
Learning: Use big.Int for handling large number calculations and edge cases to avoid integer overflow issues.

Learnt from: gartnera
PR: #3632
File: zetaclient/chains/solana/signer/signer.go:304-304
Timestamp: 2025-03-04T22:39:58.395Z
Learning: The Solana signer implementation in zetaclient/chains/solana/signer/signer.go has limited test coverage, particularly for the transaction broadcasting logic with fallback scenarios. Adding this coverage has been acknowledged as a potential future improvement outside the scope of immediate fixes.

Learnt from: gartnera
PR: #3395
File: .github/workflows/reusable-sim.yml:29-30
Timestamp: 2025-01-22T22:46:58.820Z
Learning: The zeta-chain/node repository uses Go version >= 1.22. Do not suggest downgrading to earlier versions like 1.21.

Learnt from: ws4charlie
PR: #3306
File: zetaclient/chains/bitcoin/signer/sign.go:225-233
Timestamp: 2025-01-14T03:39:29.764Z
Learning: The signature hash calculation in Bitcoin TSS transactions using txscript.NewCannedPrevOutputFetcher([]byte{}, 0) with correct input amounts has been proven to work reliably in production, despite theoretical concerns about empty previous output fetcher.

e2e/e2etests/test_bitcoin_deposit_call.go (15)

Learnt from: ws4charlie
PR: #2870
File: zetaclient/orchestrator/orchestrator.go:413-413
Timestamp: 2024-09-13T22:29:09.747Z
Learning: When a method is renamed (e.g., IsUTXO() to IsBitcoin()), and existing tests cover the affected code paths, do not request additional tests for the renamed methods.

Learnt from: ws4charlie
PR: #2899
File: zetaclient/chains/bitcoin/observer/inbound.go:366-371
Timestamp: 2024-09-19T18:28:58.296Z
Learning: The bitcoin.CalcDepositorFee function is covered by live tests.

Learnt from: gartnera
PR: #3105
File: e2e/runner/setup_bitcoin.go:51-69
Timestamp: 2024-11-06T21:10:14.301Z
Learning: In test code (e2e/runner/setup_bitcoin.go), adding security measures for private key handling in the GetBtcAddress method is not required.

Learnt from: gartnera
PR: #3079
File: e2e/e2etests/test_pause_erc20_custody.go:65-68
Timestamp: 2024-11-01T17:07:59.584Z
Learning: In the file e2e/e2etests/test_pause_erc20_custody.go, prefer verbosity and avoid extracting common event handling logic into helper functions to enhance readability and ease future refactoring.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:184-247
Timestamp: 2024-07-05T00:02:31.446Z
Learning: The CreateSignerObserverBTC function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: gartnera
PR: #3071
File: e2e/e2etests/test_stress_eth_withdraw.go:0-0
Timestamp: 2024-10-31T16:21:47.362Z
Learning: In e2e/e2etests/test_stress_eth_withdraw.go, when handling the error returned by stats.Describe in the TestStressEtherWithdraw function, log the error instead of failing the test.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-09-23T19:51:43.360Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: ws4charlie
PR: #2907
File: zetaclient/chains/bitcoin/observer/outbound_test.go:81-82
Timestamp: 2024-10-08T15:34:48.217Z
Learning: In the mineTxNSetNonceMark function within bitcoin/observer/outbound_test.go, it's acceptable to hardcode the chain ID, as the tests do not require varying chain IDs.

Learnt from: gartnera
PR: #3070
File: cmd/zetae2e/init.go:0-0
Timestamp: 2024-10-30T17:56:16.341Z
Learning: In code reviews for Go files like cmd/zetae2e/init.go in the ZetaChain project, avoid suggesting unrelated refactoring. Focus comments on changes relevant to the PR objectives.

Learnt from: gartnera
PR: #3632
File: zetaclient/chains/solana/signer/signer.go:304-304
Timestamp: 2025-03-04T22:39:58.395Z
Learning: The Solana signer implementation in zetaclient/chains/solana/signer/signer.go has limited test coverage, particularly for the transaction broadcasting logic with fallback scenarios. Adding this coverage has been acknowledged as a potential future improvement outside the scope of immediate fixes.

Learnt from: ws4charlie
PR: #2987
File: testutil/sample/memo.go:0-0
Timestamp: 2024-10-10T18:54:33.554Z
Learning: In the testutil/sample/memo.go file, unchecked type assertions in the ABIPack function are acceptable because it is designed for unit tests and simplicity.

Learnt from: gartnera
PR: #3105
File: cmd/zetae2e/local/bitcoin.go:8-8
Timestamp: 2024-11-06T21:11:34.420Z
Learning: In the e2e codebase, it's acceptable to use github.com/stretchr/testify/require outside of test files.

Learnt from: ws4charlie
PR: #3306
File: zetaclient/chains/bitcoin/signer/sign.go:225-233
Timestamp: 2025-01-14T03:39:29.764Z
Learning: The signature hash calculation in Bitcoin TSS transactions using txscript.NewCannedPrevOutputFetcher([]byte{}, 0) with correct input amounts has been proven to work reliably in production, despite theoretical concerns about empty previous output fetcher.

Learnt from: ws4charlie
PR: #2411
File: zetaclient/orchestrator/chain_activate.go:116-181
Timestamp: 2024-07-05T00:02:36.493Z
Learning: The CreateSignerObserverEVM function in zetaclient/orchestrator/chain_activate.go is covered by unit tests in zetaclient/orchestrator/chain_activate_test.go.

Learnt from: ws4charlie
PR: #3306
File: pkg/math/integer_test.go:0-0
Timestamp: 2025-01-14T03:37:18.430Z
Learning: Use big.Int for handling large number calculations and edge cases to avoid integer overflow issues.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Cursor Bugbot
  • GitHub Check: start-e2e-test / e2e
  • GitHub Check: gosec
  • GitHub Check: build-and-test
  • GitHub Check: analyze (go)
🔇 Additional comments (9)
e2e/e2etests/test_eth_deposit_and_call_big_payload.go (1)

26-27: LGTM! Payload size update aligns with gateway capabilities.

The increase from 1440 to 2880 bytes correctly reflects the current maximum allowed payload size in the gateway, ensuring comprehensive testing coverage.

e2e/e2etests/test_eth_withdraw_and_call_big_payload.go (1)

26-27: LGTM! Consistent payload size update maintains test uniformity.

The payload size increase mirrors the deposit test changes, ensuring both deposit and withdrawal flows are tested with the same maximum gateway payload capacity.

changelog.md (1)

37-37: LGTM! Changelog entry accurately reflects the PR objectives.

The addition correctly documents the Bitcoin inscription e2e test improvements for live network compatibility in the appropriate Tests section.

e2e/e2etests/test_bitcoin_withdraw_rbf.go (1)

34-36: LGTM! Synchronization improvement enhances test reliability.

The addition of the block wait after CCTX initiation prevents potential race conditions by ensuring on-chain confirmation before proceeding with outbound tracker operations. The 20-second timeout provides adequate buffer for test execution.

zetaclient/chains/bitcoin/observer/utxos.go (1)

32-35: LGTM! Node readiness check prevents unnecessary operations.

The early exit condition appropriately avoids expensive Bitcoin RPC queries when the node is not ready, improving performance and operational robustness without treating the unavailable state as an error condition.

e2e/e2etests/test_bitcoin_std_memo_inscribed_deposit_and_call.go (1)

17-68: LGTM! Clean refactoring of the inscription test.

The changes effectively simplify the test by:

  • Using dynamic fee estimation instead of hardcoded values
  • Leveraging predefined test DApp addresses
  • Properly calculating received amounts from raw transactions
  • Adding comprehensive balance verification

The comment accurately documents the memo structure (125 bytes total).

e2e/e2etests/test_bitcoin_deposit_call.go (1)

17-55: LGTM! Consistent refactoring pattern.

The test follows the same improved pattern as other Bitcoin tests:

  • Proper satoshi conversion with error handling
  • Dynamic payload sizing using protocol constants
  • Pre and post-transaction verification
  • Accurate received amount calculation from raw transactions

Good use of txscript.MaxDataCarrierSize constant for payload size calculation.

e2e/e2etests/test_bitcoin_std_deposit_and_call.go (1)

16-65: LGTM! Well-structured standard memo test.

The refactoring maintains consistency across all Bitcoin deposit tests:

  • Accurate memo size calculation (80 bytes total)
  • Proper amount handling in satoshis
  • Comprehensive balance verification
  • Clear separation of arrangement, action, and assertion phases

The comment correctly documents the memo structure breakdown.

e2e/runner/bitcoin.go (1)

481-512: LGTM! Excellent addition of robust transaction handling utilities.

The new helper methods significantly improve the E2E test infrastructure:

  • WaitForTxInclusion: Provides reliable polling-based confirmation with proper timeout handling
  • CalcReceivedAmount: Accurately calculates net amounts after fee deduction
  • EstimateFeeRate: Smart fee estimation with fallback for local networks

These utilities effectively support the test refactoring objectives.

Also applies to: 514-548

@github-actions
Copy link

!!!WARNING!!!
nosec detected in the following files: e2e/e2etests/test_bitcoin_std_memo_inscribed_deposit_and_call.go

Be very careful about using #nosec in code. It can be a quick way to suppress security warnings and move forward with development, it should be employed with caution. Suppressing warnings with #nosec can hide potentially serious vulnerabilities. Only use #nosec when you're absolutely certain that the security issue is either a false positive or has been mitigated in another way.

Only suppress a single rule (or a specific set of rules) within a section of code, while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within the #nosec annotation, e.g: /* #nosec G401 */ or //#nosec G201 G202 G203
Broad #nosec annotations should be avoided, as they can hide other vulnerabilities. The CI will block you from merging this PR until you remove #nosec annotations that do not target specific rules.

Pay extra attention to the way #nosec is being used in the files listed above.

@github-actions github-actions bot added the nosec label Jul 22, 2025
Copy link
Contributor

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

LGTM if it has been tested on testnet

@ws4charlie
Copy link
Contributor Author

LGTM if it has been tested on testnet

Currently there isn't a way to run e2e test on a custom branch (I tried) until we push it to develop branch, but I will follow up on this test.

@ws4charlie ws4charlie enabled auto-merge July 24, 2025 20:49
@ws4charlie ws4charlie added this pull request to the merge queue Jul 24, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jul 24, 2025
…ve network (#4040)

* make btc inscription based depositAndCall compatible for live network E2E test

* add changelog entry

* fix gosec error

* use SelectUTXOs func to select UTXOs in E2E test

* improve naming of helper functions in E2E runner
@github-actions github-actions bot added the MERGE_FAILED Merge Queue CI failed label Jul 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 24, 2025
@ws4charlie ws4charlie enabled auto-merge July 24, 2025 21:44
@ws4charlie ws4charlie added this pull request to the merge queue Jul 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 24, 2025
@ws4charlie ws4charlie added this pull request to the merge queue Jul 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 24, 2025
@ws4charlie ws4charlie enabled auto-merge July 24, 2025 23:06
@ws4charlie ws4charlie added this pull request to the merge queue Jul 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 24, 2025
@ws4charlie ws4charlie added this pull request to the merge queue Jul 24, 2025
Merged via the queue into develop with commit 0612a3e Jul 25, 2025
47 of 48 checks passed
@ws4charlie ws4charlie deleted the e2e-make-btc-inscription-deposit-work-for-nightly-test branch July 25, 2025 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chain:bitcoin Bitcoin chain related MERGE_FAILED Merge Queue CI failed nosec refactor test Tests related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Bitcoin deposit and withdraw tests through inscription into E2E live networks

3 participants