Skip to content

feat: Sui withdraw and authenticated call#4007

Merged
ws4charlie merged 27 commits intodevelopfrom
feat-sui-authenticated-call
Jul 17, 2025
Merged

feat: Sui withdraw and authenticated call#4007
ws4charlie merged 27 commits intodevelopfrom
feat-sui-authenticated-call

Conversation

@ws4charlie
Copy link
Contributor

@ws4charlie ws4charlie commented Jul 9, 2025

Description

This PR is still in the progress of development.

What's done

  • Upgrade Sui local net version to mainnet v1.51.5, otherwise compile will fail.
  • Develop a new Example package for authenticated call.
  • Dynamically build and deploy the authenticated call Example package in E2E environment.
  • Implement Sui authenticated call in the zetaclient.
  • Add unit tests.
  • Update below E2E tests to adopt authenticated call:
    - sui_withdraw_and_call
    - sui_withdraw_and_call_revert_with_call
    - sui_token_withdraw_and_call
    - sui_token_withdraw_and_call_revert_with_call

Closes: #3825

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

  • New Features

    • Added support for Sui withdraw and authenticated call functionality, enabling atomic token withdrawals and authenticated smart contract calls on Sui.
    • Introduced new Move modules and contracts for authenticated call scenarios, including new message context management and enhanced gateway logic.
    • Expanded end-to-end tests to cover authenticated calls, arbitrary calls, and revert scenarios for both Sui and fungible tokens.
  • Bug Fixes

    • Improved error handling and retry logic for Sui command execution.
  • Refactor

    • Unified Sui withdraw and withdraw-and-call logic to support arbitrary ZRC20 tokens and parameterized payloads.
    • Updated gateway address handling to use a triplet format including message context ID.
    • Streamlined deployment, configuration, and test utilities to support new contract structures and scenarios.
  • Documentation

    • Added and updated documentation for new Sui contract features and transaction flows.
  • Chores

    • Updated Docker and build scripts for reproducible Sui contract builds.
    • Enhanced .gitignore and configuration files for new contract directories.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 9, 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 change introduces support for authenticated calls with Sui, adding a new MessageContext object and associated logic in the Sui gateway, Move contracts, orchestrator, and end-to-end tests. It generalizes withdraw and withdraw-and-call flows to support both arbitrary and authenticated calls, extends configuration and deployment scripts, and adds comprehensive test coverage for these scenarios.

Changes

File(s) / Path(s) Change Summary
e2e/contracts/sui/example-authenticated-call/, e2e/contracts/sui/example-arbitrary-call/, e2e/contracts/sui/bin/, e2e/contracts/sui/protocol-contracts-sui-upgrade/, e2e/contracts/sui/example/ Added new Move modules and build assets for authenticated/arbitrary call examples, updated manifests, and adjusted .gitignore handling.
e2e/contracts/sui/bin.go
e2e/contracts/sui/bin/bin.go
Removed old binary embedding, added new binary embedding and utility for Move contract bytecode.
e2e/contracts/sui/protocol-contracts-sui-upgrade/sources/gateway.move
e2e/contracts/sui/example-authenticated-call/sources/*.move
Added MessageContext struct, authenticated call logic, and related entry functions in Move modules.
e2e/config/config.go, e2e/runner/runner.go, e2e/runner/setup_sui.go, e2e/runner/sui.go, e2e/runner/sui_gateway_upgrade.go, cmd/zetae2e/config/config.go, cmd/zetae2e/config/contracts.go Extended configuration and runner logic to support new MessageContext and separate example contracts for arbitrary and authenticated calls.
e2e/e2etests/test_sui_authenticated_call*.go, e2e/e2etests/test_sui_token_authenticated_call*.go Added new E2E tests for authenticated call and revert scenarios for both SUI and fungible tokens.
e2e/e2etests/test_sui_withdraw*.go, e2e/e2etests/test_sui_token_withdraw*.go Refactored withdraw and withdraw-and-call tests to use generalized methods and support new call options and parameters.
e2e/e2etests/e2etests.go, cmd/zetae2e/local/local.go Registered new test cases and updated test argument handling for Sui authenticated/arbitrary call scenarios.
pkg/contracts/sui/gateway.go, pkg/contracts/sui/withdraw_and_call.go, pkg/contracts/sui/errors.go Added MessageContext handling, refactored gateway creation and event parsing, expanded error handling for new command indices.
pkg/contracts/sui/gateway_test.go, pkg/contracts/sui/withdraw_and_call_test.go, pkg/contracts/sui/errors_test.go Updated tests for gateway and withdraw-and-call logic, including new command counts and error handling.
zetaclient/chains/sui/signer/*.go, zetaclient/chains/sui/observer/*.go, zetaclient/chains/sui/client/client_live_test.go, zetaclient/chains/sui/signer/withdraw_and_call_test.go Refactored signer logic to support authenticated/arbitrary call PTB construction, updated observer and client tests for new gateway format.
zetaclient/orchestrator/bootstrap.go, zetaclient/testutils/constant.go Updated gateway address handling to include MessageContextID, extended constants.
contrib/localnet/docker-compose.yml, contrib/localnet/orchestrator/Dockerfile.fastbuild Updated Sui image references to immutable digests, included new contract directories in build context.
changelog.md Changelog entry for Sui withdraw and authenticated call support.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ZEVM
    participant SuiGateway
    participant MessageContext
    participant ConnectedModule

    User->>ZEVM: Initiate withdrawAndCall (with payload)
    ZEVM->>SuiGateway: Submit PTB (withdraw, set_message_context, call, reset_message_context)
    SuiGateway->>MessageContext: set_message_context(sender, target)
    SuiGateway->>ConnectedModule: on_call(gateway, messageContext, coins, payload)
    ConnectedModule->>MessageContext: Validate sender/target
    ConnectedModule-->>SuiGateway: on_call result
    SuiGateway->>MessageContext: reset_message_context()
Loading

Assessment against linked issues

Objective (Issue #) Addressed Explanation
Add MessageContext object and active_message_context_id in Sui Gateway (#3825)
Implement PTB flow: withdraw, set_message_context, on_call, reset_message_context (#3825)
Pass MessageContext and Gateway to on_call; validate sender, target, and object ID (#3825)
Update E2E and integration tests for authenticated call scenarios (#3825)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes were detected.

Possibly related PRs

  • zeta-chain/node#3534: Adds Sui deposit and depositAndCall event observation and gateway event parsing, which is related at the gateway event parsing and Sui gateway integration level, though it addresses deposit rather than withdraw/authenticated call logic.

Suggested reviewers

  • lumtis
  • skosito

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

@ws4charlie ws4charlie added chain:sui SUI_TESTS Run make start-sui-tests labels Jul 9, 2025
@codecov
Copy link

codecov bot commented Jul 9, 2025

Codecov Report

❌ Patch coverage is 69.96047% with 76 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.94%. Comparing base (48a661c) to head (7143099).
⚠️ Report is 102 commits behind head on develop.

Files with missing lines Patch % Lines
zetaclient/chains/sui/signer/withdraw_and_call.go 75.15% 27 Missing and 12 partials ⚠️
zetaclient/chains/sui/signer/signer_tx.go 18.51% 21 Missing and 1 partial ⚠️
zetaclient/chains/sui/signer/tss_owned_object.go 75.80% 10 Missing and 5 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4007      +/-   ##
===========================================
- Coverage    64.95%   64.94%   -0.02%     
===========================================
  Files          475      475              
  Lines        34979    35100     +121     
===========================================
+ Hits         22721    22794      +73     
- Misses       11205    11241      +36     
- Partials      1053     1065      +12     
Files with missing lines Coverage Δ
zetaclient/chains/sui/observer/inbound.go 64.47% <100.00%> (ø)
zetaclient/chains/sui/signer/signer.go 47.45% <100.00%> (+0.44%) ⬆️
zetaclient/chains/sui/signer/tss_owned_object.go 75.80% <75.80%> (ø)
zetaclient/chains/sui/signer/signer_tx.go 47.10% <18.51%> (-2.90%) ⬇️
zetaclient/chains/sui/signer/withdraw_and_call.go 77.61% <75.15%> (-2.39%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

github-actions bot commented Jul 9, 2025

!!!WARNING!!!
nosec detected in the following files: e2e/runner/sui_gateway_upgrade.go, e2e/contracts/sui/bin/bin.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 9, 2025
@ws4charlie ws4charlie marked this pull request as ready for review July 14, 2025 05:10
@ws4charlie ws4charlie requested a review from a team as a code owner July 14, 2025 05:10
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: 3

♻️ Duplicate comments (1)
zetaclient/chains/sui/signer/withdraw_and_call.go (1)

56-56: Address potential integer overflow in allocation.

While unlikely in practice, the allocation size computation could overflow:

 // Build the type arguments for on_call in order: [withdrawn coin type, ... payload type arguments]
+if len(typeArgsStr) > 1000 {
+    return nil, errors.New("too many type arguments")
+}
 onCallTypeArgs := make([]sui.TypeTag, 0, len(typeArgsStr)+1)
🧹 Nitpick comments (7)
contrib/localnet/orchestrator/Dockerfile.fastbuild (2)

6-6: Un-pinned zetanode:latest reduces reproducibility.

latest can change at any time, yielding non-deterministic images and hard-to-debug CI failures. Consider pinning it to a specific version tag or digest, similar to the Sui image.

-FROM zetanode:latest
+# TODO: replace with a fixed tag/digest once available
+FROM zetanode:<version-or-digest>

17-18: Context bloat risk when copying the whole example directory.

e2e/contracts/sui/example-authenticated-call contains build/ artefacts that can grow large.
Although they’re ignored by .gitignore, they are still sent to the Docker daemon unless excluded via .dockerignore.

Add a project-root .dockerignore (or extend an existing one) with:

e2e/contracts/sui/**/build

