-
Notifications
You must be signed in to change notification settings - Fork 108
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
feat: remote omni-chain call context: sender and chainID #912
Conversation
and smoketest
@fadeev This PR will require a doc update. |
x/fungible/keeper/begin_blocker_deploy_system_contracts_privnet.go
Outdated
Show resolved
Hide resolved
x/fungible/keeper/begin_blocker_deploy_system_contracts_privnet.go
Outdated
Show resolved
Hide resolved
@lumtis thank you for the comments; addressed most of them. Request re-review |
Great, I will do a second iteration of the PR tomorrow, need to take more time looking at the smoke tests |
@brewmaster012 it seems there might be some comments you haven't seen, any opinion on these suggestions? |
@brewmaster012 can you provide more info on the |
Right now, origin is the EOA address, sender is empty because we are only processing txs that sent to TSS directly from EOA, not from some contract. |
Co-authored-by: Lucas Bertrand <lucas.bertrand.22@gmail.com>
yeah missed them. Now all should be addressed. |
Thanks. It seems merging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks legit to me, just another comment.
Yeah let's think about a small number of more generic types. For this PR im going to create a new one with a generic name.
________________________________
From: Tanmay ***@***.***>
Sent: Tuesday, August 8, 2023 4:51:26 PM
To: zeta-chain/node ***@***.***>
Cc: brewmaster012 ***@***.***>; Mention ***@***.***>
Subject: Re: [zeta-chain/node] feat: remote omni-chain call context: sender and chainID (PR #912)
@kingpinXD commented on this pull request.
________________________________
In x/fungible/keeper/msg_server_update_system_contract.go<#912 (comment)>:
+ "context"
+ "math/big"
+
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
+ ethcommon "github.com/ethereum/go-ethereum/common"
+ "github.com/zeta-chain/protocol-contracts/pkg/contracts/zevm/systemcontract.sol"
+ "github.com/zeta-chain/protocol-contracts/pkg/contracts/zevm/zrc20.sol"
+ "github.com/zeta-chain/zetacore/common"
+ "github.com/zeta-chain/zetacore/x/fungible/types"
+ zetaObserverTypes "github.com/zeta-chain/zetacore/x/observer/types"
+)
+
+func (k Keeper) UpdateSystemContract(goCtx context.Context, msg *types.MsgUpdateSystemContract) (*types.MsgUpdateSystemContractResponse, error) {
+ ctx := sdk.UnwrapSDKContext(goCtx)
+ if msg.Creator != k.zetaobserverKeeper.GetParams(ctx).GetAdminPolicyAccount(zetaObserverTypes.Policy_Type_deploy_fungible_coin) {
Yes, I think creating a new policy type might be a good idea, Or we can just rename the existing policy so that the identifier includes both the functions it's responsible for.
—
Reply to this email directly, view it on GitHub<#912 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AVEUZQ7RHREIOERYX76RUPLXUKYF5ANCNFSM6AAAAAA3EVBM6Q>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
which renames Context => zContext
ready for approval. @lumtis @kingpinXD |
Description
NOTE to a3 network:
Will require a redeployment of SystemContract and a MsgUpdateSystemContractAddress from policy group admin,
post upgrade (supposed in V8.0.0)
which adds the context struct to the parameters of depositAndCall() function in SystemContract.
This is breaking for dApps that rely on omnichain smart contract--the interface has changed.
The Msg handler updates all references to systemcontract address in ZRC20 contracts tracked
by ForeignCoins, and also migrate state from old systemcontract to new systemcontract.
Added three smoketest:
Misc fixes:
Closes: #832
Closes: #918
Closes: #919
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.
Checklist: