Skip to content

refactor: add documentation for ZetaClient logging fields#4174

Merged
renan061 merged 5 commits intodevelopfrom
feature/logging-docs
Sep 18, 2025
Merged

refactor: add documentation for ZetaClient logging fields#4174
renan061 merged 5 commits intodevelopfrom
feature/logging-docs

Conversation

@renan061
Copy link
Member

@renan061 renan061 commented Sep 9, 2025

Description

This PR mainly adds documentation for log fields.
It also does some minor refactors on log-related code.

  • refactor: use coin.CoinType for compliance logging
  • refactor: add documentation for zetaclient logging fields

Closes #4171.

How Has This Been Tested?

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

@renan061 renan061 self-assigned this Sep 9, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 9, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

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

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

📝 Walkthrough

Walkthrough

Refactors ZetaClient logging: removes method/tracker/confirmation_mode fields, consolidates module names via constants, adjusts field names and formatting, and drops per-observer GasPrice/Headers loggers. Adds caller info to loggers. Updates many components to use base loggers and Stringer fields. Introduces logs README and changelog entry.

Changes

Cohort / File(s) Summary
Logging schema and docs
zetaclient/logs/fields.go, zetaclient/logs/README.md, changelog.md
Standardizes log field/module constants; removes FieldMethod/FieldTracker/FieldConfirmationMode; adds FieldBtcTxid; updates ModNameGasPrice and adds multiple module constants; documents logging fields; notes change in changelog.
Base logger refactor
zetaclient/chains/base/logger.go, zetaclient/chains/base/observer.go, zetaclient/chains/base/signer.go, zetaclient/chains/base/observer_test.go
Removes ObserverLogger.GasPrice and .Headers; adds Caller() to logger; shifts to base loggers; replaces literal module with logs.ModNameSigner; updates tests accordingly.
Bitcoin observer/signer logging
zetaclient/chains/bitcoin/observer/* (inbound.go, inbound_tracker.go, mempool.go, observer.go, outbound.go, utxos.go, witness.go), zetaclient/chains/bitcoin/signer/* (sign_rbf.go, signer.go)
Drops method-name fields; uses base loggers; switches to Stringer for types; adjusts field builders; minor panic log tweak; no control-flow changes.
EVM observer/signer logging
zetaclient/chains/evm/observer/* (inbound.go, observer_gas.go, outbound.go, v2_inbound.go), zetaclient/chains/evm/signer/* (outbound_tracker_reporter.go, signer.go)
Removes method fields; normalizes send_id; uses Chain logger for gas price and Stringer formatting; renames parameters in v2 parsers; simplifies logger construction.
Solana observer/signer logging
zetaclient/chains/solana/observer/* (inbound.go, inbound_parser.go, outbound.go), zetaclient/chains/solana/signer/* (outbound_tracker_reporter.go, signer.go)
Eliminates method field usage; keeps existing contextual fields; removes unused logs import in parser; no functional changes.
Sui observer/signer logging
zetaclient/chains/sui/observer/outbound.go, zetaclient/chains/sui/signer/* (signer_tracker.go, signer_tx.go)
Simplifies logger construction; changes tracker field key to "tracker_id"; removes method tags from multiple paths; no logic changes.
TON observer logging
zetaclient/chains/ton/observer/inbound.go, zetaclient/chains/ton/observer/outbound.go
Removes logs import where unused; drops method field; retains tx fields; no behavior changes.
Orchestrator, TSS, ZetaCore modules
zetaclient/orchestrator/orchestrator.go, zetaclient/tss/* (healthcheck.go, keygen.go, service.go, setup.go), zetaclient/zetacore/* (client.go, broadcast.go, client_monitor.go, client_vote.go)
Replaces literal module strings with logs constants; expands structured fields in broadcast error; removes method fields from client monitors/votes; no control-flow changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • ws4charlie
  • lumtis
  • skosito
  • fbac

Pre-merge checks (3 passed, 2 warnings)

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning Beyond the documentation requested by issue #4171, this pull request also includes extensive refactoring of logging contexts across numerous modules—such as removal of method tags, GasPrice and Headers loggers—that are not directly required to create the documentation. Consider isolating the wide-ranging logging code refactors into a separate pull request and limiting this change set to the documentation additions specified by issue #4171.
Docstring Coverage ⚠️ Warning Docstring coverage is 78.57% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly highlights the primary change of adding documentation for ZetaClient logging fields and concisely conveys the pull request’s focus on logging infrastructure without extraneous details. It is clear and directly related to the main change set.
Linked Issues Check ✅ Passed The pull request delivers a comprehensive README under zetaclient/logs that enumerates all logging fields with their meanings and standardizes module names, fully satisfying the documentation objectives of issue #4171.
Description Check ✅ Passed The current pull request description includes both the “# Description” and “# How Has This Been Tested?” sections from the repository template, provides a concise summary of changes, references the related issue (#4171), and presents a test checklist with unit tests marked as passing.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@renan061 renan061 added docs Improvements or additions to documentation zetaclient Issues related to ZetaClient labels Sep 9, 2025
@renan061 renan061 force-pushed the feature/logging-docs branch 4 times, most recently from 41c9a41 to beb8487 Compare September 9, 2025 20:51
@codecov
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

❌ Patch coverage is 36.11111% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.04%. Comparing base (abbefbe) to head (e493bba).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
zetaclient/compliance/compliance.go 0.00% 14 Missing ⚠️
zetaclient/chains/evm/observer/v2_inbound.go 0.00% 6 Missing ⚠️
zetaclient/chains/solana/signer/increment_nonce.go 0.00% 2 Missing ⚠️
zetaclient/chains/ton/signer/signer_compose.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4174      +/-   ##
===========================================
+ Coverage    66.03%   66.04%   +0.01%     
===========================================
  Files          455      455              
  Lines        34010    34008       -2     
===========================================
+ Hits         22458    22462       +4     
+ Misses       10570    10564       -6     
  Partials       982      982              
Files with missing lines Coverage Δ
zetaclient/chains/base/signer.go 56.43% <100.00%> (ø)
zetaclient/chains/bitcoin/observer/event.go 90.32% <100.00%> (+0.10%) ⬆️
zetaclient/chains/evm/observer/inbound.go 41.30% <100.00%> (+0.29%) ⬆️
zetaclient/chains/solana/observer/inbound.go 36.61% <100.00%> (ø)
zetaclient/chains/sui/observer/inbound.go 66.10% <100.00%> (ø)
zetaclient/chains/ton/observer/inbound.go 63.05% <100.00%> (ø)
zetaclient/chains/ton/signer/signer_compose.go 73.43% <0.00%> (ø)
zetaclient/chains/solana/signer/increment_nonce.go 0.00% <0.00%> (ø)
zetaclient/chains/evm/observer/v2_inbound.go 2.89% <0.00%> (ø)
zetaclient/compliance/compliance.go 28.57% <0.00%> (+5.71%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@renan061 renan061 marked this pull request as ready for review September 9, 2025 21:05
@renan061 renan061 requested a review from a team as a code owner September 9, 2025 21:05
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
zetaclient/tss/service.go (1)

415-420: Refactor ZetaClient log field keys to snake_case

  • In zetaclient/tss/service.go, replace
    "tss.chain_id""tss_chain_id",
    "tss.block_height""tss_block_height",
    "tss.nonce""tss_nonce".
  • In zetaclient/chains/ton/signer/signer_compose.go, replace
    "outbound.recipient""outbound_recipient",
    "outbound.amount""outbound_amount",
    "outbound.nonce""outbound_nonce",
    "outbound.cancel""outbound_cancel",
    "outbound.cancel_reason""outbound_cancel_reason".
  • In zetaclient/chains/solana/observer/inbound_parser.go, replace camelCase
    "eventIndex""event_index".
    Apply these changes to comply with the ZetaClient logging standard (no dots or camelCase in field keys).
zetaclient/chains/solana/signer/signer.go (2)

317-321: Invalid loop: cannot range over an integer constant.

for range broadcastRetries will not compile. Use a counted loop.

- for range broadcastRetries {
+ for i := 0; i < broadcastRetries; i++ {

516-521: Nil-wrapping bug returns nil error when PDA nonce > outbound nonce.

errors.Wrapf(err, ...) with err == nil returns nil. Return a new error instead.

-        case pdaNonce > nonce:
-            return errors.Wrapf(err, "PDA nonce %d is greater than outbound nonce %d", pdaNonce, nonce)
+        case pdaNonce > nonce:
+            return errors.Errorf("PDA nonce %d is greater than outbound nonce %d", pdaNonce, nonce)
🧹 Nitpick comments (32)
changelog.md (1)

14-14: Changelog category: add a Documentation entry for the new README

This PR also adds a logging README. Consider adding a Documentation section entry so operators notice it.

 ## Unreleased

 ### Features
@@
 ### Refactor
@@
 * [4144](https://github.com/zeta-chain/node/pull/4144) - standardize structured logging for zetaclient
 * [4174](https://github.com/zeta-chain/node/pull/4174) - add documentation for ZetaClient logging fields
+
+### Documentation
+
+* [4174](https://github.com/zeta-chain/node/pull/4174) - ZetaClient logging fields reference (zetaclient/logs/README.md)
zetaclient/zetacore/client_monitor.go (1)

142-163: Include zeta_tx on the inbound logger and normalize case like outbound

Current inbound path logs zeta_tx per call but not in the logger, and string matching is case-sensitive unlike outbound. Unify for consistency and resilience.

-logger := c.logger.With().Str("inbound_raw_log", txResult.RawLog).Logger()
+logger := c.logger.With().
+  Str(logs.FieldZetaTx, zetaTxHash).
+  Str("inbound_raw_log", txResult.RawLog).
+  Logger()
-
-switch {
- case strings.Contains(txResult.RawLog, "failed to execute message"):
+raw := strings.ToLower(txResult.RawLog)
+switch {
+ case strings.Contains(raw, "failed to execute message"):
   // the inbound vote tx shouldn't fail to execute. this shouldn't happen
-  logger.Error().Str(logs.FieldZetaTx, zetaTxHash).Msg("failed to execute vote")
+  logger.Error().Msg("failed to execute vote")
 
- case strings.Contains(txResult.RawLog, "out of gas"):
+ case strings.Contains(raw, "out of gas"):
   // if the tx fails with an out of gas error, resend the tx with more gas if retryGasLimit > 0
-  logger.Debug().Str(logs.FieldZetaTx, zetaTxHash).Msg("out of gas")
+  logger.Debug().Msg("out of gas")
   if retryGasLimit > 0 {
     // new retryGasLimit set to 0 to prevent reentering this function
     resentZetaTxHash, _, err := c.PostVoteInbound(ctx, retryGasLimit, 0, msg)
     if err != nil {
-      logger.Error().Err(err).Str(logs.FieldZetaTx, zetaTxHash).Msg("failed to resend tx")
+      logger.Error().Err(err).Msg("failed to resend tx")
     } else {
-      logger.Info().Str(logs.FieldZetaTx, resentZetaTxHash).Msg("successfully resent tx")
+      logger.Info().Str(logs.FieldZetaTx, resentZetaTxHash).Msg("successfully resent tx")
     }
   }
 default:
-  logger.Debug().Str(logs.FieldZetaTx, zetaTxHash).Msg("successful")
+  logger.Debug().Msg("successful")
zetaclient/chains/solana/observer/inbound_parser.go (4)

59-65: Use snake_case for log field keys and clarify index meaning

Adopt snake_case per team convention and distinguish instruction index explicitly.

-    Uint16("index", instruction.ProgramIDIndex).
+    Uint16("instruction_index", instruction.ProgramIDIndex).

97-101: Standardize to snake_case for event index

Aligns with repository logging style.

-        Uint32("eventIndex", p.eventIndex-1).
+        Uint32("event_index", p.eventIndex-1).

135-139: Apply snake_case consistently in SPL deposit log

-        Uint32("eventIndex", p.eventIndex-1).
+        Uint32("event_index", p.eventIndex-1).

173-177: Apply snake_case consistently in call log

-        Uint32("eventIndex", p.eventIndex-1).
+        Uint32("event_index", p.eventIndex-1).
zetaclient/logs/fields.go (1)

31-37: Update TODO to avoid referring to removed FieldMethod

The note suggests reintroducing FieldMethod; that was purposefully removed. Reword to reflect current direction.

-  // TODO: This seems excessive.
-  //       Replace for ModNameTss = "tss", then use FieldMethod for the suffixes?
+  // TODO: Consider collapsing these into ModNameTss = "tss" and introducing a
+  //       dedicated field key (e.g., "tss_phase") to differentiate phases
+  //       like healthcheck/keygen/keysign/service/setup.
zetaclient/zetacore/client.go (1)

146-151: Standardized module name applied correctly. Consider adding caller context.

Looks good. If the base logger doesn’t already attach caller info globally, consider adding .Caller() here for parity with the PR goal of replacing method fields with caller metadata.

- logger:  logger.With().Str(logs.FieldModule, logs.ModNameClientZetaCore).Logger(),
+ logger:  logger.With().Caller().Str(logs.FieldModule, logs.ModNameClientZetaCore).Logger(),
zetaclient/orchestrator/orchestrator.go (1)

377-383: Switched to constant module name — good. Optionally include caller info.

This aligns with the logging standardization. If not already handled upstream in base logger, consider .Caller() to preserve method attribution without FieldMethod.

- std := baseLogger.Std.With().Str(logs.FieldModule, logs.ModNameOrchestrator).Logger()
+ std := baseLogger.Std.With().Caller().Str(logs.FieldModule, logs.ModNameOrchestrator).Logger()
zetaclient/tss/keygen.go (1)

76-76: Unify logger name with module constant.

Minor consistency tweak: reuse logs.ModNameTssKeyGen instead of a hard-coded string.

- err := ticker.Run(ctx, interval, task, ticker.WithLogger(logger, "tss_keygen"))
+ err := ticker.Run(ctx, interval, task, ticker.WithLogger(logger, logs.ModNameTssKeyGen))
zetaclient/logs/README.md (2)

4-5: Clarify structured-logging wording.

It’s a JSON object of key–value pairs, not an “array.”

Apply:

-Remember that with structured logging all messages are represented as an array of key-value pairs,
-as in `{"key_1": "value_1", ..., "key_n": "value_n"}`.
+Remember that with structured logging all messages are JSON objects of key-value pairs,
+for example: `{"key_1": "value_1", ..., "key_n": "value_n"}`.

20-21: Grammar fix.

“a inbound” → “an inbound”.

Apply:

-- `"ballot"`: ballot from voting on a inbound or outbound cross-chain transaction.
+- `"ballot"`: ballot from voting on an inbound or outbound cross-chain transaction.
zetaclient/chains/sui/signer/signer_tracker.go (1)

29-30: Ensure context logger carries base fields (module/chain).

Using zerolog.Ctx(ctx) is fine if ctx embeds the base logger; otherwise you’ll lose standardized fields. Consider using the signer’s base logger.

Apply if needed:

-logger := zerolog.Ctx(ctx).With().Str(logs.FieldTx, digest).Logger()
+logger := s.Logger().Std.With().Str(logs.FieldTx, digest).Logger()

Would you like a quick grep script to verify where the context logger is seeded?

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

121-123: Minor: avoid double GetPendingNonce call.

Reuse the local variable to skip an extra lock/read.

Apply:

-	pendingNonce := ob.GetPendingNonce()
-	if ob.GetPendingNonce() == 0 {
+	pendingNonce := ob.GetPendingNonce()
+	if pendingNonce == 0 {
zetaclient/chains/bitcoin/observer/observer.go (2)

167-170: Standardize module field; avoid introducing a new module value.

The README lists allowed module values and “utxos” isn’t one of them. Prefer keeping module as outbound and tagging a component. Also use logs.FieldModule constant when setting module keys elsewhere.

Apply:

-			UTXOs:          baseObserver.Logger().Chain.With().Str("module", "utxos").Logger(),
+			UTXOs:          baseObserver.Logger().Outbound.With().Str("component", "utxos").Logger(),

321-325: Nit: don’t attach a nil error.

When blockNumber == 0, err is nil; avoid .Err(err) to reduce noise.

Apply:

-		ob.Logger().Chain.Debug().Err(err).Msg("bitcoin node is not enabled")
+		ob.Logger().Chain.Debug().Msg("bitcoin node is not enabled")
zetaclient/chains/bitcoin/observer/utxos.go (1)

207-208: Fix function name in error string.

Error message should reflect the actual function name.

Apply:

-	return -1, fmt.Errorf("FindNonceMarkUTXO: cannot find nonce-mark utxo with nonce %d", nonce)
+	return -1, fmt.Errorf("findNonceMarkUTXO: cannot find nonce-mark utxo with nonce %d", nonce)
zetaclient/chains/solana/observer/outbound.go (1)

176-183: Update stale comment about retry gas.

The comment mentions “set retryGasLimit to 0,” but code selects constants and conditionally uses revert gas.

Apply:

-	// so we set retryGasLimit to 0 because the solana gateway withdrawal will always succeed
-	// and the vote msg won't trigger ZEVM interaction
+	// The vote message does not trigger ZEVM execution; gasLimit is static.
+	// retryGasLimit uses default or revert gas depending on status.
zetaclient/chains/bitcoin/observer/witness.go (1)

171-175: Unify tx hash field key within this file

This file mixes logs.FieldBtcTxid and logs.FieldTx. Prefer a single key for consistency (recommend logs.FieldTx unless BTC-specific analytics require FieldBtcTxid).

Apply if you choose to standardize on logs.FieldTx:

-    logger.Debug().
-      Str(logs.FieldBtcTxid, tx.Txid).
+    logger.Debug().
+      Str(logs.FieldTx, tx.Txid).
       Msg("txn has fewer than 2 outputs, not target OP_RETURN txn")

Also applies to: 202-219

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

492-496: Use consistent tx hash field key

Prefer logs.FieldTx over the ad-hoc "inbound" field for tx hash to keep log schema consistent.

- ob.Logger().Inbound.Info().
-   Str("inbound", tx.Hash).
-   Msg("no ZetaSent event found for inbound")
+ ob.Logger().Inbound.Info().
+   Str(logs.FieldTx, tx.Hash).
+   Msg("no ZetaSent event found for inbound")
zetaclient/chains/sui/signer/signer_tx.go (3)

267-267: Ensure a logger is always present

zerolog.Ctx(ctx) can be unset; prefer falling back to s.Logger().Std to avoid dropping logs.

- logger := zerolog.Ctx(ctx)
+ logger := s.Logger().Std
+ if ctxLogger := zerolog.Ctx(ctx); ctxLogger != nil {
+   logger = *ctxLogger
+ }

324-325: Normalize error field name

Use a consistent lowercase "error" key instead of "Err" for string payloads; reserve Err(...) for structured errors.

- logger.Info().Any("Err", res.Effects.Status.Error).Msg("cancelling tx")
+ logger.Info().Str("error", res.Effects.Status.Error).Msg("cancelling tx")

332-332: Apply same logger fallback in cancel path

Mirror the earlier fallback to avoid missing logs if ctx has no logger.

- logger := zerolog.Ctx(ctx)
+ logger := s.Logger().Std
+ if ctxLogger := zerolog.Ctx(ctx); ctxLogger != nil {
+   logger = *ctxLogger
+ }
zetaclient/chains/bitcoin/observer/inbound.go (1)

191-193: Minor consistency: prefer accessor for logger

Consider ob.Logger().Inbound.With().Str(...).Logger() instead of referencing ob.logger directly for consistency with the rest of the file.

- logger := ob.logger.Inbound.With().Str(logs.FieldTx, event.TxHash).Logger()
+ logger := ob.Logger().Inbound.With().Str(logs.FieldTx, event.TxHash).Logger()
zetaclient/chains/bitcoin/observer/outbound.go (2)

36-36: Prefer With().Caller() to replace removed method tagging

Align these loggers with the PR objective (replace FieldMethod) by adding Caller for better traceability.

Apply:

@@
-	logger := ob.logger.Outbound
+	logger := ob.logger.Outbound.With().Caller().Logger()
@@
-	logger     = ob.logger.Outbound.With().
+	logger     = ob.logger.Outbound.With().
 		Uint64(logs.FieldNonce, nonce).
 		Str(logs.FieldOutboundID, outboundID).
-		Logger()
+		Caller().
+		Logger()
@@
-	logger := ob.logger.Outbound
+	logger := ob.logger.Outbound.With().Caller().Logger()
@@
-	logger := ob.logger.Outbound.With().
+	logger := ob.logger.Outbound.With().
 		Uint64(logs.FieldNonce, cctx.GetCurrentOutboundParam().TssNonce).
 		Str(logs.FieldTx, txHash).
-		Logger()
+		Caller().
+		Logger()
@@
-	logger := ob.logger.Outbound.With().
+	logger := ob.logger.Outbound.With().
 		Uint64(logs.FieldNonce, nonce).
 		Str(logs.FieldTx, txHash).
 		Str(logs.FieldOutboundID, outboundID).
-		Logger()
+		Caller().
+		Logger()

Also applies to: 108-116, 224-224, 281-285, 319-324


281-285: Confirm inclusion threshold (minTxConfirmations) matches production intent

checkTxInclusion currently accepts mempool (0-confirmation) txs as “included.” Verify this is intentional for production, not only for tests/RBF exercises, to avoid premature state advances.

If desired, gate this via chain params:

-const minTxConfirmations = 0
+// derive from chain params to decouple test vs prod behavior
+var minTxConfirmations = 0 // default; overwritten at init from ChainParams
zetaclient/chains/evm/observer/outbound.go (2)

43-43: Add Caller to base outbound logger

Keep logs actionable without manual method fields.

-	logger := ob.Logger().Outbound
+	logger := ob.Logger().Outbound.With().Caller().Logger()

159-161: Standardize outbound identifier and include caller

Use the shared OutboundID and the canonical field key to align with Bitcoin and tooling. Also add Caller().

-	receipt, transaction := ob.getTxNReceipt(nonce)
-	sendID := fmt.Sprintf("%d-%d", ob.Chain().ChainId, nonce)
-	logger := ob.Logger().Outbound.With().Str("send_id", sendID).Logger()
+	receipt, transaction := ob.getTxNReceipt(nonce)
+	outboundID := ob.OutboundID(nonce)
+	logger := ob.Logger().Outbound.
+		With().
+		Str(logs.FieldOutboundID, outboundID).
+		Caller().
+		Logger()
zetaclient/chains/evm/observer/v2_inbound.go (3)

381-385: Consistency nit: use ethlogs/ethlog here as well

Match the updated naming used in other parsers for uniformity.

-func (ob *Observer) parseAndValidateDepositAndCallEvents(
-	rawLogs []ethtypes.Log,
+func (ob *Observer) parseAndValidateDepositAndCallEvents(
+	ethlogs []ethtypes.Log,
 	gatewayAddr ethcommon.Address,
 	gatewayContract *gatewayevm.GatewayEVM,
 ) []*gatewayevm.GatewayEVMDepositedAndCalled {
 	// collect and sort validEvents by block number, then tx index, then log index (ascending)
 	validEvents := make([]*gatewayevm.GatewayEVMDepositedAndCalled, 0)
-	for _, log := range rawLogs {
-		err := common.ValidateEvmTxLog(&log, gatewayAddr, "", common.TopicsGatewayDepositAndCall)
+	for _, ethlog := range ethlogs {
+		err := common.ValidateEvmTxLog(&ethlog, gatewayAddr, "", common.TopicsGatewayDepositAndCall)
 		if err != nil {
 			continue
 		}
-		depositAndCallEvent, err := gatewayContract.ParseDepositedAndCalled(log)
+		depositAndCallEvent, err := gatewayContract.ParseDepositedAndCalled(ethlog)
 		if err != nil {
 			ob.Logger().Inbound.Warn().
-				Stringer(logs.FieldTx, log.TxHash).
-				Uint64(logs.FieldBlock, log.BlockNumber).
+				Stringer(logs.FieldTx, ethlog.TxHash).
+				Uint64(logs.FieldBlock, ethlog.BlockNumber).
 				Msg("invalid DepositedAndCall event")
 			continue
 		}
 		validEvents = append(validEvents, depositAndCallEvent)
 	}

Also applies to: 388-404


293-296: Message casing nit

Align with other warnings (“multiple … in same tx”).

-				Msg("Multiple Call events in same tx")
+				Msg("multiple Call events in same tx")

450-452: Avoid magic number for gas limit

Use the shared constant for maintainability and config overrides.

-		1_500_000,
+		zetacore.PostVoteInboundExecutionGasLimit,

Please confirm this constant matches the intended execution path for DepositAndCall on all supported chains.

zetaclient/chains/base/observer.go (1)

283-283: Add Caller to chain-level logger initialization sites

Helps trace env/DB scanning flows without method fields.

-	logger := ob.logger.Chain
+	logger := ob.logger.Chain.With().Caller().Logger()

Also applies to: 341-341

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c2973cc and beb8487.

📒 Files selected for processing (41)
  • changelog.md (1 hunks)
  • zetaclient/chains/base/logger.go (1 hunks)
  • zetaclient/chains/base/observer.go (4 hunks)
  • zetaclient/chains/base/observer_test.go (0 hunks)
  • zetaclient/chains/base/signer.go (1 hunks)
  • zetaclient/chains/bitcoin/observer/inbound.go (2 hunks)
  • zetaclient/chains/bitcoin/observer/inbound_tracker.go (1 hunks)
  • zetaclient/chains/bitcoin/observer/mempool.go (1 hunks)
  • zetaclient/chains/bitcoin/observer/observer.go (1 hunks)
  • zetaclient/chains/bitcoin/observer/outbound.go (2 hunks)
  • zetaclient/chains/bitcoin/observer/utxos.go (1 hunks)
  • zetaclient/chains/bitcoin/observer/witness.go (1 hunks)
  • zetaclient/chains/bitcoin/signer/sign_rbf.go (1 hunks)
  • zetaclient/chains/bitcoin/signer/signer.go (2 hunks)
  • zetaclient/chains/evm/observer/inbound.go (2 hunks)
  • zetaclient/chains/evm/observer/observer_gas.go (2 hunks)
  • zetaclient/chains/evm/observer/outbound.go (2 hunks)
  • zetaclient/chains/evm/observer/v2_inbound.go (2 hunks)
  • zetaclient/chains/evm/signer/outbound_tracker_reporter.go (0 hunks)
  • zetaclient/chains/evm/signer/signer.go (1 hunks)
  • zetaclient/chains/solana/observer/inbound.go (0 hunks)
  • zetaclient/chains/solana/observer/inbound_parser.go (1 hunks)
  • zetaclient/chains/solana/observer/outbound.go (1 hunks)
  • zetaclient/chains/solana/signer/outbound_tracker_reporter.go (0 hunks)
  • zetaclient/chains/solana/signer/signer.go (1 hunks)
  • zetaclient/chains/sui/observer/outbound.go (1 hunks)
  • zetaclient/chains/sui/signer/signer_tracker.go (1 hunks)
  • zetaclient/chains/sui/signer/signer_tx.go (2 hunks)
  • zetaclient/chains/ton/observer/inbound.go (1 hunks)
  • zetaclient/chains/ton/observer/outbound.go (0 hunks)
  • zetaclient/logs/README.md (1 hunks)
  • zetaclient/logs/fields.go (1 hunks)
  • zetaclient/orchestrator/orchestrator.go (1 hunks)
  • zetaclient/tss/healthcheck.go (1 hunks)
  • zetaclient/tss/keygen.go (2 hunks)
  • zetaclient/tss/service.go (1 hunks)
  • zetaclient/tss/setup.go (1 hunks)
  • zetaclient/zetacore/broadcast.go (1 hunks)
  • zetaclient/zetacore/client.go (1 hunks)
  • zetaclient/zetacore/client_monitor.go (3 hunks)
  • zetaclient/zetacore/client_vote.go (2 hunks)
💤 Files with no reviewable changes (5)
  • zetaclient/chains/evm/signer/outbound_tracker_reporter.go
  • zetaclient/chains/ton/observer/outbound.go
  • zetaclient/chains/base/observer_test.go
  • zetaclient/chains/solana/signer/outbound_tracker_reporter.go
  • zetaclient/chains/solana/observer/inbound.go
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go

⚙️ CodeRabbit configuration file

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

Files:

  • zetaclient/chains/base/signer.go
  • zetaclient/chains/sui/signer/signer_tracker.go
  • zetaclient/zetacore/client_vote.go
  • zetaclient/zetacore/client.go
  • zetaclient/orchestrator/orchestrator.go
  • zetaclient/tss/service.go
  • zetaclient/chains/bitcoin/observer/mempool.go
  • zetaclient/chains/solana/observer/inbound_parser.go
  • zetaclient/chains/bitcoin/signer/signer.go
  • zetaclient/chains/bitcoin/signer/sign_rbf.go
  • zetaclient/tss/keygen.go
  • zetaclient/chains/bitcoin/observer/observer.go
  • zetaclient/chains/evm/observer/inbound.go
  • zetaclient/chains/bitcoin/observer/utxos.go
  • zetaclient/chains/evm/signer/signer.go
  • zetaclient/zetacore/broadcast.go
  • zetaclient/chains/sui/observer/outbound.go
  • zetaclient/chains/bitcoin/observer/outbound.go
  • zetaclient/chains/bitcoin/observer/inbound.go
  • zetaclient/chains/base/logger.go
  • zetaclient/chains/bitcoin/observer/witness.go
  • zetaclient/chains/ton/observer/inbound.go
  • zetaclient/chains/solana/observer/outbound.go
  • zetaclient/chains/bitcoin/observer/inbound_tracker.go
  • zetaclient/chains/evm/observer/outbound.go
  • zetaclient/tss/healthcheck.go
  • zetaclient/chains/solana/signer/signer.go
  • zetaclient/tss/setup.go
  • zetaclient/chains/evm/observer/observer_gas.go
  • zetaclient/chains/sui/signer/signer_tx.go
  • zetaclient/chains/evm/observer/v2_inbound.go
  • zetaclient/chains/base/observer.go
  • zetaclient/zetacore/client_monitor.go
  • zetaclient/logs/fields.go
🧠 Learnings (7)
📓 Common learnings
Learnt from: renan061
PR: zeta-chain/node#4144
File: zetaclient/chains/ton/observer/inbound.go:383-383
Timestamp: 2025-09-02T18:20:20.639Z
Learning: In ZetaClient logging standardization, use underscores instead of dots for log field keys (e.g., "transaction_hash" not "transaction.hash") to avoid interference with terminal regex filtering and log analysis tools.
📚 Learning: 2025-03-04T22:39:58.395Z
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.

Applied to files:

  • zetaclient/chains/base/signer.go
  • zetaclient/chains/bitcoin/signer/signer.go
  • zetaclient/chains/evm/signer/signer.go
  • zetaclient/chains/solana/signer/signer.go
  • zetaclient/chains/sui/signer/signer_tx.go
📚 Learning: 2024-11-27T22:01:49.732Z
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.

Applied to files:

  • zetaclient/orchestrator/orchestrator.go
📚 Learning: 2024-09-23T19:51:43.360Z
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.

Applied to files:

  • zetaclient/chains/bitcoin/observer/utxos.go
  • zetaclient/chains/bitcoin/observer/outbound.go
📚 Learning: 2024-09-19T18:22:35.964Z
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.

Applied to files:

  • zetaclient/chains/bitcoin/observer/inbound.go
  • zetaclient/chains/bitcoin/observer/witness.go
  • zetaclient/chains/evm/observer/outbound.go
  • zetaclient/chains/evm/observer/v2_inbound.go
📚 Learning: 2025-09-02T18:20:20.639Z
Learnt from: renan061
PR: zeta-chain/node#4144
File: zetaclient/chains/ton/observer/inbound.go:383-383
Timestamp: 2025-09-02T18:20:20.639Z
Learning: In ZetaClient logging standardization, use underscores instead of dots for log field keys (e.g., "transaction_hash" not "transaction.hash") to avoid interference with terminal regex filtering and log analysis tools.

Applied to files:

  • zetaclient/logs/README.md
📚 Learning: 2024-08-01T18:08:13.681Z
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.

Applied to files:

  • zetaclient/zetacore/client_monitor.go
🧬 Code graph analysis (23)
zetaclient/chains/base/signer.go (1)
zetaclient/logs/fields.go (2)
  • FieldModule (6-6)
  • ModNameSigner (27-27)
zetaclient/chains/sui/signer/signer_tracker.go (1)
zetaclient/logs/fields.go (1)
  • FieldTx (11-11)
zetaclient/zetacore/client.go (1)
zetaclient/logs/fields.go (2)
  • FieldModule (6-6)
  • ModNameClientZetaCore (30-30)
zetaclient/orchestrator/orchestrator.go (2)
zetaclient/logs/fields.go (2)
  • FieldModule (6-6)
  • ModNameOrchestrator (24-24)
zetaclient/chains/base/logger.go (1)
  • Logger (18-21)
zetaclient/tss/service.go (1)
zetaclient/logs/fields.go (2)
  • FieldModule (6-6)
  • ModNameTssService (36-36)
zetaclient/chains/bitcoin/signer/signer.go (3)
zetaclient/chains/base/logger.go (1)
  • Logger (18-21)
zetaclient/chains/bitcoin/observer/observer.go (1)
  • Logger (82-88)
zetaclient/logs/fields.go (2)
  • FieldCctx (12-12)
  • FieldNonce (10-10)
zetaclient/chains/bitcoin/signer/sign_rbf.go (2)
zetaclient/chains/base/logger.go (1)
  • Logger (18-21)
zetaclient/logs/fields.go (2)
  • FieldNonce (10-10)
  • FieldTx (11-11)
zetaclient/tss/keygen.go (1)
zetaclient/logs/fields.go (3)
  • FieldModule (6-6)
  • ModNameTssKeyGen (34-34)
  • ModNameTssKeySign (35-35)
zetaclient/chains/evm/signer/signer.go (1)
e2e/runner/accounting.go (1)
  • Amount (31-34)
zetaclient/chains/sui/observer/outbound.go (1)
zetaclient/logs/fields.go (1)
  • FieldNonce (10-10)
zetaclient/chains/bitcoin/observer/inbound.go (2)
zetaclient/chains/bitcoin/observer/observer.go (1)
  • Logger (82-88)
zetaclient/logs/fields.go (1)
  • FieldTx (11-11)
zetaclient/chains/base/logger.go (1)
zetaclient/chains/bitcoin/observer/observer.go (1)
  • Logger (82-88)
zetaclient/chains/bitcoin/observer/witness.go (1)
zetaclient/logs/fields.go (1)
  • FieldTx (11-11)
zetaclient/chains/ton/observer/inbound.go (2)
zetaclient/chains/base/logger.go (1)
  • Logger (18-21)
zetaclient/chains/bitcoin/observer/observer.go (1)
  • Logger (82-88)
zetaclient/chains/bitcoin/observer/inbound_tracker.go (2)
zetaclient/logs/fields.go (1)
  • FieldCoinType (16-16)
pkg/contracts/sui/coin.go (1)
  • CoinType (4-4)
zetaclient/chains/evm/observer/outbound.go (1)
zetaclient/chains/base/logger.go (1)
  • Logger (18-21)
zetaclient/tss/healthcheck.go (1)
zetaclient/logs/fields.go (2)
  • FieldModule (6-6)
  • ModNameTssHealthCheck (33-33)
zetaclient/chains/solana/signer/signer.go (1)
zetaclient/logs/fields.go (2)
  • FieldNonce (10-10)
  • FieldTx (11-11)
zetaclient/tss/setup.go (1)
zetaclient/logs/fields.go (2)
  • FieldModule (6-6)
  • ModNameTssSetup (37-37)
zetaclient/chains/evm/observer/observer_gas.go (1)
zetaclient/logs/fields.go (2)
  • FieldModule (6-6)
  • ModNameGasPrice (28-28)
zetaclient/chains/evm/observer/v2_inbound.go (3)
zetaclient/chains/evm/common/validation.go (1)
  • ValidateEvmTxLog (16-30)
zetaclient/chains/evm/common/constant.go (1)
  • TopicsGatewayDeposit (45-45)
zetaclient/logs/fields.go (2)
  • FieldTx (11-11)
  • FieldBlock (9-9)
zetaclient/chains/base/observer.go (2)
testutil/sample/sample.go (1)
  • Chain (141-158)
zetaclient/logs/fields.go (1)
  • FieldChainNetwork (8-8)
zetaclient/zetacore/client_monitor.go (1)
zetaclient/logs/fields.go (1)
  • FieldZetaTx (13-13)
⏰ 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). (2)
  • GitHub Check: lint
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (30)
zetaclient/zetacore/client_monitor.go (2)

32-32: LGTM: zeta_tx added to outbound monitor context

Consistent with logging field standards.


106-106: LGTM: zeta_tx added to inbound monitor callsite logger

Matches the new field usage approach.

zetaclient/logs/fields.go (2)

19-20: LGTM: FieldBtcTxid introduced

Clear, chain-specific key.


6-17: LGTM: core field keys consolidated

Consistent with recent logging cleanup.

zetaclient/tss/setup.go (2)

44-44: LGTM: module name standardized via constant

Improves consistency for filtering and dashboards.


336-341: LGTM: chain field used for BTC address logging

Works well with structured queries.

zetaclient/tss/service.go (1)

153-153: LGTM: module name standardized via constant

Good centralization.

zetaclient/tss/healthcheck.go (1)

42-42: LGTM: module name standardized via constant

Consistent with the rest of TSS logging.

zetaclient/chains/evm/signer/signer.go (1)

265-266: Stringer usage OK — keep as-is.

myID is sdk.AccAddress and params.Amount is sdkmath.Uint; both implement String(), so zerolog.Stringer(...) compiles and is correct.

zetaclient/chains/solana/signer/signer.go (1)

311-313: LGTM on structured fields.

Switch to standardized field keys for nonce/tx is consistent with the logging guidelines.

zetaclient/tss/keygen.go (2)

54-55: LGTM: module constant applied to ceremony logger.

Matches the repo-wide convention.


281-282: LGTM: keyed TestKeySign logs under standardized module.

No concerns.

zetaclient/chains/bitcoin/signer/sign_rbf.go (1)

21-24: LGTM: moved to typed fields for nonce and tx.

Cleaner and consistent with logging refactor.

zetaclient/zetacore/broadcast.go (1)

176-181: LGTM: expanded structured context on broadcast warnings.

Including chain, nonce, and tx hash improves diagnosability.

zetaclient/chains/bitcoin/signer/signer.go (2)

92-97: LGTM: panic logging simplified and standardized.

Consistent with removal of FieldMethod and adds stack trace context.


104-114: LGTM: per-outbound logger fields standardized.

Uses cctx and nonce with underscore-style keys as per logging guidelines.

zetaclient/chains/base/signer.go (1)

43-45: Good: centralized module constant.

Using logs.ModNameSigner standardizes the module field.

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

44-44: Good: use base outbound logger.

Consistent with the repo-wide logging simplification.

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

253-266: Good: unified outbound logger here.

Removes per-method field while preserving context.

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

184-204: Good: reuse outbound logger and adopt btc_txid field.

Matches FieldBtcTxid introduced in logs.

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

24-26: Good: prefer Stringer over manual String().

Keeps logs consistent and avoids unnecessary allocations.

zetaclient/chains/solana/observer/outbound.go (1)

58-58: Good: use base outbound logger across the flow.

Removes per-method tagging and keeps context lean.

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

369-381: LGTM: contextual logger with tx fields is correct

The logger consolidation is sound and preserves tx context. Field keys follow the underscore convention noted previously.

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

48-54: Logger context looks good; ensure docs list tracker_id

Using FieldNonce via constant is good; tracker_id is clear and snake_case. Ensure the new logging README enumerates tracker_id.

zetaclient/chains/base/logger.go (1)

57-57: Caller() addition approved

Including caller improves traceability. No issues spotted.

zetaclient/chains/evm/observer/inbound.go (2)

104-104: LGTM: use base inbound logger

The simplification to a base logger is appropriate.


147-150: LGTM: scoped logger for block range

The contextual range fields are clear and snake_case.

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

25-25: LGTM: base inbound logger

Change is straightforward and correct.

zetaclient/chains/evm/observer/v2_inbound.go (1)

119-134: LGTM: parameter rename improves clarity; logging fields are consistent

Renaming to ethlogs and using snake_case fields reads cleaner and matches repo conventions.

Also applies to: 254-269

zetaclient/chains/base/observer.go (1)

406-410: LGTM: confirmation_mode logged as snake_case via Stringer

This matches the logging guidelines and removes legacy FieldConfirmationMode.

Copy link
Contributor

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

Looks genreally good, a few comments.
Seems like there are some linting issues.

For the name of the PR, the change actually go beyong what is describe in the title. In the future we can separate these kind of changes into 2 PRs, with one tagged as docs

@renan061 renan061 force-pushed the feature/logging-docs branch from beb8487 to 783634b Compare September 10, 2025 14:54
@renan061 renan061 changed the base branch from develop to feature/refactoring-log-fields September 10, 2025 14:55
@renan061 renan061 marked this pull request as draft September 10, 2025 15:50
@renan061 renan061 force-pushed the feature/logging-docs branch from 783634b to 17fcc4d Compare September 10, 2025 15:52
@renan061
Copy link
Member Author

renan061 commented Sep 10, 2025

For the name of the PR, the change actually go beyong what is describe in the title. In the future we can separate these kind of changes into 2 PRs, with one tagged as docs

Moved the refactoring to #4180.

@renan061 renan061 force-pushed the feature/logging-docs branch 2 times, most recently from 8772e51 to ce252f3 Compare September 10, 2025 17:30
@renan061 renan061 force-pushed the feature/refactoring-log-fields branch from cf60bf5 to d560ce1 Compare September 10, 2025 17:50
@renan061 renan061 force-pushed the feature/logging-docs branch from ce252f3 to 899c874 Compare September 10, 2025 17:52
@renan061 renan061 force-pushed the feature/refactoring-log-fields branch 3 times, most recently from 21197cb to 93eec44 Compare September 12, 2025 19:03
Base automatically changed from feature/refactoring-log-fields to develop September 12, 2025 19:49
@ws4charlie
Copy link
Contributor

ws4charlie commented Sep 12, 2025

I've just noticed that zetaclient began printing file paths, names and line #s in the log message like following. Is this related to the recent logger adjustment?
image

@renan061
Copy link
Member Author

I've just noticed that zetaclient began printing file paths, names and line #s in the log message like following. Is this related to the recent logger adjustment? image

Yes. We added Caller() to the logger, and removed FieldMethod.

@renan061 renan061 force-pushed the feature/logging-docs branch from 899c874 to 35d5923 Compare September 15, 2025 14:03
@renan061 renan061 force-pushed the feature/logging-docs branch from 35d5923 to 615bfcf Compare September 16, 2025 14:06
@renan061 renan061 requested a review from kingpinXD September 17, 2025 00:30
@renan061 renan061 enabled auto-merge September 17, 2025 20:29
@renan061 renan061 added this pull request to the merge queue Sep 18, 2025
Copy link
Contributor

@ws4charlie ws4charlie left a comment

Choose a reason for hiding this comment

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

lgtm

auto-merge was automatically disabled September 18, 2025 15:21

Pull Request is not mergeable

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Sep 18, 2025
@renan061 renan061 enabled auto-merge September 18, 2025 15:29
@renan061 renan061 added this pull request to the merge queue Sep 18, 2025
Merged via the queue into develop with commit 1c4112c Sep 18, 2025
47 of 48 checks passed
@renan061 renan061 deleted the feature/logging-docs branch September 18, 2025 16:07
renan061 added a commit that referenced this pull request Sep 26, 2025
…4174)

* refactor: use coin.CoinType for compliance logging

* refactor: add documentation for zetaclient logging fields
renan061 added a commit that referenced this pull request Sep 26, 2025
…4174)

* refactor: use coin.CoinType for compliance logging

* refactor: add documentation for zetaclient logging fields
renan061 added a commit that referenced this pull request Sep 26, 2025
…4174)

* refactor: use coin.CoinType for compliance logging

* refactor: add documentation for zetaclient logging fields
renan061 added a commit that referenced this pull request Sep 27, 2025
…4174)

* refactor: use coin.CoinType for compliance logging

* refactor: add documentation for zetaclient logging fields
github-merge-queue bot pushed a commit that referenced this pull request Sep 27, 2025
#4270)

refactor(backport): add documentation for ZetaClient logging fields (#4174)

* refactor: use coin.CoinType for compliance logging

* refactor: add documentation for zetaclient logging fields
github-merge-queue bot pushed a commit that referenced this pull request Jan 3, 2026
* fix: ratelimiting race condition vuln (#4072)

* fix: ratelimiting race condition vuln

* fix: ratelimiting race condition vuln

- Fix race condition in RateLimiter.Release() function
- Replace non-atomic check-then-act with atomic decrement and bounds checking
- Add comprehensive test suite to verify the fix
- Update changelog with PR #4072

* fix: correct atomic implementation to prevent underflow

- Replace flawed Add(-1) approach with proper CompareAndSwap
- Fix underflow detection issue where uint32 wrap-around was missed
- Add TestRateLimiterUnderflowProtection to verify the fix
- Ensure Release() never causes negative counters or semaphore over-release

* refactor: simplify rate limiter Release() implementation

- Remove unnecessary infinite loop in CAS operation
- Single CAS attempt is sufficient for race condition protection
- Maintains thread-safety while being more efficient
- All tests still pass with simplified implementation

* fix: correct order of operations in rate limiter Release()

- Fix race condition by decrementing counter before releasing semaphore
- Ensure pending counter accurately reflects semaphore state
- Simplify implementation by using correct operation order
- All tests pass with cleaner, more logical approach

* test: add tests that reproduce the original race condition vulnerability

- Add BuggyRateLimiter that implements the original vulnerable code
- Add TestBuggyRateLimiterRaceCondition to demonstrate the race condition
- Add TestBuggyRateLimiterStressTest to stress test the vulnerability
- Add TestVulnerabilityDemonstration to show before/after comparison
- Add TestBuggyRateLimiterExcessiveReleases to show excessive release issues
- These tests demonstrate the theoretical vulnerability even if timing makes it hard to reproduce consistently

* fix: address race condition and underflow issues in RateLimiter

- Fix race condition in Release() by reordering operations (decrement pending first, then release semaphore)
- Fix Pending() function to handle negative atomic.Int32 values correctly
- Add comprehensive tests to verify fixes
- Remove buggy code from tests as requested by reviewers
- Document original vulnerability in test comments

The original race condition allowed multiple goroutines to release more permits than acquired.
The Pending() function could return incorrect values due to negative atomic.Int32 conversion.

Fixes: #4072

* refactor: rename test and update changelog to reflect actual improvements

- Rename TestVulnerabilityDemonstration to TestRateLimiterRobustness
- Update test description to reflect code quality improvements rather than vulnerability fixes
- Update changelog entry to match actual changes
- Tests still pass, confirming the improvements are working correctly

The reviewer correctly pointed out that if tests pass on develop without fixes,
then we're improving robustness rather than fixing vulnerabilities.

* refactor: remove support for v1 revert address for BTC (#4070)

* remove support for v1 revert address for BTC

* add changelog

---------

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* feat: add support for withdraw using v2 connector contract   (#4064)

* update go mod

* add a new message for migrating funds

* add migrate funds to e2e

* rebase from develop

* add v2 e2e test to check flow

* add zeta gateway deposit to zetaclient

* add github workflow

* update comments

* fix code formating

* fix code formating

* fix code formating

* fix unit tests

* fix unit tests

* revert to old command to start e2e test

* remove message for migration and refactor to using contract directly

* add changelog

* generate files after removing new message

* update generated files

* update generated files

* update go mod

* update deposit

* add unit tests

* add unit tests

* generate files

* generate files

* undo changes based on develop

* update deposit and revert smart contract call

* rename zeta deposit test file

* rename zeta deposit test file

* add abort and revert tests

* add TestZetaDepositAndCallNoMessage

* add TestZetaDepositAndCallNoMessage

* remove payable from TestAbort contract

* rename to LegacyZETADepositAndCallContract

* improve unit test coverage

* fix unit tests

* add some delay in TestZetacore_SubscribeNewBlocks

* update comment for handling zeta token zrc20

* add e2e test

* add e2e test for withdraw

* refactor ProcessZEVMInboundV2

* add core registry to setup

* refactor e2e test helper functions

* add unit test for zeta withdraw

* add unit test for withdraw and call

* resolve comments 1

* add unit test for ProcessRevert

* add unit test for ProcessRevert

* add unit test for ProcessRevert

* improve abort tests

* improve abort tests

* resolve comments

* resolve comments 2

* update upgrade height to 280 to allow the first test to run the entire cycle

* wrap zeta mints in tmp context

* wrap zeta mint in temp context

* rebase

* add changelog

* add changelog

* adjust comments

* Update cmd/zetae2e/config/contracts.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix gas pool zeta calcualation

* add unit test for executeWithMintedZeta

* fix comments 1

* add unit tests

* update test dapp to use zeta token for consuming gas

* add core registry to zeta e2e post upgrade handler

* revert legacy test

* update changes based on comments 1

---------

Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: print error message in detail if unable to decode Bitcoin memo (#4090)

* print error message detail when memo decoding failed

* add changelog entry

* keep invalid memo log on Info level

---------

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* test(e2e): update admin e2e tests to use v2 connector  (#4071)

* update go mod

* add a new message for migrating funds

* add migrate funds to e2e

* rebase from develop

* add v2 e2e test to check flow

* add zeta gateway deposit to zetaclient

* add github workflow

* update comments

* fix code formating

* fix code formating

* fix code formating

* fix unit tests

* fix unit tests

* revert to old command to start e2e test

* remove message for migration and refactor to using contract directly

* add changelog

* generate files after removing new message

* update generated files

* update generated files

* update go mod

* update deposit

* add unit tests

* add unit tests

* generate files

* generate files

* undo changes based on develop

* update deposit and revert smart contract call

* rename zeta deposit test file

* rename zeta deposit test file

* add abort and revert tests

* add TestZetaDepositAndCallNoMessage

* add TestZetaDepositAndCallNoMessage

* remove payable from TestAbort contract

* rename to LegacyZETADepositAndCallContract

* improve unit test coverage

* fix unit tests

* add some delay in TestZetacore_SubscribeNewBlocks

* update comment for handling zeta token zrc20

* add e2e test

* add e2e test for withdraw

* refactor ProcessZEVMInboundV2

* add core registry to setup

* refactor e2e test helper functions

* add unit test for zeta withdraw

* add unit test for withdraw and call

* resolve comments 1

* add unit test for ProcessRevert

* add unit test for ProcessRevert

* add unit test for ProcessRevert

* improve abort tests

* improve abort tests

* resolve comments

* resolve comments 2

* update upgrade height to 280 to allow the first test to run the entire cycle

* wrap zeta mints in tmp context

* wrap zeta mint in temp context

* rebase

* add changelog

* add changelog

* adjust comments

* Update cmd/zetae2e/config/contracts.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix gas pool zeta calcualation

* add unit test for executeWithMintedZeta

* fix comments 1

* add unit tests

* update admin

* revert unncessary changes

* disable account balance verification for admin tests

* improve naming for deposit functions

* add changelog

* update comments

* update test legacy test zeta to use EVMAddress

* remove skipping admin in upgrade setup

---------

Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* test: fix eth deposit test to check balance after deposit (#4118)

* check balance after eth deposit test

* fix typo

* fix import

* test: fix flaky Solana depositAndCall tests (#4113)

* fix flaky solana depositAndCall tests

* add changelog entry

* add wait logic inside AssertTestDAppEVMCalled

* chore: bump cosmos evm to support querying legacy proposals of type MsgUpdateParams (#4094)

* update zeta evm

* update commit

* fix: use evm chain id from eth config in rpc backend (#4096)

* fix: cancel solana WaC if tx size is too large (#4098)

* cancel solana WaC if tx size is too large

* align the comments with the code

* fix: nil reference in trace block (#4093)

* update to commit be548f7691876e656ec61aa46e31ed337be92f4e , on branch release/v34

---------

Co-authored-by: skosito <skostic9242@gmail.com>
Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com>
Co-authored-by: morde08 <peter@zetachain.com>

* fix: error when deploying contracts on testnet (#4112)

* dont return err if tx is not found in get tx receipt

* fix tests

* changelog

* feat: support hostname in addition to public IP for zetaclient to connect to zetacore (#4068)

* save initial work to remote

* add unit test and live test for zetacore hostname support

* add changelog entry; fix gosec and clean unused code

* fix CI upgrade test

---------

Co-authored-by: Tanmay <tanmay@zetachain.com>

* fix: dbg trace block by number gas limit legacy (#4121)

* fix dbg trace by block

* PR comments

* changelog

* fix(cherry-pick): cancel solana WaC if tx size is too large (#4111)

* cancel solana WaC if tx size is too large

* add changelog entry

* chore: remove tx suffix in vote inbound and outbound message names (#4110)

* fix(`crosschain`): remove confirmation mode from outbound and inbound digest (#4116)

* inbound

* .

* changelog

* refactor(zetacore): overwrite consensus config values for all timeout deltas on startup. (#4097)

* update 1

* add start-skip-consensus-overwrite-test

* generate files

* update tests

* add unit tests

* add unit tests for GenesisChainID

* add unit tests for GenesisChainID

* rename genesisChainID

* fix typo

* remove testnet from overwrite check

* refactor: replace []byte(fmt.Sprintf) with fmt.Appendf (#4131)

Signed-off-by: yinwenyu6 <yinwenyu6@outlook.com>

* feat: Sui message context ID as dynamic field (#4087)

* re-enable sui authenticated call

* integrate message context ID as dynamic field

* add changelog entry

* make issueMessageContext function self-contained

* fix unit test

* remove --skip-dependency-verification in sui gateway upgrade test

* cancel withdrawAndCall on invalid payload

* adopt new increase_nonce signature to adopt gas refund logic when cancelling a CCTX

* apply stringent check on Sui transaction's checkpoint

* apply status check on Sui inbound

* fix CI upgrade test

* fix unit test

* chore: fix some function names in comment (#4129)

Signed-off-by: pxwanglu <pxwanglu@icloud.com>

* chore: fix some observer message names (#4141)

* test: fix flaky Solana SPL deposit balance check (#4142)

* fix solana e2e SPL balance check by waiting maximum 30 seconds

* add changelog entry

* refactor: remove intx and outtx deprecated queries (#4150)

* refactor: remove intx and outtx deprecated queries

* fixes in e2e

* chore: remove redundant word in comment (#4149)

Signed-off-by: wmypku <wmypku@outlook.com>

* test(`e2e`): improve logs for CCTX status assertion (#4147)

* improve require status logs

* update usage in tests

* lint

* cursor comment

* chore: fix some typos in comment (#4146)

Signed-off-by: tzchenxixi <tzchenxixi@icloud.com>

* chore: set v35 as upgrade test reference and various clean up (#4115)

* add back precompiles

* add abci field to proposal

* test

* enable back

* test no creating proposasl

* disable zeta-ante

* cleanup v33 upgrade helper

* add v35 as reference

* remove gas stability pool temporary

* update to v36 and disable fast confirmation test

* bitcoin fast confirmation

* increase ersion for zeta

* remove erc20 init handler

* disable zevm to evm revert for older version

* disable zevm to evm revert abort for older version

* increase upgrade height

* feat: make the gas limit used for gateway calls on ZEVM a configurable parameter (#4153)

* add GatewayGasLimit to state

* refactor function name from MustGetGatewayGasLimit to GetGatewayGasLimitSafe

* update unit tests

* update unit tests

* update proto files

* replace big int with uint64

* changelog

* add check of older value

* add v4 migration back for authority module

* update setup handler to remove setting erc20 module

* test changes

* revert to using v32 as base branch for upgrades

---------

Co-authored-by: lumtis <lucas.bertrand.22@gmail.com>

* test(`e2e`): add a gas limit option for ZEVM to EVM call tests (#4145)

* add gas limit option

* use option for tests

* increase further upgrade height

* test: use pre-deployed example dapp V2 contract in e2e tests (#4158)

* do not deploy example contract in e2e tests, use pre-deployed example dapp V2 instead

* add changelog entry

* clean up debugging log

* remove commented code

* add back extra zrc20 SPL balance check

* chore(`e2e`): cleanup unused contracts (#4161)

* remove contextapp

* remove distribute

* test: fix flaky depositAndCall test that failed on sender assertion (#4165)

* fix flaky depositAndCall caused by sender assertion

* add changelog entry

* chore(deps): bump github.com/hashicorp/go-getter from 1.7.8 to 1.7.9 (#4148)

Bumps [github.com/hashicorp/go-getter](https://github.com/hashicorp/go-getter) from 1.7.8 to 1.7.9.
- [Release notes](https://github.com/hashicorp/go-getter/releases)
- [Changelog](https://github.com/hashicorp/go-getter/blob/main/.goreleaser.yml)
- [Commits](hashicorp/go-getter@v1.7.8...v1.7.9)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-getter
  dependency-version: 1.7.9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github.com/ulikunitz/xz from 0.5.11 to 0.5.14 (#4172)

Bumps [github.com/ulikunitz/xz](https://github.com/ulikunitz/xz) from 0.5.11 to 0.5.14.
- [Commits](ulikunitz/xz@v0.5.11...v0.5.14)

---
updated-dependencies:
- dependency-name: github.com/ulikunitz/xz
  dependency-version: 0.5.14
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.4.0 (#4173)

chore(deps): bump github.com/go-viper/mapstructure/v2

Bumps [github.com/go-viper/mapstructure/v2](https://github.com/go-viper/mapstructure) from 2.2.1 to 2.4.0.
- [Release notes](https://github.com/go-viper/mapstructure/releases)
- [Changelog](https://github.com/go-viper/mapstructure/blob/main/CHANGELOG.md)
- [Commits](go-viper/mapstructure@v2.2.1...v2.4.0)

---
updated-dependencies:
- dependency-name: github.com/go-viper/mapstructure/v2
  dependency-version: 2.4.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* refactor: standardize zetaclient logging (#4144)

* chore: remove unused DynamicTicker from zetaclient/types

* refactor: remove Msgf and refactor zerolog uses

* Replace Msgf for Msg
* Use '_' instead of '.'
* Start logs with lowercase instead of uppercase characters
* Use the constants in the logs module
* Use With().Logger() instead of log fields when possible

* fix: improve zetatool (#4175)

* scan gateway events by default for all inbound hashes

* scan gateway events by default for all inbound hashes

* test(`e2e`): add a E2E test to test depositAndCall with high gas consumption (#4177)

* set gas limit to 4m in localnet

* add high usage test

* changelog

* Update changelog.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update e2e/e2etests/e2etests.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* test(`e2e`): add all chains by default in `start-localnet` (#4163)

* chore: add Solana to start-localnet to allow to run local tests

* add sui and ton

* Update cmd/zetae2e/local/local.go

Co-authored-by: Tanmay <tanmay@zetachain.com>

---------

Co-authored-by: Tanmay <tanmay@zetachain.com>

* chore: remove redundant words (#4179)

Signed-off-by: keeghcet <keeghcet@outlook.com>

* refactor: omit unnecessary reassignment (#4184)

Signed-off-by: fengyuchuanshen <fengyuchuanshen@outlook.com>

* fix: force rescan if inbound vote monitoring fails  (#4183)

* add monitoringErr channel

* update to InboundBlockHeight - 1 , for reseting the block

* fix unit tests

* implement error interface

* rename to ErrTxMonitor

* add forceResetLastScanned flag

* add forceResetLastScanned flag

* add mutex to force scan

* add changelog

* add changelog

* update name to wasForceReset

* wrap UpdateForceResetLastScanned in mutex

* add a bound check to InboundBlockHeight to be safe

* Update zetaclient/chains/base/confirmation.go

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* Update zetaclient/chains/base/observer.go

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* force update for in memory value if forceResetLastScanned is true

* add a lock on reading block height

* update error message

* update changelog

* wait till end of scan cycle to toggle the forceUpdateFlag

---------

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* fix: remove duplicate solana post-gas-price goroutine (#4194)

* feat: observe inbound from previous gateway package after upgrade (#4138)

* observe inbound from old gateway package optionally

* add changelog entry

* add sui inbound cursor migration; add post-upgrade deposit tests

* improve comments, logs and naming; fix post-upgrade withdraw failure

* protect anyStringMap

* add support for <withdrawcap-id> to Sui gateway address

* fix CI upgrade test failure

* use name previousPackageID and keep name PairID; rename AnyString and cursor migration function; improve test, comments, etc.

* replaced assert by require in sui unit test

* add support for original packageID in Sui gateway address

* avoid wrapping nil error

* use previous package ID in post-upgrade Sui deposit test

* add support for previous package deprecation and fix upgrade test

* fix unit test

* add a note to clarify the PackageID argument used for event query

* add documents to explain Sui gateway address format in the chain params

* refactor: remove unused loggers and log fields (#4180)

* chore: remove unused Headers logger

* refactor: remove (mostly) unused GasPrice logger

* refactor: replace logs.FieldMethod with With().Caller() and standardize logs.FieldModule values

* refactor: remove (mostly) unused log fields FieldTracker and FieldConfirmationMode

* refactor: replace missed log instances of '.' for '_'

* fix: unpack bitcoin revert message without considering 'CallOnRevert' flag (#4169)

* enable bitcoin revertMessage and ignore CallOnRevert flag

* add changelog entry

* update standard memo doc; improve abort address validation

* skip incompatible e2e test to allow CI upgrade test to pass

* fix: add timeout to monitoring routine (#4196)

* add a timeout for vote monitoring thread

* add a timeout for vote monitoring thread

* add comments

* remove typo for cancel call

* fix unit tests

* Update zetaclient/zetacore/client_vote.go

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* Update zetaclient/chains/base/observer.go

Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com>

---------

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>
Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com>

* refactor: use maps.Copy for cleaner map handling (#4198)

Signed-off-by: joemicky <joemickychang@outlook.com>

* chore: fix some comments (#4208)

Signed-off-by: zhoujiaweii <zjwustc@outlook.com>

* fix: update evm version for missing tx types (#4216)

* refactor: replace HasPrefix+TrimPrefix with CutPrefix (#4215)

Signed-off-by: quantpoet <quantway@outlook.com>

* refactor: remove `LastBlockHeight` state variable (#4200)

* proto

* remove other references

* changelog

* refactor: add documentation for ZetaClient logging fields (#4174)

* refactor: use coin.CoinType for compliance logging

* refactor: add documentation for zetaclient logging fields

* fix: remove ZetaChain chain ID from GasStabilityPoolBalances query (#4217)

* fix query

* add test

* changelog

* add commment

* lint

* remove gas token address

* change error type

* refactor: remove index field in ballot (#4205)

* refactor: remove index field in ballot

* changelog

* fix unit tests

* refactor: remove `MsgUpdateERC20CustodyPauseStatus` and `MsgMigrateERC20CustodyFunds` (#4199)

* make message legacy

* remove other reference

* changelog

* refactor: rename whitelistERC20 into whitelistAsset (#4203)

* refactor: rename whitelistERC20 into whitelistAsset

* e2e test

* e2e test

* fix event

* simulation

* changelogs

* update auth list

* add migration script

* apply comment

* feat: provide error information in CCTX struct when Bitcoin deposit fail (#4211)

* add error message to CCTX struct when Bitcoin deposit failed

* add changelog entry

* fix unit test; improve function naming

* add unit test for inbound vote digest

* exclude inbound observation error message from digest

* fix: re-check for finalized ballot when executing inbound vote to create cctx (#4197)

* check for finalized block after ballot is finalized

* fix unit tests and add changelog

* adjust comments

* Apply suggestion from @lumtis

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* Apply suggestion from @lumtis

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* refactor check finalized ballot check to be done before adding the finalizing vote to the ballot

* adjust comments

* adjust comments

* fix comments 2

---------

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* fix: set zeta ante to true in upgrade tests  (#4225)

* add zeta ante

* add to upgrade test regular

* add to upgrade test regular

* update out of gas test

* update out of gas test

* fix tss migration test

* fix lint issues 1

* update v2 zeta version

* chore: resync changelogs with v36 changes (#4223)

* fix: skip writing config file to the filesystem  (#4210)

* comment out writing files to the state

* ad changelog

* remove commented code

* return error from fetching FlagSkipConfigOverwrite

* refactor(`observer`): remove deprecated code (#4192)

* update proto

* update code

* changelogs

* fix changelog

* fix gas limit issue in upgrade test

* use ante-zetae2e for admin upgrade tests

* test fix

* refactor: prepare the client interfaces used by the observer-signers for dry-mode (#4213)

refactor: prepare the client interfaces of the observer-signers for dry-mode

* feat: enable NoAssetCall from Bitcoin (#4218)

* enable NoAssetCall from Bitcoin

* add changelog entry

* improve comment and log print

* revert bitcoin NoAssetCall that carries large excessive funds

* adjust btc inbound parsing order; fix test name

* improve function and variable names

* feat: multiple evm calls in single tx (#4157)

* bump protocol contracts

* use newer geth version with cancun support

* e2e test with 2 deposits in same tx

* e2e tests

* inbound trackers for multiple events

* changelog

* generate

* fix e2e tests

* inbound trackers e2e test

* bump protocol contracts

* PR comments

* PR comment

* PR comments

* PR comment

* lower upgrade height in upgrade tests

* try diff upgrade height

* upgrade additional fee in upgrade v36 handler

* chore: fix function name in comment (#4238)

Signed-off-by: russcoss <russcoss@outlook.com>

* revert: add timeout to monitoring routine" (#4244)

Revert "fix: add timeout to monitoring routine (#4196)"

This reverts commit 65f227b.

* fix(e2e): check test contracts deployment (#4251)

* fix(e2e): check test contracts deployment

* add other contracts

* changelog

* fix chain to wait tx from

* revert: force rescan if inbound vote monitoring fails (#4250)

* feat: refund a portion of remaining unused tokens to user (#3734)

* add new field to cctx structure to track user gas burned

* add unit tests

* add doc

* add unit test for migration

* add check for pre upgrade cctxs

* add older logic for handling cctxs created before upgrade

* remove LegacyChainParams

* add unit test for refund gas fee

* remove old migration

* add temp note for PR review

* fix typo

* fix typo

* generate files

* add missing test case

* add missing test case

* refactor based on comments

* update EtherWithdrawRestricted test

* update EtherWithdrawRestricted test

* update EtherWithdrawRestricted test

* enable all tests

* update module version for observer migration

* generated docs

* generated docs

* remove deprecated comments

* use older chainparams for upgrade tests

* use older chainparams for upgrade tests

* changes based on comments 1

* add addition param to CallZRC20Deposit

* update comments for legacy cctx and refactor unit tests to use the parent function ManageUnusedGasFee

* adjust non zevm chain test cases

* fix lint errors

* fix comments and rebase develop

* add statement to  ErrParamsStabilityPoolPercentage

* Update x/crosschain/keeper/msg_server_vote_outbound.go

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* fix comments 3

* rebase develop 2

* rebase develop 2

* update admin test

---------

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* test: add zetaclient only upgrade tests (#4310)

* add file based trigger for zetaclient binary download

* update zetae2e

* add new makefile commands

* update comments

* remove wait for upgrade height

* upgrade contracts on zetaclient test

* fixes 1

* add issue to track sui upgrade tests

* add issue to track sui upgrade tests

* add nosec

* fix(`zetatool`): add missing networks (#4424)

* add missing networks

* add worldchain config

* add world chain to unit tests

* update tests

* add zetaclient changes from main

* disable e2e tests not working in the first test run

* set light upgrade tests as default for zetaclient label

* update rpc import

* update contract copy

* fix update for removing nonces only if the tx is finalized

* fix update for removing nonces only if the tx is finalized

* update changelog

* rebase develop

* rebase develop

* generate files

* reduced upgrade height for connector-migration-test

* update comment for tss migration test

---------

Signed-off-by: yinwenyu6 <yinwenyu6@outlook.com>
Signed-off-by: pxwanglu <pxwanglu@icloud.com>
Signed-off-by: wmypku <wmypku@outlook.com>
Signed-off-by: tzchenxixi <tzchenxixi@icloud.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: keeghcet <keeghcet@outlook.com>
Signed-off-by: fengyuchuanshen <fengyuchuanshen@outlook.com>
Signed-off-by: joemicky <joemickychang@outlook.com>
Signed-off-by: zhoujiaweii <zjwustc@outlook.com>
Signed-off-by: quantpoet <quantway@outlook.com>
Signed-off-by: russcoss <russcoss@outlook.com>
Co-authored-by: 0xM3R <omer@zetachain.com>
Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>
Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: morde08 <peter@zetachain.com>
Co-authored-by: skosito <skostic9242@gmail.com>
Co-authored-by: yinwenyu6 <yinwenyu6@outlook.com>
Co-authored-by: pxwanglu <pxwanglu@icloud.com>
Co-authored-by: wmypku <wmypku@outlook.com>
Co-authored-by: tzchenxixi <tzchenxixi@icloud.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Renan <renan.061@gmail.com>
Co-authored-by: keeghcet <keeghcet@outlook.com>
Co-authored-by: fengyuchuanshen <fengyuchuanshen@outlook.com>
Co-authored-by: Renan <renan@zetachain.com>
Co-authored-by: joemicky <joemickychang@outlook.com>
Co-authored-by: zhoujiaweii <zjwustc@outlook.com>
Co-authored-by: quantpoet <quantway@outlook.com>
Co-authored-by: russcoss <russcoss@outlook.com>
github-merge-queue bot pushed a commit that referenced this pull request Jan 6, 2026
* fix: use evm chain id from eth config in rpc backend (#4096)

* fix: cancel solana WaC if tx size is too large (#4098)

* cancel solana WaC if tx size is too large

* align the comments with the code

* fix: nil reference in trace block (#4093)

* chore : bump cosmos evm to support querying legacy proposals of type MsgUpdateParams  (#4095)

* update zeta evm

* update commit

* update to commit be548f7691876e656ec61aa46e31ed337be92f4e , on branch release/v34

---------

Co-authored-by: morde08 <peter@zetachain.com>

* fix: remove store initilization for erc20 module (#4103)

* fix(v34-only): use SAFE confirmation mode for all inbound votes (#4117)

* use SAFE confirmation mode for all inbound votes

* move confirmation mode update logic right before signing the inbound vote message

* fix: port Bitcoin memo decoding error log print to v34 (#4100)

port PR 4090 to v34

* fix: backport dbg trace block by number gas limit legacy (#4119)

* fix: backport error when deploying contracts on testnet (#4120)

* refactor(backport): overwrite consensus config values for all timeout deltas on startup (#4126)

* feat: add conditional logic for adding erc20 module based on chain id (#4125)

* add conditional logic for erc20 module upgrade

* bump cosmos version to run evm migration 6 to 7

* add unit tests

* update handler to panic

* add changelog

* format files

* update changelog

* bump cosmos/evm to release/v35

* add back comments for IBC

* add back comments for IBC

* feat(backport/v36): make the gas limit used for gateway calls on ZEVM a configurable parameter (#4154)

* cherry pick

* cherry pick

* update unit tests

* update unit tests

* cherry pick

* replace big int with uint64

* add check of older value

* update upgrade test and changelog

* fix function call

* add v4 migration back for authority module

* add v4 migration back for authority module

---------

Co-authored-by: Tanmay <tanmay.bhattacharya.smit@gmail.com>

* fix: skip writing config file to the filesystem (#4206)

* skip writing config file

* use the value of skip-config-overwrite flag without restrictions for mainnet

* add comments

* remove unused functions

* remove unit tests for unused functions

* fix(backport/v36): unpack bitcoin revert message without considering 'CallOnRevert' flag (#4181)

* unpack revert message from Bitcoin memo without considering  flag

* skip incompatible e2e test to allow CI upgrade test to pass

* fix(backport):  force rescan if inbound vote monitoring fails using a context that can timeout (#4202)

* backport changes for rescan logic

* remove changelog

* format files

* use context with timeout

* change error message

* cherry pick changes for context with timeout

* format package and fix lint

---------

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* chore(backport/v36): cherry pick e2e tests changes for live networks (#4220)

* fix: add a simple check for finalizing vote  (#4236)

* revert: add a simple check for finalizing vote (#4240)

Revert "fix: add a simple check for finalizing vote  (#4236)"

This reverts commit d8dc5bac363cbfeb8267705a378fc5a7803e24df.

* revert: force rescan if inbound vote monitoring fails using a context that can timeout (#4241)

Revert "fix(backport):  force rescan if inbound vote monitoring fails using a…"

This reverts commit 70ab2a724f96bcf48d2ece29674a8bfbf9bb4469.

* fix(e2e): check test contracts deployment (#4252)

* fix(e2e): check test contracts deployment

* add other contracts

* fix chain to wait tx from

* fix check

* docs: add release lifecycle in the documentation (#4265)

* add a note for releases

* add release lifecycle docs

* refactor: omit unnecessary reassignment (#4264)

Signed-off-by: letreturn <letreturn@outlook.com>
Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com>

* refactor(backport): standardize zetaclient logging (#4144) (#4267)

* chore: remove unused DynamicTicker from zetaclient/types

* refactor: remove Msgf and refactor zerolog uses

* Replace Msgf for Msg
* Use '_' instead of '.'
* Start logs with lowercase instead of uppercase characters
* Use the constants in the logs module
* Use With().Logger() instead of log fields when possible

* fix(backport): remove duplicate solana post-gas-price goroutine (#4194) (#4268)

* refactor(backport): remove unused loggers and log fields (#4180) (#4269)

* chore: remove unused Headers logger

* refactor: remove (mostly) unused GasPrice logger

* refactor: replace logs.FieldMethod with With().Caller() and standardize logs.FieldModule values

* refactor: remove (mostly) unused log fields FieldTracker and FieldConfirmationMode

* refactor: replace missed log instances of '.' for '_'

* refactor(backport): add documentation for ZetaClient logging fields (… (#4270)

refactor(backport): add documentation for ZetaClient logging fields (#4174)

* refactor: use coin.CoinType for compliance logging

* refactor: add documentation for zetaclient logging fields

* chore: fix some function names (#4273)

Signed-off-by: yajianggroup <yajianggroup@outlook.com>

* refactor(backport): prepare the client interfaces used by the observe… (#4271)

refactor(backport): prepare the client interfaces used by the observer-signers for dry-mode (#4213)

refactor: prepare the client interfaces of the observer-signers for dry-mode

* refactor: replace the deprecated function in the ioutil package (#4275)

Signed-off-by: mickychang9 <mickychang9@outlook.com>

* feat: multiple evm calls (#4274)

* multiple evm calls in single tx

* gen testdappv2

* cleanup after merge

* ensure gateway proxy is deployed in e2e tests

* fix upgrade tests

* changelog

* PR comments

* feat: add dry-mode support for TON (#4277)

* feat: add dry-mode support for TON

* fix: address review comments

* ci: increase timeout for solana e2e tests (#4276)

* Increase timeout for solana e2e tests

* Remove timeout, but run the test one hour earlier.

* extend timeout for solana

* feat: add feature flag for multiple evm calls (#4288)

* add feature flag for multiple evm calls

* add feature flag to inbound tracker processing

* fix e2e test inbound trackers

* PR review and refactoring

* add todo with issue

* changelog

* use zetae2e ante for upgrade tests

* chore: increase upgrade test height (#4303)

* chore: increase upgrade test height

* test even higher block

* try 300 block height

* refactor: add `zrepo` package to zetaclient with dry-mode (#4296)

refactor: add zrepo package to zetaclient with dry-mode

* ci: remove upgrade tests from merge queue ci (#4309)

* test(`e2e`): improve local stress tests to replicate better live networks (#4293)

* update params

* fix gas limit

* set gas limit to 4m in localnet

* add high usage test

* typo

* set mem pool

* add stress zevm test

* some tests

* send zevm stress tx as batch

* add batch support

* revert back local config

* chore: add Solana to start-localnet to allow to run local tests

* add sui and ton

* improve eth withdraw stress

* use batch model for deposit stress tests

* improve retry logic

* remove unnecessary logs

* fix lint

* fix deposit

* changelogs

* add nosec

* Update changelog.md

Co-authored-by: skosito <skostic9242@gmail.com>

* apply comments

* use deposit and call

* fix last comments

* use 50m for block size

* revert back 30m block

---------

Co-authored-by: skosito <skostic9242@gmail.com>

* chore: fix inconsistent function name in comment (#4297)

Signed-off-by: russcoss <russcoss@outlook.com>

* fix: stop ProcessOutboundTrackers from breaking when it finds an error (#4305)

* feat: localnet monitoring and observability improvements (#4314)

* make PR against develop branch

* add monitoring profile to makefile

* update dashboards

* update grafana image

* fix dashboards

* update namespace to cometbft

* fix dashboard typo

* update dashboard defaults

* fix: adjust inbound retry gas limit; stop broadcasting tx if mempool is congested or base fee too high (#4291)

* adjust inbound retry gas limit; stop broadcasting tx if mempool is congested

* add changelog entry

* use write lock for delete

* add unconfirmed txs count to config and AppContext; skip observation if mempool is congested

* rename functions

* improve naming and documentation; add log print when skipping observation

* add detailed description for inbound retry gas limit adjustment

* do not consider zetacore mempool congestion by default

* consolidate observation skipper functions; print sampled Info logger when observation is skipped

* unit test observation skipper

* rename Bitcoin mempool monitoring goroutine and improve observation skipper description

* configure maximum base fee

* fix gas price observation skipper

* convert Gwei to wei for the max base fee check

* add changelog description for MaxBaseFee

* fix unit test compile

* fix unit test

* feat: add support for Solana Address Lookup Table in withdraw and call (#4266)

* add support for ALT

* split legacy withdraw and call alt to separate test

* fix compile after merge

* add spl e2e test

* ci fixes

* add outbound tests for alt msgs

* PR comments coderabbit

* PR comments

* add feature flag for solana alt

* lint

* fix e2e test

* fix e2e test

* PR comments

* Trigger rebuild

* feat: monitor failed inbound vote and add to an inbound tracker cache (#4295)

* partially cherry-pick PR 4183 and 4196 to monitor failed inbound vote

* implement the backlog for failed inbound vote

* add changelog entry

* fix changelog grammar

* use the internal tracker terminology; use separate goroutine to process internal trackers

* fix internal tracker unit test and update changelog description

* put a limit on number of inbound trackers to process per ticker

* remove unused constant

* fix generte

* remove internal tracker if it was already voted by the observer

* fix unit test

---------

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* feat: add dry-mode to Sui and add client wrappers to Sui and TON (#4313)

* feat: add dry-mode to Sui

* refactor: add client wrappers to Sui and TON

* refactor: improve logging messages and code comments

* feat: add dry-mode to Solana (#4317)

* chore: adding ABI used by precompiles.  (#4311)

* Adding ABI for precompiles

* added readmes

* refactor: use maps.Clone to simplify code (#4319)

Signed-off-by: yajianggroup <yajianggroup@outlook.com>

* chore: fix some comments (#4331)

Signed-off-by: letreturn <letreturn@outlook.com>

* test(e2e): update local chain params for more performant outbound processing (#4318)

* remove useless comment

* improve parameters

* update for local bitcoin

* increase max block size

* revert chain param changes

* update chain params in e2e setup

* feat: add dry-mode to Bitcoin (#4325)

* feat: add dry-mode to EVM (#4326)

* feat: add TSS client dry-wrapper (#4330)

* chore: upgrade cometbft patch version (#4337)

* chore: upgrade cometbft patch version

* chore: run go mod tidy

* refactor: set verbose logs for event parsing error as debug (#4345)

* change invalid event to debug

* skip ton log if zero logs

* generate

* chore(deps): bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.4.0 (#4334)

chore(deps): bump github.com/go-viper/mapstructure/v2

Bumps [github.com/go-viper/mapstructure/v2](https://github.com/go-viper/mapstructure) from 2.2.1 to 2.4.0.
- [Release notes](https://github.com/go-viper/mapstructure/releases)
- [Changelog](https://github.com/go-viper/mapstructure/blob/main/CHANGELOG.md)
- [Commits](https://github.com/go-viper/mapstructure/compare/v2.2.1...v2.4.0)

---
updated-dependencies:
- dependency-name: github.com/go-viper/mapstructure/v2
  dependency-version: 2.4.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github.com/ulikunitz/xz from 0.5.11 to 0.5.14 (#4333)

Bumps [github.com/ulikunitz/xz](https://github.com/ulikunitz/xz) from 0.5.11 to 0.5.14.
- [Commits](https://github.com/ulikunitz/xz/compare/v0.5.11...v0.5.14)

---
updated-dependencies:
- dependency-name: github.com/ulikunitz/xz
  dependency-version: 0.5.14
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github.com/hashicorp/go-getter from 1.7.8 to 1.7.9 (#4332)

Bumps [github.com/hashicorp/go-getter](https://github.com/hashicorp/go-getter) from 1.7.8 to 1.7.9.
- [Release notes](https://github.com/hashicorp/go-getter/releases)
- [Changelog](https://github.com/hashicorp/go-getter/blob/main/.goreleaser.yml)
- [Commits](https://github.com/hashicorp/go-getter/compare/v1.7.8...v1.7.9)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-getter
  dependency-version: 1.7.9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* test: skip spawning Solana and Sui for ETH stress tests (#4346)

* update docker compose

* update init condition

* fix: update zetachain-exporter to v4.11.0 for localnet support (#4341)

* update zetachain-exporter to v4.11.0 for localnet support

* Update Makefile

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore: add precompile metadata for blockscout explorer (#4350)

* Adding ABI for precompiles

* added readmes

* updated metadata for bs

* fixed precompile version in metadata

* fixed abi format

* fixed compiler version

* test: fix eth stress test timeout (#4321)

* fix eth stress test timeout

* decrease default mempool threshold

* add minimum retry interval logic to internal tracker

* set PostVoteInboundGasLimit back to 500K; set block max gas to 50M

* avoid adding finalized or voted ballot to internal tracker cache

* rename DefaultMempoolSize as DefaultAppMempoolSize

* add changelog entry

* update time stamp only for first MaxInboundTrackersPerScan internal trackers

* print RPC error logs from ballotIsFinalizedOrVoted instead of ignore

* chore: upgrade cometbft patch version (#4337)

* chore: upgrade cometbft patch version

* chore: run go mod tidy

* refactor: set verbose logs for event parsing error as debug (#4345)

* change invalid event to debug

* skip ton log if zero logs

* generate

* chore(deps): bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.4.0 (#4334)

chore(deps): bump github.com/go-viper/mapstructure/v2

Bumps [github.com/go-viper/mapstructure/v2](https://github.com/go-viper/mapstructure) from 2.2.1 to 2.4.0.
- [Release notes](https://github.com/go-viper/mapstructure/releases)
- [Changelog](https://github.com/go-viper/mapstructure/blob/main/CHANGELOG.md)
- [Commits](https://github.com/go-viper/mapstructure/compare/v2.2.1...v2.4.0)

---
updated-dependencies:
- dependency-name: github.com/go-viper/mapstructure/v2
  dependency-version: 2.4.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github.com/ulikunitz/xz from 0.5.11 to 0.5.14 (#4333)

Bumps [github.com/ulikunitz/xz](https://github.com/ulikunitz/xz) from 0.5.11 to 0.5.14.
- [Commits](https://github.com/ulikunitz/xz/compare/v0.5.11...v0.5.14)

---
updated-dependencies:
- dependency-name: github.com/ulikunitz/xz
  dependency-version: 0.5.14
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github.com/hashicorp/go-getter from 1.7.8 to 1.7.9 (#4332)

Bumps [github.com/hashicorp/go-getter](https://github.com/hashicorp/go-getter) from 1.7.8 to 1.7.9.
- [Release notes](https://github.com/hashicorp/go-getter/releases)
- [Changelog](https://github.com/hashicorp/go-getter/blob/main/.goreleaser.yml)
- [Commits](https://github.com/hashicorp/go-getter/compare/v1.7.8...v1.7.9)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-getter
  dependency-version: 1.7.9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* test: skip spawning Solana and Sui for ETH stress tests (#4346)

* update docker compose

* update init condition

* fix: update zetachain-exporter to v4.11.0 for localnet support (#4341)

* update zetachain-exporter to v4.11.0 for localnet support

* Update Makefile

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore: add precompile metadata for blockscout explorer (#4350)

* Adding ABI for precompiles

* added readmes

* updated metadata for bs

* fixed precompile version in metadata

* fixed abi format

* fixed compiler version

* renan comments

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: morde08 <peter@zetachain.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Charlie <31941002+CharlieMc0@users.noreply.github.com>

* feat: add dry-wrappers to zetacore client (#4323)

* feat: add dry-wrappers to zetacore client

* fix: address reviews

* fix: iterate all sui outbound tracker hashes (#4340)

* iterate all sui outbound tracker hashes

* add changelog entry

* remove log message by using Send

* feat: missing fields in msg hash for solana outbounds (#4328)

* missing fields in msg hash for solana outbounds

* changelog

* lint

* update gateway so file

* feat: add dry-mode configuration (#4348)

* feat: add mode option in ZetaClient configuration

* fix: address reviews

* test: fix too many internal trackers in 'start-stress-test-eth' (#4351)

* fix many internal trackers in eth stress test

* add changelog entry

* add description for newly added constant for readibility; improve changelog

* test: add tests related to dry-mode (#4347)

* feat: add metrics for monitoring inbound voting through blockscan and trackers (internal / external) (#4342)

* update metric definations

* add metrics update

* update comments for evm

* add unit test for metrics

* add changelog

* update comments

* format files

* update naming

* add a grafana dashboard for localnet

* update dashboard

* add section for internal trackers

* update docker compose

* update prometheus to scrape data from all zetaclient nodes

* update susccess rate

* use absent in success rate

* make success rate simpler

* remove monitoring for e2e test

---------

Co-authored-by: Renan <renan@zetachain.com>
Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* ci: create a separate release workflow for zetaclient and zetacore (#4329)

* publish release actions

* gorelease new files

* fix security warning

* fix coderabbit comments

* reorganize workflow

* Update .github/workflows/release-template.yml

Co-authored-by: semgrep-code-zeta-chain[bot] <181804379+semgrep-code-zeta-chain[bot]@users.noreply.github.com>

* Update .github/workflows/release-template.yml

Co-authored-by: semgrep-code-zeta-chain[bot] <181804379+semgrep-code-zeta-chain[bot]@users.noreply.github.com>

---------

Co-authored-by: semgrep-code-zeta-chain[bot] <181804379+semgrep-code-zeta-chain[bot]@users.noreply.github.com>

* chore: fix function name in comment (#4364)

Signed-off-by: vastonus <vastonus@outlook.com>

* feat: add support for zetaclient external DNS name (#4254)

* add support for zetaclient external DNS name

* add changelog entry

* point to go-tss tag; fix changelog PR # and add zetaclient config description

* add zetaclient config file validation method

* chore: Update Twitter link to new handle (#4366)

* refactor: set propose/prevote/precommit delta timeouts to 200ms (#4360)

* Initial plan

* consensus: set timeout_*_delta to 200ms in test/localnet configs

Co-authored-by: CharlieMc0 <31941002+CharlieMc0@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: CharlieMc0 <31941002+CharlieMc0@users.noreply.github.com>
Co-authored-by: morde08 <peter@zetachain.com>

* feat: Sui message context ID as dynamic field (#4127)

* backport PR 4087 to v35

* fix CI upgrade test

* fix unit test

* avoid wrapping nil error

* update the TODO comment for broken Sui e2e test in the upgrade

* feat: observe inbound from previous gateway package after upgrade (#4182)

* backport PR 4087 to v35

* fix CI upgrade test

* fix unit test

* avoid wrapping nil error

* backport PR 4138

* fix compile error

* add support for previous package deprecation; fix upgrade test and unit test

* add a note to clarify the PackageID argument used for event query

* add documents to explain Sui gateway address format in the chain params

* update the TODO comment for broken Sui e2e test in the upgrade

* chore: remove repetitive words in comment (#4353)

Signed-off-by: withtimezone <with_timezone@outlook.com>
Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com>

* chore: combine metadata file for precompile ABI (#4369)

* adding combined file for BS

* adding combined file for BS

* docs: add documentation for ZetaClient execution modes (#4358)

* docs: add documentation for ZetaClient execution modes

* fix: address reviews

* docs: add version table and update release process (#4365)

* revamp version file

* update links

* add a few links

* update release lifecycle do

* Apply suggestion from @coderabbitai[bot]

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* apply comments

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* refactor: replace mock generation with (broadned) Go file generation (#4367)

* fix(monitoring): update zetachain-exporter to fix bug with localnet mode (#4370)

add signer sync localnet dashboard, fix bug with localnet mode for zetachain-exporter

* fix: upgrade test on develop (#4375)

* remove default gas limit from genesis

* fix keygen in upgrade test

* fix lint

---------

Co-authored-by: Charlie Chen <charliec@zetachain.com>

* test(e2e): json rpc checks during e2e and upgrade tests (#4357)

* add e2e test to check most important rpc methods before and after upgrade

* ci fixes

* lint

* PR comments

* PR comments

* test(backport): add zetaclient only upgrade tests (#4376)

* add zetaclient upgrade tests

* update comment

* use temp file

* refactor: upgrade protocol contract to repo `protocol-contracts-evm` and v15 (#4356)

* update go mod

* update all imports

* update go mod

* fix binding and comment some tests

* conflicts fixes

* changelogs

* disable zeta v2 e2e tests

* disable e2e test for zeta v2

* conflict fixes

* upgrade contract version

* update commit -

* update commit with release

* feat: disable TSS service in dry mode (#4384)

* fix: filter out nil address to prevent error logs (#4386)

* filter out nil address to filter nil connections

* add changelog

* feat: add chaos mode (#4359)

* feat: add chaos mode

* fix: address reviews (kingpinXD)

* fix: address reviews (lumtis)

* ci: fix duplicate env in the release workflow (#4385)

fix env error

* feat: shutdown zetaclient if zetacore is in syncing status  (#4362)

* add a listner to check sync status

* add oncomplete

* add changelog

* add unit test

* add comments

* rebase develop

* rebase develop

* update function name to wait until syncing

* update function name to wait until syncing

* add unit test
shutdown cancelled if zetacore stops syncing before timeout

* increase assert timer for test

* Update zetaclient/maintenance/shutdown_listener.go

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

---------

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* feat: add number of connected peers to tss keygen log (#4378)

* add number of peers to keygen log

* update pr id

* update log output

* update log output

* reset to older log lines

* generate files

* refactor: base validation on zetaclient config file (#4361)

* add support for zetaclient external DNS name

* add changelog entry

* point to go-tss tag; fix changelog PR # and add zetaclient config description

* add zetaclient config file validation method

* add basic validation on zetaclient config file

* add changelog entry

* add description to zetaclient config unit test and minor improvement

* standardize config file error message format

* configure cosmos sdk config in zetaclient supervisor and unit test

* fix format

* fix CI simulation test

* feat: Add test binaries build workflow (#4383)

* feat: Add test build release workflow

* test

* fix: make

* feat: add checks and notifs

* fix: refactor

* feat: refactor into multiple jobs

* fix: refactor

* fix: add description comment

* fix: remove bucket name from summary

* test: update e2e to set higher timeouts when running stress test (#4395)

* update to using higher timeouts when running stress tests

* add changelog

* docs: update matrix table with new released versions (#4390)

* update matrix table

* add note for release

* update last updated

* comments

* chore: remove repetitive words (#4388)

* chore: remove repetitive words

Signed-off-by: findmyhappy <findhappy@sohu.com>

* Update .github/workflows/semgrep.yml

Co-authored-by: Renan <renan.061@gmail.com>

---------

Signed-off-by: findmyhappy <findhappy@sohu.com>
Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>
Co-authored-by: Renan <renan.061@gmail.com>
Co-authored-by: Renan <renan@zetachain.com>

* feat: add new dry zetaclient to localnet (#4387)

* feat: add new dry zetaclient to localnet

* fix: address reviews (lumtis)

* fix: address reviews (skosito)

* refactor: change client mode config (#4391)

* refactor: change client mode config

* fix: address reviews (skosito)

* fix: address reviews (lumtis)

* fix: address reviews (coderabbitai)

* fix: address reviews (lumtis)

* ci: fix branch name rule to include all release branches (#4398)

ci(backport/zetaclient_v37): fix branch name rule to include all release branches

* docs: add documentation for gas and fees with ZetaChain (#4394)

* recreate docs

* add link to readme

* start deposit sections

* add bitcoin fee

* Update docs/zetacore/gas_and_fees.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update docs/zetacore/gas_and_fees.md

Co-authored-by: Renan <renan@zetachain.com>

* Update docs/zetacore/gas_and_fees.md

Co-authored-by: Tanmay <tanmay@zetachain.com>

* apply comments

* add Solana network fees

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Renan <renan@zetachain.com>
Co-authored-by: Tanmay <tanmay@zetachain.com>

* fix: wrong error usage for aborted cctx error message (#4405)

* chore: fix some typos in comments (#4409)

Signed-off-by: claudecodering <claudecoder@outlook.com>

* test: add chaos mode capabilities to zetaclient localnet (#4408)

* feat: add chaos mode capabilities to zetaclient localnet

* fix: address reviews (coderabbitai)

* fix: address reviews (lumtis)

* feat: Add ref to test binaries workflow (#4410)

* feat: Add ref to test binaries workflow

* docs: move to further reading section

* fix: load inbound cursors for each supported packages from db (#4403)

* load inbound cursors for each packages from database

* add changelog entry

* fix: retry Sui inbound if the inbound vote RPC failed (#4401)

* do not skip inbound when vote inbound RPC failed

* add changelog entry

* wraps two errors into one without convert the second into string

* chore(deps): bump github.com/consensys/gnark-crypto from 0.16.0 to 0.18.1 (#4404)

chore(deps): bump github.com/consensys/gnark-crypto

Bumps [github.com/consensys/gnark-crypto](https://github.com/consensys/gnark-crypto) from 0.16.0 to 0.18.1.
- [Release notes](https://github.com/consensys/gnark-crypto/releases)
- [Changelog](https://github.com/Consensys/gnark-crypto/blob/v0.18.1/CHANGELOG.md)
- [Commits](https://github.com/consensys/gnark-crypto/compare/v0.16.0...v0.18.1)

---
updated-dependencies:
- dependency-name: github.com/consensys/gnark-crypto
  dependency-version: 0.18.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: fix the inconsistent method names in the comments (#4421)

Signed-off-by: rustversion <rustverion@outlook.com>

* feat: add devnet command to create a fork from existing node data  (#4419)

* refactor start command

* update error messages

* update error messages

* generate files

* modify slashing info

* update node shutdown to add grace duration

* add changelog

* add changelog

* generate files

* start json rpc server in sync

* add python script to start a forked node

* replace fmt.Errorf with error.wrap

* rename import to codectypes

* rename testnet to devnet

* rename testnet to devnet

* generate files

* fix gosec warnings

* ignore close error for cleanup

* chore: fix a large number of spelling issues (#4432)

* chore: fix a large number of spelling issues

Signed-off-by: tinyfoolish <tinyfoolish@outlook.com>

* Update cmd/zetatool/cli/cctx_tracker.go

* Update e2e/e2etests/test_bitcoin_deposit_and_withdraw_with_dust.go

* Update e2e/e2etests/test_bitcoin_deposit_and_withdraw_with_dust.go

---------

Signed-off-by: tinyfoolish <tinyfoolish@outlook.com>
Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* fix: temporarily disable zetaclient public DNS usage to avoid start failure (#4434)

* temporarily disable zetaclient public DNS usage

* add changelog entry

* Update changelog.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore: bump sol contracts with remove max payload check change (#4416)

bump sol contracts to remove max payload check

* refactor: replace interface{} with any for clarity and modernization (#4435)

Signed-off-by: sunnyraindy <sunnyraindy@outlook.com>

* fix: resolve IP address from public DNS and then pass it to go-tss (#4437)

* resolve IP address from public DNS and then pass it to go-tss

* add changelog entry

* sort IP addresses to be deterministic

* return error if both public IP or DNS are missing

* clean up TODO github link

* feat: add an option to trigger upgrade script after forking a network (#4428)

* refactor start command

* update error messages

* update error messages

* generate files

* modify slashing info

* update node shutdown to add grace duration

* add changelog

* add changelog

* generate files

* start json rpc server in sync

* add optional upgrade trigger

* add python script to start a forked node

* replace fmt.Errorf with error.wrap

* rename import to codectypes

* update python script to include upgrade trigger

* cache testnet snapshot for testing

* add upgrade scheduling to devnet

* use dvent for upgrade script

* add unit test for download info

* suppress nosec warnings

* ignore error on cleanup

* add os to the downloadInfo json

* add a constant for DefaultUpgradeHeighOffset

* fixes for comments

* added checksum to the sample script

* fix: update effective gas price calculation (#4443)

* update effective gas price calcualtion

* fix unit tests

* add changelog

* update comments

* add explicit error handling for all tx types that support EIP 1559 style gas prices

* set nil value for effective gas price

* undo setting effective gas price to nil

* test: add new chaos mode profiles  (#4440)

* test profiles

* fix solana chaos test

* add back generated files

* add back generated files

* add changelog

* use any instead of interface

* fix naming

* add chaos stress test

* fix: fix Sui example deployment by removing gateway object reference (#4414)

* remove gateway object reference from Sui example package

* add changelog entry

* remove unused error from sui example

* feat: a sequential batch TSS keysign scheduler for EVM chain (#4427)

* initial PoC of batch keysign for eth chain

* add comments in functions; consolidate AddKeysignInfo and GetSignature into one method

* improved code quality using separate files; refined batch keysign logic

* refined batch keysign logic to achieve stable performance

* use TSS nonce as starting point for keysign; improve code description

* use artificial height for batch keysign

* remove cctx height from keysign information

* improve function name and comments

* add changelog entry and update existing unit tests

* fix gosec and lint

* remove unused height; remove unused context from evm signer methods; improve comment

* add unit tests for batch keysign and tss service

* add a few more log messages in batch keysign

* add a few more fields to batch keysign log messages

* loop directly on nonce range other than on map

* split func PrepareForKeysign into two separate method, one for reading one for writing

* refactor: omit unnecessary reassignment (#4447)

Signed-off-by: liuyueyangxmu <liuyueyangxmu@outlook.com>

* test: update tss migration test migrate btc fund in two chunks (#4463)

* migrate btc funds twice

* update spacing to fix lint

* add comment to explain reason for chunking BTC funds migration

* fix: accept uppercase receiver address in Bitcoin withdrawal (#4471)

* allow uppercase receiver address in Bitcoin withdrawal

* add changelog entry

* test: add separate versions for zetaclient ,zetacore and zetae2e binaries when used in e2e tests  (#4476)

* create an optional alternate version for zetaclient in upgrade tests

* create an optional alternate version for zetaclient in upgrade tests

* Update changelog.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* use old version for zetacored version directly

* ignore overwrite errors for config file

* split versioning for zetacored ,zetaclient and zetae2e

* simplify second run check

* update changelog

* update changelog

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* test: prevent zetaclient from running if minimum version check failed (#4474)

* add e2e test for zetaclient minimum version

* block zetaclient to run if minimum version is not set

* revert the check on empty minimum version

* add changelog entry

* continue monitoring if operational flags RPC query failed

* docs: update protocol contracts EVM link in readme (#4458)

* feat: add MsgRemoveObserver (#4479)

* add tss migration for remove obdservers

* update tests and add changelog

* use uint for len of observer set

* remove stree for add observers

* set last update height for observer set

* add check for len of observer set in e2e test

* make TSS_MIGRATION_FLAG optional

* feat: add an option to create zetaclient dry node for tesntet/mainnet (#4453)

* add shell script to demonstrate zetaclient-dry

* verify zetacore and zetaclient binaries

* docker testnet node

* refactor zetaclient dry to use python entrypoint and make it configurable

* remove config

* add rpc nodes

* add changelog

* add changelog

* update comments

* update puthon scripts to use toml files directly

* simplify logic in scripts

* simplify logic in scripts

* copy scripts into docker container directly

* add profile to testnet and mainnet nodes

* add separate versioning for dry containers

* chore: fix some spelling issues in comments (#4480)

Signed-off-by: xiaolinny <xiaolincode@outlook.com>
Co-authored-by: morde08 <peter@zetachain.com>

* test: add sui to tss migration tests (#4488)

* add tss migration for sui

* add changelog

* debug changes

* update message context

* update comments

* remove unused functions

* feat: change params for 2s block time (#4484)

* change params for 2s block time

* changelog

* remove todo

* change default params

* test fixes

* fix migration test

* fix distributions test

* feat: Add action to build & push zetanode image internally (#4482)

* feat: Add action to build zetanode and deploy in dry-run mode

* Add pr trigger

* fix: remove snapshotter

* add pr trigger

* try new flow

* test docker availability

* fix variables and refactor

* add test to tag

* update action

* trigger

* push latest only if no version

* revert to version

* fix: remove PR trigger

* fix: concurrency and fallback

* fix: Add timeout and cleanup

* feat: enable ALT in solana inbounds (#4493)

* enable ALT in solana inbounds

* lint

* changelog

* PR comments

* fmt

* run ci

* fix: bring back the support for tracerConfig object in zevm debug API (#4490)

* bring back the support for tracerConfig object in evm debug API

* add changelog entry

* add unit test for traceConfig object

* fix: port sui outbound schedule interval (#4509)

* fix: sui outbound schedule interval (#4506)

* changelog

* fix: false mempool is congested warning (#4511)

* fix false mempool is congested warning

* changelog

* PR comment

* PR comment

* fix(backport): reindex txlogs if duplicate indexes are present  (#4498)

* update needs reindex function to check for log index across all groups

* add changelog

* use uint for index

* test: add e2e test to replace observer (#4503)

* add e2e test to replace observer

* update changelog

* add replace observer label check

* fix: Add solana image dependency

* Update cmd/zetae2e/local/replace_observer.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* add a comments to improve readibilty

---------

Co-authored-by: Hazim <hazim_malik@hotmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* test: add-ton-tss-migration (#4491)

* add tss migration for sui

* add changelog

* debug changes

* update message context

* update comments

* remove unused functions

* add ton to tss migration

* update comments

* update backoff

* update wait blocks for sui

* chore: fix function name in comment for batchLogger (#4504)

Signed-off-by: boqishan <boqishan@126.com>
Co-authored-by: Tanmay <tanmay@zetachain.com>

* feat: add migration script to add an authorization for MsgRemoveObserver (#4492)

* add migration script

* updae changelog

* feat: add a tool to list tss balances across all supported chains  (#4507)

* add tss balance check

* update to using supported chains list from network

* update comments

* remove sample config file from repository

* update identifier chainRpc to chainRPC

* feat: move gas price multiplier to chain params (#4485)

* move gas price multiplier to chain params

* add changelog entry

* add breaking change description in changelog

* fix nil chainParams check in migration script; fix typo and make gas multiplier validation less strict; update changelog

* describe the impact of newly added field gas multiplier; fix typo in zetatool inbound

* fix unit test

* chore: merge main into develop (#4512)

* fix: ratelimiting race condition vuln (#4072)

* fix: ratelimiting race condition vuln

* fix: ratelimiting race condition vuln

- Fix race condition in RateLimiter.Release() function
- Replace non-atomic check-then-act with atomic decrement and bounds checking
- Add comprehensive test suite to verify the fix
- Update changelog with PR #4072

* fix: correct atomic implementation to prevent underflow

- Replace flawed Add(-1) approach with proper CompareAndSwap
- Fix underflow detection issue where uint32 wrap-around was missed
- Add TestRateLimiterUnderflowProtection to verify the fix
- Ensure Release() never causes negative counters or semaphore over-release

* refactor: simplify rate limiter Release() implementation

- Remove unnecessary infinite loop in CAS operation
- Single CAS attempt is sufficient for race condition protection
- Maintains thread-safety while being more efficient
- All tests still pass with simplified implementation

* fix: correct order of operations in rate limiter Release()

- Fix race condition by decrementing counter before releasing semaphore
- Ensure pending counter accurately reflects semaphore state
- Simplify implementation by using correct operation order
- All tests pass with cleaner, more logical approach

* test: add tests that reproduce the original race condition vulnerability

- Add BuggyRateLimiter that implements the original vulnerable code
- Add TestBuggyRateLimiterRaceCondition to demonstrate the race condition
- Add TestBuggyRateLimiterStressTest to stress test the vulnerability
- Add TestVulnerabilityDemonstration to show before/after comparison
- Add TestBuggyRateLimiterExcessiveReleases to show excessive release issues
- These tests demonstrate the theoretical vulnerability even if timing makes it hard to reproduce consistently

* fix: address race condition and underflow issues in RateLimiter

- Fix race condition in Release() by reordering operations (decrement pending first, then release semaphore)
- Fix Pending() function to handle negative atomic.Int32 values correctly
- Add comprehensive tests to verify fixes
- Remove buggy code from tests as requested by reviewers
- Document original vulnerability in test comments

The original race condition allowed multiple goroutines to release more permits than acquired.
The Pending() function could return incorrect values due to negative atomic.Int32 conversion.

Fixes: #4072

* refactor: rename test and update changelog to reflect actual improvements

- Rename TestVulnerabilityDemonstration to TestRateLimiterRobustness
- Update test description to reflect code quality improvements rather than vulnerability fixes
- Update changelog entry to match actual changes
- Tests still pass, confirming the improvements are working correctly

The reviewer correctly pointed out that if tests pass on develop without fixes,
then we're improving robustness rather than fixing vulnerabilities.

* refactor: remove support for v1 revert address for BTC (#4070)

* remove support for v1 revert address for BTC

* add changelog

---------

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* feat: add support for withdraw using v2 connector contract   (#4064)

* update go mod

* add a new message for migrating funds

* add migrate funds to e2e

* rebase from develop

* add v2 e2e test to check flow

* add zeta gateway deposit to zetaclient

* add github workflow

* update comments

* fix code formating

* fix code formating

* fix code formating

* fix unit tests

* fix unit tests

* revert to old command to start e2e test

* remove message for migration and refactor to using contract directly

* add changelog

* generate files after removing new message

* update generated files

* update generated files

* update go mod

* update deposit

* add unit tests

* add unit tests

* generate files

* generate files

* undo changes based on develop

* update deposit and revert smart contract call

* rename zeta deposit test file

* rename zeta deposit test file

* add abort and revert tests

* add TestZetaDepositAndCallNoMessage

* add TestZetaDepositAndCallNoMessage

* remove payable from TestAbort contract

* rename to LegacyZETADepositAndCallContract

* improve unit test coverage

* fix unit tests

* add some delay in TestZetacore_SubscribeNewBlocks

* update comment for handling zeta token zrc20

* add e2e test

* add e2e test for withdraw

* refactor ProcessZEVMInboundV2

* add core registry to setup

* refactor e2e test helper functions

* add unit test for zeta withdraw

* add unit test for withdraw and call

* resolve comments 1

* add unit test for ProcessRevert

* add unit test for ProcessRevert

* add unit test for ProcessRevert

* improve abort tests

* improve abort tests

* resolve comments

* resolve comments 2

* update upgrade height to 280 to allow the first test to run the entire cycle

* wrap zeta mints in tmp context

* wrap zeta mint in temp context

* rebase

* add changelog

* add changelog

* adjust comments

* Update cmd/zetae2e/config/contracts.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix gas pool zeta calcualation

* add unit test for executeWithMintedZeta

* fix comments 1

* add unit tests

* update test dapp to use zeta token for consuming gas

* add core registry to zeta e2e post upgrade handler

* revert legacy test

* update changes based on comments 1

---------

Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: print error message in detail if unable to decode Bitcoin memo (#4090)

* print error message detail when memo decoding failed

* add changelog entry

* keep invalid memo log on Info level

---------

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* test(e2e): update admin e2e tests to use v2 connector  (#4071)

* update go mod

* add a new message for migrating funds

* add migrate funds to e2e

* rebase from develop

* add v2 e2e test to check flow

* add zeta gateway deposit to zetaclient

* add github workflow

* update comments

* fix code formating

* fix code formating

* fix code formating

* fix unit tests

* fix unit tests

* revert to old command to start e2e test

* remove message for migration and refactor to using contract directly

* add changelog

* generate files after removing new message

* update generated files

* update generated files

* update go mod

* update deposit

* add unit tests

* add unit tests

* generate files

* generate files

* undo changes based on develop

* update deposit and revert smart contract call

* rename zeta deposit test file

* rename zeta deposit test file

* add abort and revert tests

* add TestZetaDepositAndCallNoMessage

* add TestZetaDepositAndCallNoMessage

* remove payable from TestAbort contract

* rename to LegacyZETADepositAndCallContract

* improve unit test coverage

* fix unit tests

* add some delay in TestZetacore_SubscribeNewBlocks

* update comment for handling zeta token zrc20

* add e2e test

* add e2e test for withdraw

* refactor ProcessZEVMInboundV2

* add core registry to setup

* refactor e2e test helper functions

* add unit test for zeta withdraw

* add unit test for withdraw and call

* resolve comments 1

* add unit test for ProcessRevert

* add unit test for ProcessRevert

* add unit test for ProcessRevert

* improve abort tests

* improve abort tests

* resolve comments

* resolve comments 2

* update upgrade height to 280 to allow the first test to run the entire cycle

* wrap zeta mints in tmp context

* wrap zeta mint in temp context

* rebase

* add changelog

* add changelog

* adjust comments

* Update cmd/zetae2e/config/contracts.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix gas pool zeta calcualation

* add unit test for executeWithMintedZeta

* fix comments 1

* add unit tests

* update admin

* revert unncessary changes

* disable account balance verification for admin tests

* improve naming for deposit functions

* add changelog

* update comments

* update test legacy test zeta to use EVMAddress

* remove skipping admin in upgrade setup

---------

Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* test: fix eth deposit test to check balance after deposit (#4118)

* check balance after eth deposit test

* fix typo

* fix import

* test: fix flaky Solana depositAndCall tests (#4113)

* fix flaky solana depositAndCall tests

* add changelog entry

* add wait logic inside AssertTestDAppEVMCalled

* chore: bump cosmos evm to support querying legacy proposals of type MsgUpdateParams (#4094)

* update zeta evm

* update commit

* fix: use evm chain id from eth config in rpc backend (#4096)

* fix: cancel solana WaC if tx size is too large (#4098)

* cancel solana WaC if tx size is too large

* align the comments with the code

* fix: nil reference in trace block (#4093)

* update to commit be548f7691876e656ec61aa46e31ed337be92f4e , on branch release/v34

---------

Co-authored-by: skosito <skostic9242@gmail.com>
Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com>
Co-authored-by: morde08 <peter@zetachain.com>

* fix: error when deploying contracts on testnet (#4112)

* dont return err if tx is not found in get tx receipt

* fix tests

* changelog

* feat: support hostname in addition to public IP for zetaclient to connect to zetacore (#4068)

* save initial work to remote

* add unit test and live test for zetacore hostname support

* add changelog entry; fix gosec and clean unused code

* fix CI upgrade test

---------

Co-authored-by: Tanmay <tanmay@zetachain.com>

* fix: dbg trace block by number gas limit legacy (#4121)

* fix dbg trace by block

* PR comments

* changelog

* fix(cherry-pick): cancel solana WaC if tx size is too large (#4111)

* cancel solana WaC if tx size is too large

* add changelog entry

* chore: remove tx suffix in vote inbound and outbound message names (#4110)

* fix(`crosschain`): remove confirmation mode from outbound and inbound digest (#4116)

* inbound

* .

* changelog

* refactor(zetacore): overwrite consensus config values for all timeout deltas on startup. (#4097)

* update 1

* add start-skip-consensus-overwrite-test

* generate files

* update tests

* add unit tests

* add unit tests for GenesisChainID

* add unit tests for GenesisChainID

* rename genesisChainID

* fix typo

* remove testnet from overwrite check

* refactor: replace []byte(fmt.Sprintf) with fmt.Appendf (#4131)

Signed-off-by: yinwenyu6 <yinwenyu6@outlook.com>

* feat: Sui message context ID as dynamic field (#4087)

* re-enable sui authenticated call

* integrate message context ID as dynamic field

* add changelog entry

* make issueMessageContext function self-contained

* fix unit test

* remove --skip-dependency-verification in sui gateway upgrade test

* cancel withdrawAndCall on invalid payload

* adopt new increase_nonce signature to adopt gas refund logic when cancelling a CCTX

* apply stringent check on Sui transaction's checkpoint

* apply status check on Sui inbound

* fix CI upgrade test

* fix unit test

* chore: fix some function names in comment (#4129)

Signed-off-by: pxwanglu <pxwanglu@icloud.com>

* chore: fix some observer message names (#4141)

* test: fix flaky Solana SPL deposit balance check (#4142)

* fix solana e2e SPL balance check by waiting maximum 30 seconds

* add changelog entry

* refactor: remove intx and outtx deprecated queries (#4150)

* refactor: remove intx and outtx deprecated queries

* fixes in e2e

* chore: remove redundant word in comment (#4149)

Signed-off-by: wmypku <wmypku@outlook.com>

* test(`e2e`): improve logs for CCTX status assertion (#4147)

* improve require status logs

* update usage in tests

* lint

* cursor comment

* chore: fix some typos in comment (#4146)

Signed-off-by: tzchenxixi <tzchenxixi@icloud.com>

* chore: set v35 as upgrade test reference and various clean up (#4115)

* add back precompiles

* add abci field to proposal

* test

* enable back

* test no creating proposasl

* disable zeta-ante

* cleanup v33 upgrade helper

* add v35 as reference

* remove gas stability pool temporary

* update to v36 and disable fast confirmation test

* bitcoin fast confirmation

* increase ersion for zeta

* remove erc20 init handler

* disable zevm to evm revert for older version

* disable zevm to evm revert abort for older version

* increase upgrade height

* feat: make the gas limit used for gateway calls on ZEVM a configurable parameter (#4153)

* add GatewayGasLimit to state

* refactor function name from MustGetGatewayGasLimit to GetGatewayGasLimitSafe

* update unit tests

* update unit tests

* update proto files

* replace big int with uint64

* changelog

* add check of older value

* add v4 migration back for authority module

* update setup handler to remove setting erc20 module

* test changes

* revert to using v32 as base branch for upgrades

---------

Co-authored-by: lumtis <lucas.bertrand.22@gmail.com>

* test(`e2e`): add a gas limit option for ZEVM to EVM call tests (#4145)

* add gas limit option

* use option for tests

* increase further upgrade height

* test: use pre-deployed example dapp V2 contract in e2e tests (#4158)

* do not deploy example contract in e2e tests, use pre-deployed example dapp V2 instead

* add changelog entry

* clean up debugging log

* remove commented code

* add back extra zrc20 SPL balance check

* chore(`e2e`): cleanup unused contracts (#4161)

* remove contextapp

* remove distribute

* test: fix flaky depositAndCall test that failed on sender assertion (#4165)

* fix flaky depositAndCall caused by sender assertion

* add changelog entry

* chore(deps): bump github.com/hashicorp/go-getter from 1.7.8 to 1.7.9 (#4148)

Bumps [github.com/hashicorp/go-getter](https://github.com/hashicorp/go-getter) from 1.7.8 to 1.7.9.
- [Release notes](https://github.com/hashicorp/go-getter/releases)
- [Changelog](https://github.com/hashicorp/go-getter/blob/main/.goreleaser.yml)
- [Commits](https://github.com/hashicorp/go-getter/compare/v1.7.8...v1.7.9)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-getter
  dependency-version: 1.7.9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github.com/ulikunitz/xz from 0.5.11 to 0.5.14 (#4172)

Bumps [github.com/ulikunitz/xz](https://github.com/ulikunitz/xz) from 0.5.11 to 0.5.14.
- [Commits](https://github.com/ulikunitz/xz/compare/v0.5.11...v0.5.14)

---
updated-dependencies:
- dependency-name: github.com/ulikunitz/xz
  dependency-version: 0.5.14
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.4.0 (#4173)

chore(deps): bump github.com/go-viper/mapstructure/v2

Bumps [github.com/go-viper/mapstructure/v2](https://github.com/go-viper/mapstructure) from 2.2.1 to 2.4.0.
- [Release notes](https://github.com/go-viper/mapstructure/releases)
- [Changelog](https://github.com/go-viper/mapstructure/blob/main/CHANGELOG.md)
- [Commits](https://github.com/go-viper/mapstructure/compare/v2.2.1...v2.4.0)

---
updated-dependencies:
- dependency-name: github.com/go-viper/mapstructure/v2
  dependency-version: 2.4.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* refactor: standardize zetaclient logging (#4144)

* chore: remove unused DynamicTicker from zetaclient/types

* refactor: remove Msgf and refactor zerolog uses

* Replace Msgf for Msg
* Use '_' instead of '.'
* Start logs with lowercase instead of uppercase characters
* Use the constants in the logs module
* Use With().Logger() instead of log fields when possible

* fix: improve zetatool (#4175)

* scan gateway events by default for all inbound hashes

* scan gateway events by default for all inbound hashes

* test(`e2e`): add a E2E test to test depositAndCall with high gas consumption (#4177)

* set gas limit to 4m in localnet

* add high usage test

* changelog

* Update changelog.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update e2e/e2etests/e2etests.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* test(`e2e`): add all chains by default in `start-localnet` (#4163)

* chore: add Solana to start-localnet to allow to run local tests

* add sui and ton

* Update cmd/zetae2e/local/local.go

Co-authored-by: Tanmay <tanmay@zetachain.com>

---------

Co-authored-by: Tanmay <tanmay@zetachain.com>

* chore: remove redundant words (#4179)

Signed-off-by: keeghcet <keeghcet@outlook.com>

* refactor: omit unnecessary reassignment (#4184)

Signed-off-by: fengyuchuanshen <fengyuchuanshen@outlook.com>

* fix: force rescan if inbound vote monitoring fails  (#4183)

* add monitoringErr channel

* update to InboundBlockHeight - 1 , for reseting the block

* fix unit tests

* implement error interface

* rename to ErrTxMonitor

* add forceResetLastScanned flag

* add forceResetLastScanned flag

* add mutex to force scan

* add changelog

* add changelog

* update name to wasForceReset

* wrap UpdateForceResetLastScanned in mutex

* add a bound check to InboundBlockHeight to be safe

* Update zetaclient/chains/base/confirmation.go

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* Update zetaclient/chains/base/observer.go

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* force update for in memory value if forceResetLastScanned is true

* add a lock on reading block height

* update error message

* update changelog

* wait till end of scan cycle to toggle the forceUpdateFlag

---------

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* fix: remove duplicate solana post-gas-price goroutine (#4194)

* feat: observe inbound from previous gateway package after upgrade (#4138)

* observe inbound from old gateway package optionally

* add changelog entry

* add sui inbound cursor migration; add post-upgrade deposit tests

* improve comments, logs and naming; fix post-upgrade withdraw failure

* protect anyStringMap

* add support for <withdrawcap-id> to Sui gateway address

* fix CI upgrade test failure

* use name previousPackageID and keep name PairID; rename AnyString and cursor migration function; improve test, comments, etc.

* replaced assert by require in sui unit test

* add support for original packageID in Sui gateway address

* avoid wrapping nil error

* use previous package ID in post-upgrade Sui deposit test

* add support for previous package deprecation and fix upgrade test

* fix unit test

* add a note to clarify the PackageID argument used for event query

* add documents to explain Sui gateway address format in the chain params

* refactor: remove unused loggers and log fields (#4180)

* chore: remove unused Headers logger

* refactor: remove (mostly) unused GasPrice logger

* refactor: replace logs.FieldMethod with With().Caller() and standardize logs.FieldModule values

* refactor: remove (mostly) unused log fields FieldTracker and FieldConfirmationMode

* refactor: replace missed log instances of '.' for '_'

* fix: unpack bitcoin revert message without considering 'CallOnRevert' flag (#4169)

* enable bitcoin revertMessage and ignore CallOnRevert flag

* add changelog entry

* update standard memo doc; improve abort address validation

* skip incompatible e2e test to allow CI upgrade test to pass

* fix: add timeout to monitoring routine (#4196)

* add a timeout for vote monitoring thread

* add a timeout for vote monitoring thread

* add comments

* remove typo for cancel call

* fix unit tests

* Update zetaclient/zetacore/client_vote.go

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* Update zetaclient/chains/base/observer.go

Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com>

---------

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>
Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com>

* refactor: use maps.Copy for cleaner map handling (#4198)

Signed-off-by: joemicky <joemickychang@outlook.com>

* chore: fix some comments (#4208)

Signed-off-by: zhoujiaweii <zjwustc@outlook.com>

* fix: update evm version for missing tx types (#4216)

* refactor: replace HasPrefix+TrimPrefix with CutPrefix (#4215)

Signed-off-by: quantpoet <quantway@outlook.com>

* refactor: remove `LastBlockHeight` state variable (#4200)

* proto

* remove other references

* changelog

* refactor: add documentation for ZetaClient logging fields (#4174)

* refactor: use coin.CoinType for compliance logging

* refactor: add documentation for zetaclient logging fields

* fix: remove ZetaChain chain ID from GasStabilityPoolBalances query (#4217)

* fix query

* add test

* changelog

* add commment

* lint

* remove gas token address

* change error type

* refactor: remove index field in ballot (#4205)

* refactor: remove index field in ballot

* changelog

* fix unit tests

* refactor: remove `MsgUpdateERC20CustodyPauseStatus` and `MsgMigrateERC20CustodyFunds` (#4199)

* make message legacy

* remove other reference

* changelog

* refactor: rename whitelistERC20 into whitelistAsset (#4203)

* refactor: rename whitelistERC20 into whitelistAsset

* e2e test

* e2e test

* fix event

* simulation

* changelogs

* update auth list

* add migration script

* apply comment

* feat: provide error information in CCTX struct when Bitcoin deposit fail (#4211)

* add error message to CCTX struct when Bitcoin deposit failed

* add changelog entry

* fix unit test; improve function naming

* add unit test for inbound vote digest

* exclude inbound observation error message from digest

* fix: re-check for finalized ballot when executing inbound vote to create cctx (#4197)

* check for finalized block after ballot is finalized

* fix unit tests and add changelog

* adjust comments

* Apply suggestion from @lumtis

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* Apply suggestion from @lumtis

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* refactor check finalized ballot check to be done before adding the finalizing vote to the ballot

* adjust comments

* adjust comments

* fix comments 2

---------

Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>

* fix: set zeta ante to true in upgrade tests  (#4225)

* add zeta ante

* add to upgrade test regular

* add to upgrade test regular

* update out of gas test

* update out of gas test

* fix tss migration test

* fix lint issues 1

* update v2 zeta version

* chore: resync changelogs with v36 changes (#4223)

* fix: skip writing config file to the filesystem  (#4210)

* comment out writing files to the state

* ad changelog

* remove commented code

* return error from fetching FlagSkipConfigOverwrite

* refactor(`observer`): remove deprecated code (#4192)

* update proto

* update code

* changelogs

* fix changelog

* fix gas limit issue in upgrade test

* use ante-zetae2e for admin upgrade tests

* test fix

* refactor: prepare the client interfaces used by the observer-signers for dry-mode (#4213)

refactor: prepare the client interfaces of the observer-signers for dry-mode

* feat: enable NoAssetCall from Bitcoin (#4218)

* enable NoAssetCall from Bitcoin

* add changelog entry

* improve comment and log print

* revert bitcoin NoAssetCall that carries large excessive funds

* adjust btc inbound parsing order; fix test name

* improve function and variable names

* feat: multiple evm calls in single tx (#4157)

* bump protocol contracts

* use newer geth version with cancun support

* e2e test with 2 deposits in same tx

* e2e tests

* inbound trackers for multiple events

* changelog

* generate

* fix e2e tests

* inbound trackers e2e test

* bump protocol contracts

* PR comments

* PR comment

* PR comments

* PR comment

* lower upgrade height in upgrade tests

* try diff upgrade height

* upgrade additional fee in upgrade v36 handler

* chore: fix function name in comment (#4238)

Signed-off-by: russcoss <russcoss@outlook.com>

* revert: add timeout to monitoring routine" (#4244)

Revert "fix: add timeout to monitoring routine (#4196)"

This reverts commit 65f227bbfa585adb408f31d15a5bcf71243d1e52.

* fix(e2e): check test contracts deployment (#4251)

* fix(e2e): check test contracts deployment

* add other contracts

* changelog

* fix chain to wait tx from

* revert: force rescan if inbound vote monitoring fails (#4250)

* feat: refund a portion of remaining unused tokens to user (#3734)

* add new field to cctx structure to track user gas burned

* add unit tests

* add doc

* add unit test for migration

* add check for pre upgrade cctxs

* add older logic for handling cctxs created before upgrade

* remove LegacyChainParams

* add unit test for refund gas fee

* remove old migration

* add temp note for PR review

* fix typo

* fix typo

* generate files

* add missing test case

* add missing test case

* refactor based on comments

* update EtherWithdrawRestricted test

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

Labels

docs Improvements or additions to documentation zetaclient Issues related to ZetaClient

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a docs that list all the logging field used in ZetaClient

5 participants