to keep the build context lean.

e2e/contracts/sui/example-arbitrary-call/Makefile (1)

1-22: LGTM: Well-structured Makefile for Move package automation.

The Makefile correctly automates the build process and bytecode management for the arbitrary call example. The target structure is clean and the file naming convention is consistent.

Consider adding a test target to address the static analysis hint:

+# Run tests
+test:
+	sui move test
+
 # Help target
 help:
 	@echo "Available targets:"
 	@echo "  all    - Clean and build everything (default)"
 	@echo "  clean  - Remove build directory"
 	@echo "  build  - Build the package and generate bytecode"
+	@echo "  test   - Run Move tests"
 	@echo "  help   - Show this help message"
e2e/contracts/sui/example-authenticated-call/Move.toml (1)

1-39: LGTM: Properly configured Move package manifest.

The manifest correctly defines dependencies and addresses for the authenticated call example. Using Sui mainnet version v1.49.2 aligns with the PR's upgrade objectives.

Consider using a more descriptive package name to distinguish from the arbitrary call example:

 [package]
-name = "example"
+name = "example-authenticated-call"

This would improve clarity when debugging or maintaining multiple example packages.

e2e/contracts/sui/example-authenticated-call/README.md (1)

1-69: Excellent documentation with minor formatting improvement needed.

The README provides comprehensive coverage of the withdrawAndCall functionality, clearly explaining the transaction flow and PTB structure. This will be valuable for developers implementing or debugging authenticated calls.

Fix the code block language specification:

