Skip to content

Conversation

@kingpinXD
Copy link
Member

@kingpinXD kingpinXD commented Jan 6, 2026

Description

This PR updates main with all changes for the Reforge release

Important zetacored changes for review

  • Stability Pool Gas Refund Mechanism

    Setting UserGasFeePaid: When a withdrawal CCTX is created, UserGasFeePaid = GasLimit × GasPrice is calculated from median gas values and stored in outbound params. This occurs in PayGasNativeAndUpdateCctx, PayGasInERC20AndUpdateCctx, or PayGasInZetaAndUpdateCctx depending on the coin type.

    Refund Calculation: On outbound completion, the keeper calculates:

    ActualFee = GasUsed × EffectiveGasPrice
    RemainingFees = UserGasFeePaid - ActualFee
    UsableRemaining = RemainingFees × 0.95
    StabilityPoolAmount = UsableRemaining × (StabilityPoolPercentage / 100)
    UserRefund = UsableRemaining - StabilityPoolAmount

    For zEVM-originated withdrawals with valid hex sender, StabilityPoolPercentage is read from chain params (default 100%). Non-withdrawal transactions send 100% to the stability pool. The function returns early without action if EffectiveGasPrice is nil, ActualFee ≥ UserGasFeePaid, or UsableRemaining rounds to zero.

  • Remove an observer and test TSS migration with a reduced observer set
    The MsgRemoveObserver is used to remove an observer from the set . It removes the observer from the observer set and node account list
    There are two tests in the makefile start-tss-migration-add-observerand start-tss-migration-remove-observer which test both the flows.
    Another key thing to review is the TSS funds migration, this is. triggered between a tss generation and tss update to migrate funds . This should be done for all EVM and BITCOIN chains , however it has not been possible for us to test this against all evm chains on localnet , we just have ETH
    Also added a new tool under zetatool , to fetch tss balances across all chains , this is specially important for BTC chains as we would neeed to use that to provide migration amount subtracting the expected fee

  • V2 ZETA deposits and withdraws , (and add a flag to toggle it on and off)
    This enables zeta deposits and withdraws using connector v2 , but is disabled by the flag .
    The new connectors would not be enabled initially , so v37 should still fully support legacy flows
    After the upgrade , we can deploy the v2 contracts but will not migrate fiunds from old connector to new , nor update the connector address on zetacore , the the EnableV2ZETAFlows will be false by default.
    This makes sure all zeta deposits and withdraw work as before using V1 flows until we decide to migrate to v2 and enable the V2ZETAFlows make start-connector-migration-test tries to replicate this

    Aspect V1 (Legacy) V2 (Gateway)
    Contract Connector (onReceive) GatewayZEVM
    Protocol Version ProtocolContractVersion_V1 ProtocolContractVersion_V2
    Flag Required No Yes (IsV2ZetaEnabled)
    Message Encoding Base64 Hex
    Deposit Function LegacyZETADepositAndCallContract ProcessDeposit → processZetaDeposit
    Revert Function ZETARevertAndCallContract ProcessRevert → processZetaRevert
    Abort Support Legacy refund only Full onAbort callback

skosito and others added 30 commits August 13, 2025 20:19
* cancel solana WaC if tx size is too large

