Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support depositAndCall and withdrawAndCall with empty message #3018

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

lumtis
Copy link
Member

@lumtis lumtis commented Oct 17, 2024

Description

Currently both would be interpreted as normal dpeosit or withdraw

This PR fix this with using a new field in the inbound and a new type of event in the gateway contracts

Smart contract associated PR: zeta-chain/protocol-contracts#403

@lumtis lumtis added V2_TESTS Run make start-v2-test V2_MIGRATION_TESTS Run make start-upgrade-v2-migration-test UPGRADE_LIGHT_TESTS Run make start-upgrade-test-light and removed V2_MIGRATION_TESTS Run make start-upgrade-v2-migration-test labels Oct 17, 2024
Copy link

codecov bot commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 7.16180% with 350 lines in your changes missing coverage. Please review.

Project coverage is 64.48%. Comparing base (250b90e) to head (635fbf2).
Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
x/crosschain/types/inbound_parsing.go 0.00% 150 Missing ⚠️
zetaclient/chains/evm/observer/v2_inbound.go 0.00% 109 Missing ⚠️
x/crosschain/keeper/v2_zevm_inbound.go 1.92% 50 Missing and 1 partial ⚠️
pkg/contracts/testdappv2/TestDAppV2.go 0.00% 26 Missing ⚠️
zetaclient/chains/evm/observer/inbound.go 0.00% 9 Missing ⚠️
x/fungible/keeper/v2_deposits.go 71.42% 0 Missing and 2 partials ⚠️
zetaclient/chains/evm/cctx.go 66.66% 1 Missing and 1 partial ⚠️
x/crosschain/types/cctx.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3018      +/-   ##
===========================================
- Coverage    66.25%   64.48%   -1.78%     
===========================================
  Files          406      409       +3     
  Lines        22772    28630    +5858     
===========================================
+ Hits         15088    18462    +3374     
- Misses        6907     9373    +2466     
- Partials       777      795      +18     
Files with missing lines Coverage Δ
x/crosschain/keeper/evm_deposit.go 86.84% <100.00%> (-0.12%) ⬇️
x/crosschain/types/message_vote_inbound.go 100.00% <100.00%> (ø)
x/fungible/keeper/deposits.go 96.05% <100.00%> (+0.30%) ⬆️
x/crosschain/types/cctx.go 43.36% <0.00%> (-0.12%) ⬇️
x/fungible/keeper/v2_deposits.go 21.31% <71.42%> (+0.03%) ⬆️
zetaclient/chains/evm/cctx.go 65.71% <66.66%> (+65.71%) ⬆️
zetaclient/chains/evm/observer/inbound.go 35.28% <0.00%> (-2.17%) ⬇️
pkg/contracts/testdappv2/TestDAppV2.go 0.00% <0.00%> (ø)
x/crosschain/keeper/v2_zevm_inbound.go 3.96% <1.92%> (-6.43%) ⬇️
zetaclient/chains/evm/observer/v2_inbound.go 0.00% <0.00%> (ø)
... and 1 more

... and 381 files with indirect coverage changes

@@ -52,6 +52,7 @@
* [2853](https://github.com/zeta-chain/node/pull/2853) - calling precompile through sc with sc state update
* [2925](https://github.com/zeta-chain/node/pull/2925) - add recover to init chainer to diplay informative message when starting a node from block 1
* [2909](https://github.com/zeta-chain/node/pull/2909) - add legacy messages back to codec for querier backward compatibility
* [3018](https://github.com/zeta-chain/node/pull/3018) - support `DepositAndCall` and `WithdrawAndCall` with empty payload
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldnt this be DepositedAndCalled and WithdrawedAndCalled?

@@ -190,7 +199,7 @@ func (r *E2ERunner) V2ZEVMToEMVAuthenticatedCall(
return tx
}

// V2ZEVMToEMVCall calls authenticated Call of Gateway on ZEVM through contract
Copy link
Contributor

Choose a reason for hiding this comment

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

also did some renaming on these tests in my PR


// this field describes if a smart contract call should be made for a inbound
// with assets only used for protocol contract version 2
bool is_cross_chain_call = 12;
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure about this name, especially because it is i crosschain proto, maybe can reflect assets in the name?

if we need to keep it, maybe we can add a bit more in comment, and make comment same for proto below

types.ProtocolContractVersion_V2,
event.CallOptions.IsArbitraryCall,
types.WithZEVMRevertOptions(event.RevertOptions),
types.WithCrossChainCall(true),
Copy link
Contributor

Choose a reason for hiding this comment

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

in this case its true no matter of message lenght right? maybe we can add comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking:cli breaking:proto UPGRADE_LIGHT_TESTS Run make start-upgrade-test-light V2_TESTS Run make start-v2-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce a new type of cctx to authorize depositAndCall and withdrawAndCall without message
2 participants