-```
+```move
 PTB {
     // Command 0: Withdraw Implementation
e2e/contracts/sui/example-authenticated-call/sources/example.move (1)

106-124: Consider a more flexible payload structure for future extensibility.

The current implementation uses a fixed 106-byte payload structure. While functional, this approach lacks extensibility for future enhancements.

Consider implementing a versioned payload structure or using a more flexible encoding scheme (e.g., length-prefixed fields) to accommodate future changes without breaking compatibility.

e2e/runner/setup_sui.go (1)

145-160: Consider adding error context to build failures.

The build helper logs output but could provide more context on failure:

 // run command and show output
 output, err := cmdBuild.CombinedOutput()
 r.Logger.Info("sui move build output for: %s\n%s", path, string(output))
-require.NoError(r, err, "unable to build sui package: "+path)
+if err != nil {
+    require.NoError(r, err, fmt.Sprintf("unable to build sui package %s: %s", path, string(output)))
+}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f278971 and 358956f.

⛔ Files ignored due to path filters (1)
  • e2e/contracts/sui/example/Move.lock is excluded by !**/*.lock
📒 Files selected for processing (54)
  • changelog.md (1 hunks)
  • cmd/zetae2e/config/config.go (1 hunks)
  • cmd/zetae2e/config/contracts.go (2 hunks)
  • cmd/zetae2e/local/local.go (1 hunks)
  • contrib/localnet/docker-compose.yml (1 hunks)
  • contrib/localnet/orchestrator/Dockerfile.fastbuild (2 hunks)
  • e2e/config/config.go (1 hunks)
  • e2e/contracts/sui/bin.go (0 hunks)
  • e2e/contracts/sui/bin/bin.go (1 hunks)
  • e2e/contracts/sui/example-arbitrary-call/.gitignore (1 hunks)
  • e2e/contracts/sui/example-arbitrary-call/Makefile (1 hunks)
  • e2e/contracts/sui/example-authenticated-call/.gitignore (1 hunks)
  • e2e/contracts/sui/example-authenticated-call/Makefile (1 hunks)
  • e2e/contracts/sui/example-authenticated-call/Move.toml (1 hunks)
  • e2e/contracts/sui/example-authenticated-call/README.md (1 hunks)
  • e2e/contracts/sui/example-authenticated-call/sources/example.move (1 hunks)
  • e2e/contracts/sui/example-authenticated-call/sources/token.move (1 hunks)
  • e2e/contracts/sui/example/.gitignore (0 hunks)
  • e2e/contracts/sui/protocol-contracts-sui-upgrade/Move.toml (1 hunks)
  • e2e/contracts/sui/protocol-contracts-sui-upgrade/sources/gateway.move (9 hunks)
  • e2e/e2etests/e2etests.go (5 hunks)
  • e2e/e2etests/test_stress_sui_withdraw.go (1 hunks)
  • e2e/e2etests/test_sui_authenticated_call.go (1 hunks)
  • e2e/e2etests/test_sui_authenticated_call_revert_with_call.go (1 hunks)
  • e2e/e2etests/test_sui_token_authenticated_call.go (1 hunks)
  • e2e/e2etests/test_sui_token_authenticated_call_revert_with_call.go (1 hunks)
  • e2e/e2etests/test_sui_token_withdraw.go (2 hunks)
  • e2e/e2etests/test_sui_token_withdraw_and_call.go (3 hunks)
  • e2e/e2etests/test_sui_token_withdraw_and_call_revert_with_call.go (2 hunks)
  • e2e/e2etests/test_sui_withdraw.go (1 hunks)
  • e2e/e2etests/test_sui_withdraw_and_call.go (3 hunks)
  • e2e/e2etests/test_sui_withdraw_and_call_revert_with_call.go (2 hunks)
  • e2e/e2etests/test_sui_withdraw_invalid_receiver.go (1 hunks)
  • e2e/e2etests/test_sui_withdraw_restricted_address.go (1 hunks)
  • e2e/e2etests/test_sui_withdraw_revert_with_call.go (1 hunks)
  • e2e/runner/runner.go (3 hunks)
  • e2e/runner/setup_sui.go (14 hunks)
  • e2e/runner/sui.go (5 hunks)
  • e2e/runner/sui_gateway_upgrade.go (4 hunks)
  • pkg/contracts/sui/errors.go (1 hunks)
  • pkg/contracts/sui/errors_test.go (2 hunks)
  • pkg/contracts/sui/gateway.go (7 hunks)
  • pkg/contracts/sui/gateway_test.go (3 hunks)
  • pkg/contracts/sui/withdraw_and_call.go (3 hunks)
  • pkg/contracts/sui/withdraw_and_call_test.go (2 hunks)
  • zetaclient/chains/sui/client/client_live_test.go (2 hunks)
  • zetaclient/chains/sui/observer/inbound.go (1 hunks)
  • zetaclient/chains/sui/observer/observer_test.go (6 hunks)
  • zetaclient/chains/sui/signer/signer_test.go (1 hunks)
  • zetaclient/chains/sui/signer/signer_tx.go (11 hunks)
  • zetaclient/chains/sui/signer/withdraw_and_call.go (12 hunks)
  • zetaclient/chains/sui/signer/withdraw_and_call_test.go (14 hunks)
  • zetaclient/orchestrator/bootstrap.go (1 hunks)
  • zetaclient/testutils/constant.go (2 hunks)
💤 Files with no reviewable changes (2)
  • e2e/contracts/sui/example/.gitignore
  • e2e/contracts/sui/bin.go
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go

Instructions used from:

Sources:
⚙️ CodeRabbit Configuration File

🧠 Learnings (46)
📓 Common learnings
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#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: zeta-chain/node#3489
File: pkg/chains/chains.go:0-0
Timestamp: 2025-02-06T15:31:32.723Z
Learning: SuiMainnet uses chain ID 105 (temporarily) instead of 101 to avoid collision with ZetaChainPrivnet. This is tracked in issue #3491 for proper resolution.
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: 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#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: lumtis
PR: zeta-chain/node#3500
File: pkg/contracts/sui/gateway.go:62-62
Timestamp: 2025-02-12T13:42:27.999Z
Learning: The `from` and `to` parameters in the `queryInbounds` function of the Sui gateway are temporary placeholders that will be removed or implemented in a future PR.
changelog.md (2)
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#3489
File: pkg/chains/chains.go:0-0
Timestamp: 2025-02-06T15:31:32.723Z
Learning: SuiMainnet uses chain ID 105 (temporarily) instead of 101 to avoid collision with ZetaChainPrivnet. This is tracked in issue #3491 for proper resolution.
contrib/localnet/orchestrator/Dockerfile.fastbuild (4)
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: gartnera
PR: zeta-chain/node#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: 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: skosito
PR: zeta-chain/node#3217
File: cmd/zetae2e/config/local.yml:6-7
Timestamp: 2024-11-26T15:01:35.685Z
Learning: In `cmd/zetae2e/config/local.yml`, including private keys is acceptable because the file is used only for local end-to-end tests and already includes other private keys.
zetaclient/chains/sui/signer/signer_test.go (11)
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: 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#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: 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`.
Learnt from: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: gartnera
PR: zeta-chain/node#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: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
zetaclient/testutils/constant.go (9)
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: gartnera
PR: zeta-chain/node#3489
File: pkg/chains/chains.go:0-0
Timestamp: 2025-02-06T15:31:32.723Z
Learning: SuiMainnet uses chain ID 105 (temporarily) instead of 101 to avoid collision with ZetaChainPrivnet. This is tracked in issue #3491 for proper resolution.
Learnt from: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#3228
File: cmd/zetaclientd/start.go:222-231
Timestamp: 2024-11-27T22:02:48.034Z
Learning: In the `zetaclient` codebase, port numbers like `26657` are hardcoded, and changing them to be configurable via the config struct is considered unrelated refactoring.
Learnt from: lumtis
PR: zeta-chain/node#2984
File: x/crosschain/keeper/msg_server_whitelist_erc20.go:39-48
Timestamp: 2024-11-01T10:30:27.952Z
Learning: In the context of whitelisting assets in `MsgWhitelistERC20` within `x/crosschain/keeper/msg_server_whitelist_erc20.go`, there is no specific address validation required for Solana addresses.
Learnt from: kingpinXD
PR: zeta-chain/node#3917
File: x/observer/keeper/voting.go:46-74
Timestamp: 2025-05-26T22:03:49.074Z
Learning: In Go SDK staking keeper, validators retrieved via GetValidator() have valid consensus addresses by design. The validator.GetConsAddr() method rarely fails in normal operation since the SDK maintains data integrity for stored validators, making test coverage for this error path unnecessary in most cases.
pkg/contracts/sui/withdraw_and_call_test.go (10)
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
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#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#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: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#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: 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`.
e2e/e2etests/test_sui_withdraw_restricted_address.go (7)
Learnt from: gartnera
PR: zeta-chain/node#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: 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: gartnera
PR: zeta-chain/node#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: zeta-chain/node#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: 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: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/ptb_argument.go:39-48
Timestamp: 2025-04-22T18:22:56.444Z
Learning: The `sui.AddressFromHex` function in the github.com/pattonkan/sui-go package handles both prefixed and non-prefixed addresses by checking for and removing "0x" or "0X" prefixes if present before parsing.
Learnt from: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
e2e/e2etests/test_stress_sui_withdraw.go (11)
Learnt from: gartnera
PR: zeta-chain/node#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: gartnera
PR: zeta-chain/node#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: 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#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: 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: gartnera
PR: zeta-chain/node#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: zeta-chain/node#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: 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: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
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: fbac
PR: zeta-chain/node#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.
zetaclient/chains/sui/observer/inbound.go (10)
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: gartnera
PR: zeta-chain/node#3252
File: x/observer/keeper/msg_server_update_operational_flags.go:13-28
Timestamp: 2024-12-11T18:24:42.195Z
Learning: In the Zetacore codebase, emitting events is not necessary when updating operational flags in the `x/observer/keeper` module.
Learnt from: ws4charlie
PR: zeta-chain/node#2899
File: zetaclient/chains/bitcoin/observer/inbound.go:131-132
Timestamp: 2024-09-19T18:25:57.534Z
Learning: ObserveInbound coverage will be improved in future refactor.
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#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: gartnera
PR: zeta-chain/node#3252
File: x/observer/keeper/operational_flags.go:9-14
Timestamp: 2024-12-11T18:24:48.274Z
Learning: Events are not needed in the `SetOperationalFlags` method in `x/observer/keeper/operational_flags.go`.
Learnt from: ws4charlie
PR: zeta-chain/node#3461
File: x/observer/migrations/v10/migrate.go:29-34
Timestamp: 2025-02-04T06:03:54.382Z
Learning: In the observer module's ChainParams struct, the Confirmation field is a value type (not a pointer), so nil checks are not needed.
Learnt from: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#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.
e2e/contracts/sui/protocol-contracts-sui-upgrade/Move.toml (4)
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: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
cmd/zetae2e/config/config.go (5)
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
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: 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: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
e2e/e2etests/test_sui_withdraw_revert_with_call.go (5)
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: gartnera
PR: zeta-chain/node#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: 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#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: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
e2e/e2etests/test_sui_withdraw_and_call_revert_with_call.go (11)
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: gartnera
PR: zeta-chain/node#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: 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: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#2987
File: pkg/memo/fields_v0_test.go:270-320
Timestamp: 2024-10-10T19:29:59.300Z
Learning: In the `FieldsV0` struct of the `memo` package, `RevertAddress` may be left empty when `CallOnRevert` is set to true.
Learnt from: ws4charlie
PR: zeta-chain/node#2987
File: pkg/memo/fields_v0.go:82-87
Timestamp: 2024-10-10T19:06:26.244Z
Learning: `RevertAddress` is not dependent on `CallOnRevert`; it can be set regardless of the value of `CallOnRevert`.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
e2e/e2etests/test_sui_token_withdraw.go (16)
Learnt from: gartnera
PR: zeta-chain/node#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: 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: gartnera
PR: zeta-chain/node#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: 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: fbac
PR: zeta-chain/node#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.
Learnt from: gartnera
PR: zeta-chain/node#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: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
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: 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#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: gartnera
PR: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#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: 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.
pkg/contracts/sui/errors_test.go (5)
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: gartnera
PR: zeta-chain/node#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: 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: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#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.
e2e/contracts/sui/example-authenticated-call/Move.toml (1)
Learnt from: ws4charlie
PR: zeta-chain/node#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.
pkg/contracts/sui/errors.go (2)
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: gartnera
PR: zeta-chain/node#3406
File: cmd/zetae2e/local/local.go:199-199
Timestamp: 2025-01-23T20:29:05.877Z
Learning: The function `monitorBlockProductionExit` in cmd/zetae2e/local/local.go uses context cancellation to handle errors, not os.Exit, and should ideally be named `monitorBlockProductionCancel` to better reflect its behavior.
e2e/e2etests/test_sui_token_withdraw_and_call.go (10)
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: gartnera
PR: zeta-chain/node#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: gartnera
PR: zeta-chain/node#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: 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: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#2817
File: contrib/rpcimportable/rpcimportable_test.go:9-11
Timestamp: 2024-09-24T18:43:18.488Z
Learning: When reviewing test functions intended solely to verify package importability, avoid suggesting additional assertions or checks that are beyond the intended scope.
Learnt from: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
Learnt from: gartnera
PR: zeta-chain/node#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.
zetaclient/orchestrator/bootstrap.go (6)
Learnt from: gartnera
PR: zeta-chain/node#3277
File: cmd/zetae2e/get_zetaclient_bootstrap.go:62-66
Timestamp: 2024-12-11T17:10:18.193Z
Learning: In the `getZetaclientBootstrap` function within `cmd/zetae2e/get_zetaclient_bootstrap.go`, `Validator` and `Description` in `validatorRes` are not pointers. An error is returned if `validatorRes` is nil (not found), so additional nil checks for these fields are unnecessary.
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#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/ptb_argument.go:39-48
Timestamp: 2025-04-22T18:22:56.444Z
Learning: The `sui.AddressFromHex` function in the github.com/pattonkan/sui-go package handles both prefixed and non-prefixed addresses by checking for and removing "0x" or "0X" prefixes if present before parsing.
Learnt from: gartnera
PR: zeta-chain/node#3228
File: cmd/zetaclientd/start.go:222-231
Timestamp: 2024-11-27T22:02:48.034Z
Learning: In the `zetaclient` codebase, port numbers like `26657` are hardcoded, and changing them to be configurable via the config struct is considered unrelated refactoring.
e2e/e2etests/test_sui_withdraw_and_call.go (11)
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: gartnera
PR: zeta-chain/node#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: gartnera
PR: zeta-chain/node#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: zeta-chain/node#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: 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: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#2817
File: contrib/rpcimportable/rpcimportable_test.go:9-11
Timestamp: 2024-09-24T18:43:18.488Z
Learning: When reviewing test functions intended solely to verify package importability, avoid suggesting additional assertions or checks that are beyond the intended scope.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
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#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
cmd/zetae2e/config/contracts.go (4)
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
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: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
pkg/contracts/sui/withdraw_and_call.go (7)
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
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: 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#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: zeta-chain/node#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: zeta-chain/node#3025
File: zetaclient/chains/bitcoin/observer/event.go:110-115
Timestamp: 2024-10-23T17:30:57.328Z
Learning: In the `DecodeEventMemoBytes` function, a non-nil `memoStd` with a non-nil `err` indicates that the memo bytes are well-formatted as a memo but contain improper data.
e2e/e2etests/test_sui_authenticated_call_revert_with_call.go (10)
Learnt from: gartnera
PR: zeta-chain/node#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: gartnera
PR: zeta-chain/node#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: 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/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: 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: 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/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: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
e2e/e2etests/test_sui_token_withdraw_and_call_revert_with_call.go (9)
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: gartnera
PR: zeta-chain/node#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: 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#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: zeta-chain/node#2987
File: pkg/memo/fields_v0_test.go:270-320
Timestamp: 2024-10-10T19:29:59.300Z
Learning: In the `FieldsV0` struct of the `memo` package, `RevertAddress` may be left empty when `CallOnRevert` is set to true.
Learnt from: ws4charlie
PR: zeta-chain/node#2987
File: pkg/memo/fields_v0.go:82-87
Timestamp: 2024-10-10T19:06:26.244Z
Learning: `RevertAddress` is not dependent on `CallOnRevert`; it can be set regardless of the value of `CallOnRevert`.
Learnt from: ws4charlie
PR: zeta-chain/node#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: fbac
PR: zeta-chain/node#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.
Learnt from: ws4charlie
PR: zeta-chain/node#3381
File: zetaclient/chains/bitcoin/signer/sign.go:71-74
Timestamp: 2025-01-21T04:39:26.779Z
Learning: In Bitcoin ZRC20 token context, `txData.txSize` represents the gas limit and is used to determine if a transaction is a ZRC20 'withdraw' operation that should be charged less fee by comparing it with `common.BtcOutboundBytesWithdrawer`.
e2e/runner/runner.go (5)
Learnt from: gartnera
PR: zeta-chain/node#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: 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: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
e2e/e2etests/test_sui_token_authenticated_call.go (10)
Learnt from: gartnera
PR: zeta-chain/node#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: gartnera
PR: zeta-chain/node#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: 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/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#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: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
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: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
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.
e2e/e2etests/test_sui_withdraw_invalid_receiver.go (11)
Learnt from: gartnera
PR: zeta-chain/node#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: 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: gartnera
PR: zeta-chain/node#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: 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#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#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: zeta-chain/node#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: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
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: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
cmd/zetae2e/local/local.go (4)
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#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: zeta-chain/node#2870
File: zetaclient/orchestrator/bootstrap.go:142-142
Timestamp: 2024-09-13T22:51:02.192Z
Learning: When code changes involve only renaming without functional changes, and static analysis tools flag missing test coverage, acknowledge that existing tests likely already cover the functionality, and additional tests may not be necessary.
Learnt from: gartnera
PR: zeta-chain/node#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.
e2e/runner/sui_gateway_upgrade.go (7)
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
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: 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: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
Learnt from: gartnera
PR: zeta-chain/node#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.
zetaclient/chains/sui/observer/observer_test.go (13)
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`.
Learnt from: ws4charlie
PR: zeta-chain/node#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: 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#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: gartnera
PR: zeta-chain/node#3252
File: x/observer/keeper/msg_server_update_operational_flags.go:13-28
Timestamp: 2024-12-11T18:24:42.195Z
Learning: In the Zetacore codebase, emitting events is not necessary when updating operational flags in the `x/observer/keeper` module.
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#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: zeta-chain/node#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: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#3461
File: x/observer/migrations/v10/migrate.go:29-34
Timestamp: 2025-02-04T06:03:54.382Z
Learning: In the observer module's ChainParams struct, the Confirmation field is a value type (not a pointer), so nil checks are not needed.
Learnt from: kingpinXD
PR: zeta-chain/node#3207
File: x/observer/simulation/operation_reset_chain_nonces.go:26-27
Timestamp: 2024-12-12T15:51:51.144Z
Learning: In `x/observer/simulation/operation_reset_chain_nonces.go`, within the `SimulateResetChainNonces` function, the `authAccount` cannot be nil because it corresponds to the policy account which is set using simulation accounts.
pkg/contracts/sui/gateway_test.go (10)
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
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#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: zeta-chain/node#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: 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: gartnera
PR: zeta-chain/node#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: zeta-chain/node#2987
File: pkg/memo/codec_abi_test.go:13-24
Timestamp: 2024-10-10T19:11:53.045Z
Learning: In `pkg/memo/codec_abi_test.go`, `newArgInstance` intentionally returns `nil` for unsupported types to facilitate testing of invalid type handling.
Learnt from: gartnera
PR: zeta-chain/node#2817
File: contrib/rpcimportable/go.mod:1-3
Timestamp: 2024-09-24T18:43:46.232Z
Learning: In this project, minor version differences in Go modules are acceptable and do not require strict consistency.
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`.
e2e/e2etests/test_sui_withdraw.go (10)
Learnt from: gartnera
PR: zeta-chain/node#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: 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: gartnera
PR: zeta-chain/node#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: 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#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
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: gartnera
PR: zeta-chain/node#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: 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: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: 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`.
e2e/e2etests/test_sui_authenticated_call.go (10)
Learnt from: gartnera
PR: zeta-chain/node#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: gartnera
PR: zeta-chain/node#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: 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/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#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: 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: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
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.
e2e/contracts/sui/bin/bin.go (10)
Learnt from: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#2987
File: pkg/memo/codec.go:55-64
Timestamp: 2024-10-10T18:18:17.785Z
Learning: In the `pkg/memo` package, the functions `NewCodecABI` and `NewCodecCompact` are defined and accessible within the package scope, eliminating the need for explicit import statements in this file.
Learnt from: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
Learnt from: gartnera
PR: zeta-chain/node#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: zeta-chain/node#2987
File: pkg/memo/codec_abi_test.go:13-24
Timestamp: 2024-10-10T19:11:53.045Z
Learning: In `pkg/memo/codec_abi_test.go`, `newArgInstance` intentionally returns `nil` for unsupported types to facilitate testing of invalid type handling.
Learnt from: ws4charlie
PR: zeta-chain/node#2987
File: pkg/memo/arg.go:13-18
Timestamp: 2024-10-10T18:13:50.313Z
Learning: In the `pkg/memo/arg.go` file, the `CodecArg` struct uses `interface{}` for the `Arg` field because the ABI encode/decode API requires `interface{}` for encoding and decoding.
e2e/e2etests/test_sui_token_authenticated_call_revert_with_call.go (10)
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: gartnera
PR: zeta-chain/node#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: zeta-chain/node#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: 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: gartnera
PR: zeta-chain/node#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: 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/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: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
zetaclient/chains/sui/signer/withdraw_and_call_test.go (24)
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#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#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/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: 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/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: zeta-chain/node#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: zeta-chain/node#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: 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: gartnera
PR: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#2987
File: pkg/memo/codec_abi_test.go:13-24
Timestamp: 2024-10-10T19:11:53.045Z
Learning: In `pkg/memo/codec_abi_test.go`, `newArgInstance` intentionally returns `nil` for unsupported types to facilitate testing of invalid type handling.
Learnt from: gartnera
PR: zeta-chain/node#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: fbac
PR: zeta-chain/node#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.
Learnt from: gartnera
PR: zeta-chain/node#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: 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: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
Learnt from: ws4charlie
PR: zeta-chain/node#2987
File: pkg/memo/codec_abi.go:79-82
Timestamp: 2024-10-10T18:37:35.648Z
Learning: In `pkg/memo/codec_abi.go`, when using `UnpackIntoInterface(&c.abiArgs, ...)` in the `UnpackArguments` method, it's acceptable to pass `&c.abiArgs` as long as the user ensures the correct types are provided, similar to how the ABI library operates.
Learnt from: kingpinXD
PR: zeta-chain/node#2615
File: x/crosschain/keeper/msg_server_vote_outbound_tx_test.go:472-472
Timestamp: 2024-08-01T18:08:13.681Z
Learning: The `SaveFailedOutbound` function in `x/crosschain/keeper/msg_server_vote_outbound_tx.go` requires a string argument for the error message.
Learnt from: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:45:51.468Z
Learning: The Sui blockchain requires ECDSA secp256k1 signatures to be 64 bytes in [R || S] format, where R and S are 32 bytes each. The signature must use SHA256 for the internal hash, follow RFC6979 for deterministic nonce generation, and ensure S is in the lower half of the curve order per BIP-0062.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/ptb_argument.go:39-48
Timestamp: 2025-04-22T18:22:56.444Z
Learning: The `sui.AddressFromHex` function in the github.com/pattonkan/sui-go package handles both prefixed and non-prefixed addresses by checking for and removing "0x" or "0X" prefixes if present before parsing.
Learnt from: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#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.
zetaclient/chains/sui/client/client_live_test.go (17)
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: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: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#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: 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`.
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: 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: 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: 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: gartnera
PR: zeta-chain/node#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: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#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: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
Learnt from: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#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`.
e2e/config/config.go (3)
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
e2e/contracts/sui/example-authenticated-call/sources/example.move (4)
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: 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/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: 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`.
e2e/contracts/sui/protocol-contracts-sui-upgrade/sources/gateway.move (3)
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#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.
e2e/e2etests/e2etests.go (15)
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#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#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: gartnera
PR: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#2870
File: zetaclient/orchestrator/bootstrap.go:142-142
Timestamp: 2024-09-13T22:51:02.192Z
Learning: When code changes involve only renaming without functional changes, and static analysis tools flag missing test coverage, acknowledge that existing tests likely already cover the functionality, and additional tests may not be necessary.
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: gartnera
PR: zeta-chain/node#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: zeta-chain/node#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: 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: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
Learnt from: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#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: 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`.
pkg/contracts/sui/gateway.go (5)
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3025
File: zetaclient/chains/bitcoin/observer/event.go:110-115
Timestamp: 2024-10-23T17:30:57.328Z
Learning: In the `DecodeEventMemoBytes` function, a non-nil `memoStd` with a non-nil `err` indicates that the memo bytes are well-formatted as a memo but contain improper data.
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#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.
zetaclient/chains/sui/signer/signer_tx.go (21)
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/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: 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#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: 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: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
Learnt from: gartnera
PR: zeta-chain/node#3277
File: cmd/zetae2e/get_zetaclient_bootstrap.go:62-66
Timestamp: 2024-12-11T17:10:18.193Z
Learning: In the `getZetaclientBootstrap` function within `cmd/zetae2e/get_zetaclient_bootstrap.go`, `Validator` and `Description` in `validatorRes` are not pointers. An error is returned if `validatorRes` is nil (not found), so additional nil checks for these fields are unnecessary.
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: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#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: gartnera
PR: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#3793
File: pkg/contracts/sui/ptb_argument.go:39-48
Timestamp: 2025-04-22T18:22:56.444Z
Learning: The `sui.AddressFromHex` function in the github.com/pattonkan/sui-go package handles both prefixed and non-prefixed addresses by checking for and removing "0x" or "0X" prefixes if present before parsing.
Learnt from: gartnera
PR: zeta-chain/node#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: zeta-chain/node#3381
File: zetaclient/chains/bitcoin/signer/sign.go:71-74
Timestamp: 2025-01-21T04:39:26.779Z
Learning: In Bitcoin ZRC20 token context, `txData.txSize` represents the gas limit and is used to determine if a transaction is a ZRC20 'withdraw' operation that should be charged less fee by comparing it with `common.BtcOutboundBytesWithdrawer`.
Learnt from: ws4charlie
PR: zeta-chain/node#2987
File: pkg/memo/arg.go:3-11
Timestamp: 2024-10-10T17:51:34.102Z
Learning: In the `pkg/memo/arg.go` file, the `ArgType` constants are created to map directly to ABI corresponding type names.
Learnt from: gartnera
PR: zeta-chain/node#3406
File: cmd/zetae2e/setup_bitcoin.go:49-49
Timestamp: 2025-01-23T20:27:04.413Z
Learning: When using context.WithCancelCause in Go, the cancel function is of type context.CancelCauseFunc which accepts an error argument, allowing proper error propagation through context cancellation.
Learnt from: fbac
PR: zeta-chain/node#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/runner/sui.go (13)
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: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
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: fbac
PR: zeta-chain/node#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.
Learnt from: gartnera
PR: zeta-chain/node#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: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#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: gartnera
PR: zeta-chain/node#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: gartnera
PR: zeta-chain/node#3252
File: x/observer/keeper/operational_flags.go:16-26
Timestamp: 2024-12-06T16:23:31.240Z
Learning: In the ZetaChain Go codebase, within the `GetOperationalFlags` method in `x/observer/keeper/operational_flags.go`, it's acceptable to use `MustUnmarshal` without additional error handling, as an unmarshalling failure indicates a critical issue that should never occur.
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: gartnera
PR: zeta-chain/node#3277
File: cmd/zetae2e/get_zetaclient_bootstrap.go:62-66
Timestamp: 2024-12-11T17:10:18.193Z
Learning: In the `getZetaclientBootstrap` function within `cmd/zetae2e/get_zetaclient_bootstrap.go`, `Validator` and `Description` in `validatorRes` are not pointers. An error is returned if `validatorRes` is nil (not found), so additional nil checks for these fields are unnecessary.
e2e/runner/setup_sui.go (7)
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
Learnt from: gartnera
PR: zeta-chain/node#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: gartnera
PR: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#3461
File: x/observer/migrations/v10/migrate.go:29-34
Timestamp: 2025-02-04T06:03:54.382Z
Learning: In the observer module's ChainParams struct, the Confirmation field is a value type (not a pointer), so nil checks are not needed.
zetaclient/chains/sui/signer/withdraw_and_call.go (17)
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: 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: 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#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: 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: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: ws4charlie
PR: zeta-chain/node#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: zeta-chain/node#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: zeta-chain/node#3306
File: pkg/math/integer.go:0-0
Timestamp: 2025-01-14T03:37:22.757Z
Learning: The `IncreaseIntByPercent` function in `pkg/math/integer.go` uses `big.Int` to handle large numbers and prevent overflows, making additional overflow protection unnecessary.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: ws4charlie
PR: zeta-chain/node#3793
File: pkg/contracts/sui/withdraw_and_call_ptb.go:111-118
Timestamp: 2025-04-22T15:32:20.706Z
Learning: The constant `moduleName` is defined in `pkg/contracts/sui/gateway.go` with the value `"gateway"` and is used across multiple files in the `sui` package.
Learnt from: gartnera
PR: zeta-chain/node#3485
File: e2e/utils/sui/signer.go:24-35
Timestamp: 2025-02-06T16:29:58.925Z
Learning: The Sui blockchain requires signatures in [R || S || V] format, which is best generated using go-ethereum's crypto.Sign function that takes an ecdsa.PrivateKey.
Learnt from: kingpinXD
PR: zeta-chain/node#2615
File: x/crosschain/keeper/msg_server_vote_outbound_tx_test.go:472-472
Timestamp: 2024-08-01T18:08:13.681Z
Learning: The `SaveFailedOutbound` function in `x/crosschain/keeper/msg_server_vote_outbound_tx.go` requires a string argument for the error message.
Learnt from: ws4charlie
PR: zeta-chain/node#2987
File: pkg/memo/codec_abi_test.go:13-24
Timestamp: 2024-10-10T19:11:53.045Z
Learning: In `pkg/memo/codec_abi_test.go`, `newArgInstance` intentionally returns `nil` for unsupported types to facilitate testing of invalid type handling.
Learnt from: ws4charlie
PR: zeta-chain/node#2987
File: pkg/memo/arg.go:3-11
Timestamp: 2024-10-10T17:51:34.102Z
Learning: In the `pkg/memo/arg.go` file, the `ArgType` constants are created to map directly to ABI corresponding type names.
Learnt from: ws4charlie
PR: zeta-chain/node#2987
File: pkg/memo/codec_abi.go:46-50
Timestamp: 2024-10-10T18:32:56.299Z
Learning: In `pkg/memo/codec_abi.go`, when constructing the ABI method in the `AddArguments` method of `CodecABI`, argument names are not necessary in the ABI type definitions for ABI encoding.
Learnt from: ws4charlie
PR: zeta-chain/node#2987
File: pkg/memo/codec_abi.go:79-82
Timestamp: 2024-10-10T18:37:35.648Z
Learning: In `pkg/memo/codec_abi.go`, when using `UnpackIntoInterface(&c.abiArgs, ...)` in the `UnpackArguments` method, it's acceptable to pass `&c.abiArgs` as long as the user ensures the correct types are provided, similar to how the ABI library operates.
🧬 Code Graph Analysis (23)
zetaclient/chains/sui/signer/signer_test.go (1)
pkg/contracts/sui/gateway.go (1)
  • NewGatewayFromTriplet (69-76)
zetaclient/testutils/constant.go (1)
pkg/chains/chains.go (1)
  • SuiMainnet (128-137)
pkg/contracts/sui/withdraw_and_call_test.go (1)
pkg/contracts/sui/gateway.go (1)
  • GatewayModule (65-65)
zetaclient/chains/sui/observer/inbound.go (1)
pkg/contracts/sui/gateway.go (1)
  • GatewayModule (65-65)
cmd/zetae2e/config/config.go (1)
e2e/config/config.go (3)
  • Contracts (129-135)
  • Sui (158-168)
  • DoubleQuotedString (27-27)
e2e/e2etests/test_sui_withdraw_and_call_revert_with_call.go (2)
e2e/utils/parsing.go (1)
  • ParseBigInt (27-32)
testutil/sample/crypto.go (1)
  • SuiAddress (168-177)
e2e/e2etests/test_sui_token_withdraw_and_call.go (1)
e2e/utils/parsing.go (1)
  • ParseBigInt (27-32)
zetaclient/orchestrator/bootstrap.go (1)
pkg/contracts/sui/gateway.go (1)
  • NewGatewayFromTriplet (69-76)
e2e/e2etests/test_sui_withdraw_and_call.go (1)
e2e/utils/parsing.go (1)
  • ParseBigInt (27-32)
e2e/e2etests/test_sui_authenticated_call_revert_with_call.go (5)
e2e/runner/runner.go (1)
  • E2ERunner (81-218)
e2e/utils/parsing.go (1)
  • ParseBigInt (27-32)
testutil/sample/crypto.go (2)
  • EthAddress (89-91)
  • Hash (189-191)
e2e/utils/zetacore.go (1)
  • WaitCctxMinedByInboundHash (53-65)
e2e/utils/require.go (1)
  • RequireCCTXStatus (13-29)
e2e/e2etests/test_sui_token_withdraw_and_call_revert_with_call.go (1)
e2e/utils/parsing.go (1)
  • ParseBigInt (27-32)
e2e/runner/runner.go (1)
e2e/config/config.go (1)
  • SuiExample (149-155)
e2e/e2etests/test_sui_token_authenticated_call.go (3)
e2e/runner/runner.go (1)
  • E2ERunner (81-218)
e2e/utils/parsing.go (1)
  • ParseBigInt (27-32)
e2e/utils/zetacore.go (1)
  • WaitCctxMinedByInboundHash (53-65)
cmd/zetae2e/local/local.go (1)
e2e/e2etests/e2etests.go (7)
  • TestSuiAuthenticatedCallName (123-123)
  • TestSuiAuthenticatedCallRevertWithCallName (124-124)
  • TestSuiTokenWithdrawName (115-115)
  • TestSuiTokenWithdrawAndCallName (116-116)
  • TestSuiTokenWithdrawAndCallRevertWithCallName (117-117)
  • TestSuiTokenAuthenticatedCallName (118-118)
  • TestSuiTokenAuthenticatedCallRevertWithCallName (119-119)
e2e/runner/sui_gateway_upgrade.go (2)
pkg/contracts/sui/gateway.go (1)
  • GatewayModule (65-65)
e2e/runner/runner.go (1)
  • E2ERunner (81-218)
zetaclient/chains/sui/observer/observer_test.go (1)
pkg/contracts/sui/gateway.go (2)
  • GatewayModule (65-65)
  • NewGatewayFromTriplet (69-76)
pkg/contracts/sui/gateway_test.go (1)
pkg/contracts/sui/gateway.go (2)
  • NewGateway (79-85)
  • GatewayModule (65-65)
zetaclient/chains/sui/signer/withdraw_and_call_test.go (4)
pkg/contracts/sui/coin.go (1)
  • SUI (8-8)
testutil/sample/crypto.go (3)
  • EthAddress (89-91)
  • SuiAddress (168-177)
  • SuiDigest (180-186)
zetaclient/testutils/constant.go (1)
  • SUIMsgContextID (44-44)
testutil/helpers.go (1)
  • NoError (23-27)
zetaclient/chains/sui/client/client_live_test.go (1)
pkg/contracts/sui/gateway.go (1)
  • NewGatewayFromTriplet (69-76)
e2e/e2etests/e2etests.go (5)
e2e/runner/e2etest.go (3)
  • WithMinimumVersion (16-20)
  • NewE2ETest (41-58)
  • ArgDefinition (88-91)
e2e/e2etests/test_sui_authenticated_call.go (1)
  • TestSuiWithdrawAndAuthenticatedCall (14-68)
e2e/e2etests/test_sui_authenticated_call_revert_with_call.go (1)
  • TestSuiWithdrawAndAuthenticatedCallRevertWithCall (19-92)
e2e/e2etests/test_sui_token_authenticated_call.go (1)
  • TestSuiTokenWithdrawAndAuthenticatedCall (14-69)
e2e/e2etests/test_sui_token_authenticated_call_revert_with_call.go (1)
  • TestSuiTokenAuthenticatedCallRevertWithCall (19-93)
zetaclient/chains/sui/signer/signer_tx.go (3)
pkg/contracts/sui/gateway.go (2)
  • GatewayModule (65-65)
  • ParseGatewayNonce (310-331)
pkg/contracts/sui/payload.go (1)
  • CallPayload (26-35)
pkg/contracts/sui/errors.go (2)
  • ErrObjectOwnership (30-30)
  • IsRetryableExecutionError (83-117)
e2e/runner/setup_sui.go (5)
e2e/contracts/sui/bin/bin.go (6)
  • ExampleArbiCallFungibleTokenBytecodeBase64 (42-44)
  • ExampleArbiCallConnectedBytecodeBase64 (47-49)
  • ReadMoveBinaryBase64 (52-58)
  • GatewayBytecodeBase64 (27-29)
  • EVMBytecodeBase64 (37-39)
  • FakeUSDCBytecodeBase64 (32-34)
e2e/runner/runner.go (1)
  • E2ERunner (81-218)
pkg/contracts/sui/gateway.go (1)
  • NewGateway (79-85)
e2e/config/config.go (3)
  • SuiExample (149-155)
  • Sui (158-168)
  • Account (61-67)
zetaclient/chains/sui/client/client.go (1)
  • TxStatusSuccess (30-30)
zetaclient/chains/sui/signer/withdraw_and_call.go (6)
pkg/contracts/sui/payload.go (1)
  • CallPayload (26-35)
pkg/contracts/sui/ptb_argument.go (1)
  • TypeTagFromString (39-58)
zetaclient/chains/sui/signer/signer.go (1)
  • Signer (21-28)
zetaclient/chains/sui/client/client.go (1)
  • CheckContainOwnedObject (418-441)
pkg/contracts/sui/withdraw_and_call.go (4)
  • ModuleConnected (24-24)
  • FuncOnCall (27-27)
  • FuncSetMessageContext (18-18)
  • FuncResetMessageContext (21-21)
pkg/contracts/sui/gateway.go (1)
  • GatewayModule (65-65)
🪛 checkmake (0.2.2)
e2e/contracts/sui/example-arbitrary-call/Makefile

[warning] 1-1: Missing required phony target "test"

(minphony)

🪛 markdownlint-cli2 (0.17.2)
e2e/contracts/sui/example-authenticated-call/README.md

35-35: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ 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). (7)
  • GitHub Check: start-sui-test / e2e
  • GitHub Check: start-e2e-test / e2e
  • GitHub Check: test-sim-nondeterminism / sim
  • GitHub Check: gosec
  • GitHub Check: build-and-test
  • GitHub Check: build
  • GitHub Check: analyze (go)
🔇 Additional comments (86)
e2e/contracts/sui/example-authenticated-call/.gitignore (1)

1-2: Good ignore pattern – nothing to add.

The rules correctly keep build artefacts and the lock-file out of VCS.

e2e/contracts/sui/example-arbitrary-call/.gitignore (1)

1-2: Looks fine.

Same comment as for the authenticated-call package – the ignore list is appropriate.

changelog.md (1)

12-12: Entry style & ordering are consistent – no action required.

contrib/localnet/orchestrator/Dockerfile.fastbuild (1)

5-5: Great move pinning the Sui image by digest.

Using the immutable SHA256 digest guarantees reproducible builds.

e2e/contracts/sui/protocol-contracts-sui-upgrade/Move.toml (2)

4-4: Hard-coding published-at = "0x0" – please confirm intent.

Publishing at address 0x0 is fine for localnet tests but dangerous on shared environments; a mis-configured deploy could overwrite a system object.

Verify that all deployment scripts target an isolated local network only.


9-9: Framework rev bump matches mainnet – good catch.

Aligning to mainnet-v1.49.2 prevents compilation mismatches with the upgraded localnet image.

zetaclient/testutils/constant.go (2)

44-44: LGTM: Constant addition supports authenticated call functionality.

The new SUIMsgContextID constant follows proper naming conventions and aligns with the PR's authenticated call implementation.


58-59: LGTM: Gateway address format properly extended to triplet.

The transition from pair to triplet format for SuiMainnet gateway addresses maintains backward compatibility while adding support for message context ID. The comma-separated format is consistent with the existing pattern.

zetaclient/chains/sui/signer/signer_test.go (1)

335-335: LGTM: Gateway constructor updated for triplet format.

The transition from NewGatewayFromPairID to NewGatewayFromTriplet properly aligns the test suite with the refactored gateway implementation that supports message context ID.

cmd/zetae2e/config/config.go (2)

65-65: LGTM: MessageContextID export supports authenticated calls.

The addition of MessageContextID export properly extends the configuration to include the new message context object required for authenticated call functionality.


71-72: LGTM: Example contracts properly separated by call type.

The separation of example contracts into ExampleArbiCall and ExampleAuthCall provides clear distinction between arbitrary and authenticated call scenarios, improving configuration clarity.

pkg/contracts/sui/withdraw_and_call_test.go (1)

114-114: LGTM: Module reference standardized to use constant.

The transition from variable moduleName to constant GatewayModule improves consistency and maintainability across the codebase. This standardization aligns with the broader refactoring effort.

Also applies to: 264-264

e2e/e2etests/test_sui_withdraw_invalid_receiver.go (1)

28-31: LGTM: Withdrawal method properly generalized.

The transition from SuiWithdrawSUI to SuiWithdraw with the token address parameter effectively consolidates withdrawal functionality while maintaining test coverage. The explicit token address parameter improves clarity and supports the unified withdrawal interface.

e2e/contracts/sui/example-authenticated-call/Makefile (2)

13-14: LGTM! Improved build artifact organization.

The changes consolidate build outputs into a dedicated bin directory with descriptive filenames (auth_call_token.mv and auth_call_connected.mv), which improves build organization and makes the purpose of each artifact clear.


22-22: Good cleanup of trailing whitespace.

zetaclient/chains/sui/observer/inbound.go (1)

29-29: LGTM! Standardized module name usage.

Replacing the dynamic ob.gateway.Module() call with the static sui.GatewayModule constant improves consistency across the codebase and eliminates unnecessary method calls for a fixed value.

contrib/localnet/docker-compose.yml (1)

288-288: Excellent security improvement with image pinning.

Using the SHA256 digest instead of a mutable tag ensures immutable image references, preventing potential supply chain attacks and guaranteeing reproducibility across environments.

e2e/e2etests/test_sui_withdraw.go (1)

28-33: LGTM! Improved API generalization.

The change from SuiWithdrawSUI to the more generic SuiWithdraw method with explicit token address parameter enhances API flexibility, allowing support for arbitrary ZRC20 tokens while maintaining clear intent through explicit parameters.

e2e/e2etests/test_sui_withdraw_revert_with_call.go (1)

57-67: LGTM! Consistent API generalization.

The update from SuiWithdrawSUI to SuiWithdraw with explicit token address parameter maintains consistency with the broader API refactoring while preserving all revert logic and test assertions.

pkg/contracts/sui/errors_test.go (2)

81-85: LGTM! Test coverage for authenticated call error handling.

The new test case appropriately validates that MoveAbort errors from authenticated on_call functions are classified as non-retryable, which is essential for proper error handling in the authenticated call flow.


97-98: LGTM! Command index update aligns with expanded command structure.

The update from command index 3 to 5 reflects the expanded command indices introduced with authenticated call support, maintaining test accuracy.

zetaclient/orchestrator/bootstrap.go (1)

204-205: LGTM! Gateway address format correctly updated for authenticated call support.

The transition from pair to triplet format appropriately accommodates the new message context ID requirement. The comment accurately documents the expected format, and the method call aligns with the new NewGatewayFromTriplet function signature.

e2e/e2etests/test_stress_sui_withdraw.go (1)

48-48: LGTM! Withdrawal method unification enhances API consistency.

The transition from SuiWithdrawSUI to the generic SuiWithdraw method with explicit token address and revert options parameters represents an elegant API consolidation that improves maintainability while preserving functionality.

e2e/e2etests/test_sui_token_withdraw.go (2)

4-7: LGTM! Imports properly support the new withdrawal API.

The addition of math/big and gatewayzevm.sol imports correctly supports the new RevertOptions parameter and gas limit handling.


29-34: LGTM! Consistent API unification for token withdrawals.

The migration from SuiWithdrawFungibleToken to the unified SuiWithdraw method with explicit token address (r.SuiTokenZRC20Addr) and revert options maintains functionality while improving API consistency across withdrawal operations.

cmd/zetae2e/local/local.go (1)

499-500: LGTM! Comprehensive authenticated call test coverage added.

The addition of authenticated call test variants (both regular and token-based) with their respective revert scenarios ensures thorough validation of the new functionality in the local test environment. The test names follow established naming conventions and provide complete coverage of authenticated call flows.

Also applies to: 504-505

e2e/e2etests/test_sui_withdraw_restricted_address.go (1)

34-37: LGTM: Method signature updated correctly.

The transition from SuiWithdrawSUI to the generic SuiWithdraw method with explicit token address parameter aligns with the unified withdrawal interface introduced in this PR.

e2e/config/config.go (2)

161-161: LGTM: MessageContextID field addition supports authenticated calls.

The new MessageContextID field correctly extends the Sui configuration to support message context tracking, which is essential for the authenticated call functionality introduced in this PR.


166-167: LGTM: Example contract separation enhances clarity.

The split from a single Example field to separate ExampleArbiCall and ExampleAuthCall fields provides clear distinction between arbitrary and authenticated call examples, improving configuration maintainability.

zetaclient/chains/sui/client/client_live_test.go (2)

9-9: LGTM: Import reordering maintains consistency.

The import statement reordering follows Go formatting conventions and maintains code organization.


263-266: LGTM: Gateway initialization updated for triplet format.

The transition from NewGatewayFromPairID to NewGatewayFromTriplet correctly accommodates the enhanced gateway requiring package ID, gateway object ID, and message context ID. The test appropriately validates the new triplet parsing functionality.

cmd/zetae2e/config/contracts.go (3)

130-130: LGTM: MessageContextID variable extraction.

The addition of suiMessageContextID variable correctly extracts the new configuration field for subsequent validation and usage.


132-133: LGTM: Gateway initialization requires complete triplet.

The updated conditional check ensures all three required IDs (package, gateway object, and message context) are present before creating the gateway instance. The NewGateway constructor correctly receives all three parameters, maintaining consistency with the enhanced gateway requirements.


144-145: LGTM: Example contract assignments separated appropriately.

The transition from single SuiExample assignment to separate SuiExampleArbiCall and SuiExampleAuthCall assignments correctly reflects the configuration structure changes and supports distinct arbitrary and authenticated call examples.

e2e/e2etests/test_sui_withdraw_and_call_revert_with_call.go (4)

20-20: LGTM: Argument requirement updated for gas limit.

The change from requiring 1 to 2 arguments correctly accommodates the new gas limit parameter, enhancing test configurability.


24-27: LGTM: Gas limit parsing and example contract selection.

The addition of gas limit parsing from the second argument and the transition to SuiExampleArbiCall correctly implement the enhanced test parameterization and arbitrary call example usage.


32-32: LGTM: Payload creation updated with target package parameter.

The payload creation method correctly accepts the target package as a parameter, maintaining consistency with the refactored example contract interface.


48-53: LGTM: Unified withdraw and call interface implementation.

The transition to the generic SuiWithdrawAndCall method with explicit token address (r.SUIZRC20Addr) and structured call options correctly implements the enhanced withdraw and call functionality. The CallOptions struct appropriately specifies the gas limit and arbitrary call flag.

pkg/contracts/sui/errors.go (1)

107-112: LGTM: Command index handling properly extended for authenticated calls.

The expansion to include command indices 3 and 4 correctly aligns with the new set_message_context and reset_message_context commands introduced for authenticated calls. The updated comments clearly document the purpose of each command index.

pkg/contracts/sui/gateway_test.go (2)

24-24: LGTM: Gateway constructor updated for message context support.

The addition of the message context ID parameter ("0x0") correctly reflects the new Gateway struct signature introduced for authenticated call support.


27-27: LGTM: Consistent use of GatewayModule constant.

Switching from dynamic module name retrieval (gw.Module()) to the fixed constant GatewayModule improves consistency and aligns with the standardization across the codebase.

e2e/e2etests/test_sui_token_withdraw_and_call_revert_with_call.go (3)

19-26: LGTM: Function signature properly extended for gas limit parameter.

The addition of the gas limit parameter provides necessary control over transaction execution and aligns with the generalized withdraw-and-call API.


23-24: LGTM: Correct targeting of arbitrary call example package.

The switch from r.SuiExample to r.SuiExampleArbiCall properly reflects the separation of arbitrary and authenticated call example packages.


46-52: LGTM: Proper use of generalized withdraw-and-call method.

The migration to SuiWithdrawAndCall with CallOptions correctly implements the new unified API while maintaining the original test's intent for arbitrary call scenarios.

e2e/e2etests/test_sui_token_withdraw_and_call.go (3)

15-15: LGTM: Test signature correctly updated for gas limit parameter.

The change to expect 2 arguments aligns with the addition of gas limit support.


19-22: LGTM: Proper separation of example packages and gas limit handling.

The refactoring to use SuiExampleArbiCall correctly differentiates between arbitrary and authenticated call examples. Gas limit parsing follows the established pattern using utils.ParseBigInt.


42-49: LGTM: Method generalization improves code reusability.

The change from SuiWithdrawAndCallFungibleToken to the more generic SuiWithdrawAndCall with explicit token address and call options is a well-designed abstraction that supports both arbitrary and authenticated calls.

e2e/runner/runner.go (3)

140-144: LGTM: Clear separation of example package types.

The refactoring from a single SuiExample field to separate SuiExampleArbiCall and SuiExampleAuthCall fields provides better type safety and clarity for different call scenarios.


306-307: LGTM: Consistent copying of new example fields.

The CopyAddressesFrom method is properly updated to handle both new example package fields.


445-445: LGTM: MessageContextID logging enhances debugging.

Adding the MessageContextID to the contract address printing improves observability for authenticated call debugging.

pkg/contracts/sui/withdraw_and_call.go (3)

17-21: LGTM: Well-named constants for message context functions.

The addition of FuncSetMessageContext and FuncResetMessageContext constants follows the established naming pattern and supports the authenticated call functionality.


32-38: LGTM: Clear distinction between call types through command counts.

The renaming to ptbWithdrawAndArbiCallCmdCount and addition of ptbWithdrawAndAuthCallCmdCount clearly differentiates between arbitrary (3 commands) and authenticated (5 commands) call transaction structures.


125-125: LGTM: Consistent use of module constant.

Using GatewayModule constant instead of a hardcoded string improves maintainability and follows the established pattern.

e2e/e2etests/test_sui_authenticated_call.go (1)

14-68: LGTM: Well-structured authenticated call test.

The test correctly implements authenticated call testing by:

  • Using SuiExampleAuthCall package for authenticated calls
  • Creating proper authenticated payload with authorized sender
  • Setting IsArbitraryCall: false to indicate authenticated call
  • Following established test patterns for balance and call count verification

The test provides comprehensive coverage for the authenticated call functionality.

e2e/e2etests/test_sui_withdraw_and_call.go (2)

15-22: LGTM: Well-structured parameter handling and target package setup.

The addition of the gas limit parameter and explicit target package configuration properly supports the new arbitrary vs authenticated call distinction. The parameter validation ensures correct test invocation.


41-47: LGTM: Proper call options configuration for arbitrary calls.

The explicit specification of IsArbitraryCall: true and inclusion of the gas limit parameter correctly configures the test for arbitrary call scenarios, distinguishing it from authenticated calls.

e2e/contracts/sui/bin/bin.go (2)

11-49: LGTM: Clean implementation of Move bytecode embedding and encoding.

The go:embed directives and base64 encoding functions are properly implemented. The separation of concerns between embedded binaries and runtime file reading provides flexibility for different deployment scenarios.


52-58: LGTM: Appropriate utility function with proper security acknowledgment.

The ReadMoveBinaryBase64 function correctly handles runtime file reading with appropriate error handling. The #nosec G304 comment properly acknowledges the file path usage in the E2E test context.

e2e/e2etests/test_sui_authenticated_call_revert_with_call.go (3)

16-38: LGTM: Well-designed test setup for revert scenario validation.

The test effectively creates an unauthorized sender scenario using sample.EthAddress() to trigger the expected revert. The payload construction and target package setup properly simulate the authenticated call failure condition.


53-68: LGTM: Proper authenticated call configuration with comprehensive revert options.

The call options correctly specify IsArbitraryCall: false for authenticated calls, and the revert options provide complete coverage for testing the onRevert functionality with appropriate gas limits and revert address configuration.


72-92: LGTM: Thorough verification of revert handling and state changes.

The assertions comprehensively validate the revert scenario: transaction status, onRevert callback execution, sender verification, and balance changes. This ensures the authenticated call revert mechanism functions correctly end-to-end.

e2e/e2etests/test_sui_token_authenticated_call.go (3)

14-36: LGTM: Well-structured test setup for token authenticated calls.

The test properly configures the authenticated call scenario with fungible tokens, correctly using the authorized sender from r.EVMAddress() and establishing baseline measurements for balance and call count verification.


38-54: LGTM: Proper dual token approval and authenticated call execution.

The test correctly handles the dual approval requirement (SUI for gas budget and fungible token for transfer) and properly configures the withdraw and call with IsArbitraryCall: false for authenticated call validation.


57-69: LGTM: Comprehensive verification of authenticated call outcomes.

The assertions properly validate both the transaction status and the expected state changes (balance increase and call count increment), ensuring the authenticated call functionality works correctly with fungible tokens.

e2e/runner/sui_gateway_upgrade.go (3)

46-47: LGTM!

The abstraction of the build process into r.suiBuildGatewayUpgraded() improves modularity and aligns with the new build automation framework.


91-91: LGTM!

Using the centralized sui.GatewayModule constant instead of hardcoding the module name enhances maintainability and consistency across the codebase.


102-118: LGTM!

The refactored suiPatchMoveConfig function is now more generic and reusable. The use of filepath.Join for path construction is a best practice that ensures cross-platform compatibility.

e2e/e2etests/test_sui_token_authenticated_call_revert_with_call.go (1)

1-93: LGTM!

The test implementation is comprehensive and well-structured. It properly validates the authenticated call revert flow, including:

  • Setting up an unauthorized sender scenario
  • Tracking token balances before and after the transaction
  • Verifying the revert handler is called with the correct payload
  • Asserting the CCTX status and token reimbursement
zetaclient/chains/sui/observer/observer_test.go (2)

74-74: LGTM!

Replacing dynamic module retrieval with the static sui.GatewayModule constant improves performance and ensures consistency with the updated gateway module structure.

Also applies to: 180-180, 379-379, 570-570, 643-643


552-552: LGTM!

The update from NewGatewayFromPairID to NewGatewayFromTriplet correctly reflects the new gateway constructor that handles the additional message context ID parameter.

zetaclient/chains/sui/signer/withdraw_and_call_test.go (2)

21-42: LGTM!

The test helper function updates correctly reflect the new authenticated call structure:

  • Addition of isArbitraryCall parameter to distinguish call types
  • Renaming receiver to target for better semantic accuracy
  • Addition of sender field for authenticated call validation

150-151: LGTM!

The message context object reference integration is properly implemented, aligning with the new gateway structure that manages message context for authenticated calls.

Also applies to: 213-219, 244-248

e2e/e2etests/e2etests.go (1)

118-124: LGTM! Test configurations follow established patterns.

The new authenticated call test constants and configurations are well-structured and consistent with existing patterns. The addition of gas limit arguments to withdraw-and-call tests is appropriate for the new functionality.

Also applies to: 1042-1042, 1061-1061, 1066-1085, 1100-1100, 1110-1110, 1115-1134

e2e/contracts/sui/protocol-contracts-sui-upgrade/sources/gateway.move (1)

215-229: Well-implemented message context management.

The set/reset pattern for message context provides clean state management for authenticated calls. The validation of sender addresses and non-zero target addresses ensures proper usage.

pkg/contracts/sui/gateway.go (2)

69-76: Clean implementation of triplet parsing and updates.

The transition from pair to triplet (packageID, gatewayObjectID, messageContextID) is well-handled with consistent parsing and validation.

Also applies to: 165-179, 409-416


65-65: Good improvement: Exported constant with clearer naming.

Renaming moduleName to GatewayModule and making it exported improves API clarity and follows Go naming conventions.

Also applies to: 161-161, 212-212

zetaclient/chains/sui/signer/signer_tx.go (4)

11-11: LGTM! Appropriate import for cross-chain address handling.

The addition of ethcommon import enables proper conversion of Ethereum addresses, which is necessary for the authenticated call functionality.


76-76: Excellent refactoring to use package constants.

The migration to zetasui package constants improves maintainability and reduces the risk of typos or inconsistencies.

Also applies to: 99-99, 123-123


137-172: Well-structured implementation for authenticated call support.

The method signature change to accept the full cctx provides necessary context for authenticated calls. The addition of sender, target, and isArbitraryCall fields properly supports the new functionality.


262-262: Consistent error handling with zetasui package.

The migration to zetasui error types and utility functions ensures consistent error handling across the codebase.

Also applies to: 295-295, 358-358

e2e/runner/sui.go (1)

58-78: Clean parameterization of ZRC20 address.

The refactoring to accept zrc20 as a parameter instead of hardcoding token addresses improves flexibility and reusability.

e2e/runner/setup_sui.go (2)

30-45: Well-organized constants for package paths.

The constants clearly identify the different package paths and binaries used in the setup process.


191-232: Proper extension for message context support.

The gateway deployment correctly handles the new MessageContext object and returns all three required IDs for authenticated call functionality.

zetaclient/chains/sui/signer/withdraw_and_call.go (3)

42-67: Well-structured type argument building.

The onCallTypeArgs method properly constructs type arguments with appropriate error handling for invalid types.


421-490: Robust implementation of authenticated call flow.

The authenticated call implementation properly manages the message context lifecycle:

  1. Sets the message context with sender and target
  2. Executes the on_call with proper arguments
  3. Resets the message context

This ensures the context is properly cleaned up after use.


196-283: Correct handling of object ownership and versions.

The implementation properly:

  • Validates that on_call objects are shared or immutable
  • Uses initial version for shared objects
  • Uses current version for owned objects (withdraw cap and message context)

This ensures compatibility with Sui's object model.

@ws4charlie ws4charlie requested review from a team and swift1337 July 15, 2025 18:10
Copy link
Contributor

@swift1337 swift1337 left a comment

Choose a reason for hiding this comment

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

Solid 📈

@ws4charlie
Copy link
Contributor Author

WDYT of /work/sui/example-authenticated-call?

Yea, having a sub dir sui is a good point @swift1337

@ws4charlie ws4charlie requested a review from lumtis July 16, 2025 22:22
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.

It looks good to me. We will have to do some manual testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chain:sui nosec SUI_TESTS Run make start-sui-tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for authenticated calls with Sui

3 participants