* align the comments with the code
…MsgUpdateParams (#4095)

* update zeta evm

* update commit

* update to commit be548f7691876e656ec61aa46e31ed337be92f4e , on branch release/v34

---------

Co-authored-by: morde08 <peter@zetachain.com>
* use SAFE confirmation mode for all inbound votes

* move confirmation mode update logic right before signing the inbound vote message
…#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
… 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>
* 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
…'CallOnRevert' flag (#4181)

* unpack revert message from Bitcoin memo without considering  flag

* skip incompatible e2e test to allow CI upgrade test to pass
…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>
Revert "fix: add a simple check for finalizing vote  (#4236)"

This reverts commit d8dc5ba.
… that can timeout (#4241)

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

This reverts commit 70ab2a7.
* fix(e2e): check test contracts deployment

* add other contracts

* fix chain to wait tx from

* fix check
* add a note for releases

* add release lifecycle docs
Signed-off-by: letreturn <letreturn@outlook.com>
Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com>
* 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
* 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 '_'
#4270)

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

* refactor: use coin.CoinType for compliance logging

* refactor: add documentation for zetaclient logging fields
Signed-off-by: yajianggroup <yajianggroup@outlook.com>
#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
Signed-off-by: mickychang9 <mickychang9@outlook.com>
* 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
@kingpinXD kingpinXD added UPGRADE_TESTS Run make start-upgrade-tests TSS_MIGRATION_TESTS Run TSS migration tests and removed ci Changes to CI pipeline or github actions breaking:proto breaking:cli labels Jan 6, 2026
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

!!!WARNING!!!
nosec detected in the following files: e2e/e2etests/test_solana_withdraw_and_call_alt.go, e2e/e2etests/test_spl_withdraw_and_call_alt.go, e2e/e2etests/test_stress_zevm.go, pkg/math/pairing.go, zetaclient/chains/base/signer_batch_info.go, zetaclient/chains/base/signer_batch_info_test.go, zetaclient/chains/base/signer_batch_sign.go, zetaclient/chains/base/signer_batch_sign_test.go, zetaclient/mode/chaos/chaos.go, e2e/e2etests/test_stress_eth_deposit.go, e2e/e2etests/test_stress_eth_withdraw.go, pkg/parsers/observer_info.go, server/util.go, zetaclient/chains/bitcoin/observer/gas_price.go, zetaclient/chains/bitcoin/observer/witness_test.go, zetaclient/chains/evm/evm.go, zetaclient/chains/evm/observer/observer_gas.go, zetaclient/chains/sui/sui.go, zetaclient/chains/ton/ton.go, zetaclient/tss/service.go, zetaclient/zetacore/client.go, zetaclient/zetacore/client_vote.go, zetaclient/chains/ton/signer/compose.go

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

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

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

@github-actions github-actions bot added the nosec label Jan 6, 2026
@kingpinXD kingpinXD added the no-changelog Skip changelog CI check label Jan 6, 2026
@github-actions github-actions bot added ci Changes to CI pipeline or github actions breaking:proto breaking:cli and removed no-changelog Skip changelog CI check labels Jan 6, 2026
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Comment @cursor review or bugbot run to trigger another review on this PR

@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.67%. Comparing base (8df6b33) to head (bafae4c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4518      +/-   ##
==========================================
- Coverage   65.93%   64.67%   -1.27%     
==========================================
  Files         451      473      +22     
  Lines       27251    29129    +1878     
==========================================
+ Hits        17969    18840     +871     
- Misses       8310     9255     +945     
- Partials      972     1034      +62     
Files with missing lines Coverage Δ
pkg/chains/address.go 85.41% <ø> (ø)
pkg/errgroup/errgroup.go 94.59% <ø> (ø)
pkg/errors/monitor_error.go 100.00% <ø> (ø)
pkg/math/pairing.go 100.00% <ø> (ø)
pkg/parsers/observer_info.go 38.88% <ø> (ø)
pkg/proofs/ethereum/proof.go 92.68% <ø> (ø)
pkg/retry/retry.go 72.05% <ø> (+5.39%) ⬆️
pkg/rpc/clients.go 71.42% <ø> (ø)
pkg/rpc/clients_tendermint.go 66.66% <ø> (-2.57%) ⬇️
pkg/scheduler/context.go 22.72% <ø> (ø)
... and 1 more

... and 117 files with indirect coverage changes

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

Copy link
Collaborator

@morde08 morde08 left a comment

Choose a reason for hiding this comment

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

We do seem to be deleting an additional file: zetaclient/chains/testutils/mocks/evm_client.go when comparing develop branch to release-reforge branch develop...release-reforge#diff-1e5fce4478dd1fad8c7b8c88099684ffad6288f0c58075d5035c78da6e95a486 but if that's expected LGTM

@kingpinXD
Copy link
Member Author

We do seem to be deleting an additional file: zetaclient/chains/testutils/mocks/evm_client.go when comparing develop branch to release-reforge branch develop...release-reforge#diff-1e5fce4478dd1fad8c7b8c88099684ffad6288f0c58075d5035c78da6e95a486 but if that's expected LGTM

That's fine , the testutils has been moved here
https://github.com/zeta-chain/zeta-node/blob/e7691cf683701e84c21a0863c702bd8f650f2bfc/zetaclient/testutils/mocks/evm_client.go#L1-L537

the folder on develop is just the older code which was not removed

@kingpinXD
Copy link
Member Author

Some addintional commits added would be backported to develop , no logical changes just unit tests and defensive checks

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.

the changes are unexpected. LGTM

@ws4charlie ws4charlie added this pull request to the merge queue Jan 6, 2026
Merged via the queue into main with commit 78e1a91 Jan 6, 2026
70 of 74 checks passed
@ws4charlie ws4charlie deleted the release-reforge branch January 6, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking:cli breaking:proto ci Changes to CI pipeline or github actions nosec TSS_MIGRATION_TESTS Run TSS migration tests UPGRADE_TESTS Run make start-upgrade-tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.