feat: Sui withdraw and authenticated call#4007
Conversation
…t-sui-authenticated-call
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughThis 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
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()
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes were detected. Possibly related PRs
Suggested reviewers
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
Documentation and Community
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
|
!!!WARNING!!! Be very careful about using 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 Pay extra attention to the way |
…t-sui-authenticated-call
There was a problem hiding this comment.
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-pinnedzetanode:latestreduces reproducibility.
latestcan 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-callcontainsbuild/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/**/buildto 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 Implementatione2e/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
⛔ Files ignored due to path filters (1)
e2e/contracts/sui/example/Move.lockis 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-codingpublished-at = "0x0"– please confirm intent.Publishing at address
0x0is 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.2prevents compilation mismatches with the upgraded localnet image.zetaclient/testutils/constant.go (2)
44-44: LGTM: Constant addition supports authenticated call functionality.The new
SUIMsgContextIDconstant 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
NewGatewayFromPairIDtoNewGatewayFromTripletproperly 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
MessageContextIDexport 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
ExampleArbiCallandExampleAuthCallprovides 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
moduleNameto constantGatewayModuleimproves 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
SuiWithdrawSUItoSuiWithdrawwith 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
bindirectory with descriptive filenames (auth_call_token.mvandauth_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 staticsui.GatewayModuleconstant 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
SuiWithdrawSUIto the more genericSuiWithdrawmethod 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
SuiWithdrawSUItoSuiWithdrawwith 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
NewGatewayFromTripletfunction signature.e2e/e2etests/test_stress_sui_withdraw.go (1)
48-48: LGTM! Withdrawal method unification enhances API consistency.The transition from
SuiWithdrawSUIto the genericSuiWithdrawmethod 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/bigandgatewayzevm.solimports correctly supports the new RevertOptions parameter and gas limit handling.
29-34: LGTM! Consistent API unification for token withdrawals.The migration from
SuiWithdrawFungibleTokento the unifiedSuiWithdrawmethod 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
SuiWithdrawSUIto the genericSuiWithdrawmethod 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
MessageContextIDfield 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
Examplefield to separateExampleArbiCallandExampleAuthCallfields 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
NewGatewayFromPairIDtoNewGatewayFromTripletcorrectly 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
suiMessageContextIDvariable 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
NewGatewayconstructor correctly receives all three parameters, maintaining consistency with the enhanced gateway requirements.
144-145: LGTM: Example contract assignments separated appropriately.The transition from single
SuiExampleassignment to separateSuiExampleArbiCallandSuiExampleAuthCallassignments 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
SuiExampleArbiCallcorrectly 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
SuiWithdrawAndCallmethod with explicit token address (r.SUIZRC20Addr) and structured call options correctly implements the enhanced withdraw and call functionality. TheCallOptionsstruct 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_contextandreset_message_contextcommands 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 constantGatewayModuleimproves 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.SuiExampletor.SuiExampleArbiCallproperly reflects the separation of arbitrary and authenticated call example packages.
46-52: LGTM: Proper use of generalized withdraw-and-call method.The migration to
SuiWithdrawAndCallwithCallOptionscorrectly 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
SuiExampleArbiCallcorrectly differentiates between arbitrary and authenticated call examples. Gas limit parsing follows the established pattern usingutils.ParseBigInt.
42-49: LGTM: Method generalization improves code reusability.The change from
SuiWithdrawAndCallFungibleTokento the more genericSuiWithdrawAndCallwith 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
SuiExamplefield to separateSuiExampleArbiCallandSuiExampleAuthCallfields provides better type safety and clarity for different call scenarios.
306-307: LGTM: Consistent copying of new example fields.The
CopyAddressesFrommethod 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
FuncSetMessageContextandFuncResetMessageContextconstants 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
ptbWithdrawAndArbiCallCmdCountand addition ofptbWithdrawAndAuthCallCmdCountclearly differentiates between arbitrary (3 commands) and authenticated (5 commands) call transaction structures.
125-125: LGTM: Consistent use of module constant.Using
GatewayModuleconstant 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
SuiExampleAuthCallpackage for authenticated calls- Creating proper authenticated payload with authorized sender
- Setting
IsArbitraryCall: falseto 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: trueand 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
ReadMoveBinaryBase64function correctly handles runtime file reading with appropriate error handling. The#nosec G304comment 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: falsefor 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: falsefor 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.GatewayModuleconstant instead of hardcoding the module name enhances maintainability and consistency across the codebase.
102-118: LGTM!The refactored
suiPatchMoveConfigfunction is now more generic and reusable. The use offilepath.Joinfor 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.GatewayModuleconstant 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
NewGatewayFromPairIDtoNewGatewayFromTripletcorrectly 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
isArbitraryCallparameter to distinguish call types- Renaming
receivertotargetfor better semantic accuracy- Addition of
senderfield 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
moduleNametoGatewayModuleand 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
ethcommonimport 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
zetasuipackage 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
cctxprovides necessary context for authenticated calls. The addition ofsender,target, andisArbitraryCallfields properly supports the new functionality.
262-262: Consistent error handling with zetasui package.The migration to
zetasuierror 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
zrc20as 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
MessageContextobject 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
onCallTypeArgsmethod 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:
- Sets the message context with sender and target
- Executes the on_call with proper arguments
- 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.
e2e/contracts/sui/example-authenticated-call/sources/token.move
Outdated
Show resolved
Hide resolved
Yea, having a sub dir |
lumtis
left a comment
There was a problem hiding this comment.
It looks good to me. We will have to do some manual testing.
Description
This PR is still in the progress of development.
What's done
v1.51.5, otherwise compile will fail.zetaclient.-
sui_withdraw_and_call-
sui_withdraw_and_call_revert_with_call-
sui_token_withdraw_and_call-
sui_token_withdraw_and_call_revert_with_callCloses: #3825
How Has This Been Tested?
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Documentation
Chores