Skip to content

Commit

Permalink
Merge branch 'authenticated-call-sc-support' into add-sender-to-rever…
Browse files Browse the repository at this point in the history
…t-context
  • Loading branch information
skosito committed Sep 27, 2024
2 parents 0a6b1f6 + a4b9384 commit 3425be0
Show file tree
Hide file tree
Showing 39 changed files with 600 additions and 443 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Semgrep
on:
workflow_dispatch: {}
pull_request: {}
push:
branches:
- develop
schedule:
# random HH:MM to avoid a load spike on GitHub Actions at 00:00
- cron: '56 22 * * *'
jobs:
semgrep:
name: semgrep/ci
runs-on: ubuntu-20.04
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
container:
image: semgrep/semgrep
if: (github.actor != 'dependabot[bot]')
steps:
- uses: actions/checkout@v4
- run: semgrep ci
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* [2870](https://github.com/zeta-chain/node/pull/2870) - support for multiple Bitcoin chains in the zetaclient
* [2883](https://github.com/zeta-chain/node/pull/2883) - add chain static information for btc signet testnet
* [2907](https://github.com/zeta-chain/node/pull/2907) - derive Bitcoin tss address by chain id and added more Signet static info
* [2911](https://github.com/zeta-chain/node/pull/2911) - add chain static information for btc testnet4
* [2904](https://github.com/zeta-chain/node/pull/2904) - integrate authenticated calls smart contract functionality into protocol
* [2919](https://github.com/zeta-chain/node/pull/2919) - add sender to revert context

Expand Down
9 changes: 6 additions & 3 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56986,7 +56986,6 @@ definitions:
- solana_mainnet
- solana_devnet
- solana_localnet
- btc_signet_testnet
default: empty
title: |-
ChainName represents the name of the chain
Expand Down Expand Up @@ -57282,8 +57281,10 @@ definitions:
tss_nonce:
type: string
format: uint64
call_options:
$ref: '#/definitions/crosschainCallOptions'
gas_limit:
type: string
format: uint64
title: Deprecated (v21), use CallOptions
gas_price:
type: string
gas_priority_fee:
Expand All @@ -57310,6 +57311,8 @@ definitions:
type: string
tx_finalization_status:
$ref: '#/definitions/crosschainTxFinalizationStatus'
call_options:
$ref: '#/definitions/crosschainCallOptions'
crosschainOutboundTracker:
type: object
properties:
Expand Down
3 changes: 2 additions & 1 deletion docs/spec/crosschain/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,14 @@ message MsgVoteInbound {
string message = 8;
string inbound_hash = 9;
uint64 inbound_block_height = 10;
CallOptions call_options = 11;
uint64 gas_limit = 11;
pkg.coin.CoinType coin_type = 12;
string tx_origin = 13;
string asset = 14;
uint64 event_index = 15;
ProtocolContractVersion protocol_contract_version = 16;
RevertOptions revert_options = 17;
CallOptions call_options = 18;
}
```

Expand Down
3 changes: 2 additions & 1 deletion e2e/runner/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ func (l *Logger) CCTX(cctx crosschaintypes.CrossChainTx, name string) {
l.Info(" TxHeight: %d", outTxParam.ObservedExternalHeight)
l.Info(" BallotIndex: %s", outTxParam.BallotIndex)
l.Info(" TSSNonce: %d", outTxParam.TssNonce)
l.Info(" GasLimit: %d", outTxParam.CallOptions.GasLimit)
l.Info(" CallOptions: %+v", outTxParam.CallOptions)
l.Info(" GasLimit: %d", outTxParam.GasLimit)
l.Info(" GasPrice: %s", outTxParam.GasPrice)
l.Info(" GasUsed: %d", outTxParam.GasUsed)
l.Info(" EffectiveGasPrice: %s", outTxParam.EffectiveGasPrice.String())
Expand Down
15 changes: 14 additions & 1 deletion pkg/chains/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ var (
Name: "btc_testnet",
}

// BitcoinSignetTestnet is Bitcoin Signet testnet
BitcoinSignetTestnet = Chain{
ChainName: ChainName_btc_signet_testnet,
ChainId: 18333,
Network: Network_btc,
NetworkType: NetworkType_testnet,
Expand All @@ -181,6 +181,18 @@ var (
Name: "btc_signet_testnet",
}

// BitcoinTestnet4 is Bitcoin testnet4
BitcoinTestnet4 = Chain{
ChainId: 18334,
Network: Network_btc,
NetworkType: NetworkType_testnet,
Vm: Vm_no_vm,
Consensus: Consensus_bitcoin,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
Name: "btc_testnet4",
}

// Amoy is Polygon amoy testnet
Amoy = Chain{
ChainName: ChainName_amoy_testnet,
Expand Down Expand Up @@ -360,6 +372,7 @@ func DefaultChainsList() []Chain {
Ethereum,
BitcoinTestnet,
BitcoinSignetTestnet,
BitcoinTestnet4,
Mumbai,
Amoy,
BscTestnet,
Expand Down
189 changes: 93 additions & 96 deletions pkg/chains/chains.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion pkg/chains/chains_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import (
func TestChain_Name(t *testing.T) {
t.Run("new Name field is compatible with ChainName enum", func(t *testing.T) {
for _, chain := range chains.DefaultChainsList() {
require.EqualValues(t, chain.Name, chain.ChainName.String())
if chain.ChainName != chains.ChainName_empty {
require.EqualValues(t, chain.Name, chain.ChainName.String())
}
}
})
}
Expand Down Expand Up @@ -43,6 +45,7 @@ func TestChainListByNetworkType(t *testing.T) {
chains.ZetaChainTestnet,
chains.BitcoinTestnet,
chains.BitcoinSignetTestnet,
chains.BitcoinTestnet4,
chains.Mumbai,
chains.Amoy,
chains.BscTestnet,
Expand Down Expand Up @@ -95,6 +98,7 @@ func TestChainListByNetwork(t *testing.T) {
chains.BitcoinMainnet,
chains.BitcoinTestnet,
chains.BitcoinSignetTestnet,
chains.BitcoinTestnet4,
chains.BitcoinRegtest,
},
},
Expand Down Expand Up @@ -144,6 +148,7 @@ func TestDefaultChainList(t *testing.T) {
chains.Ethereum,
chains.BitcoinTestnet,
chains.BitcoinSignetTestnet,
chains.BitcoinTestnet4,
chains.Mumbai,
chains.Amoy,
chains.BscTestnet,
Expand Down Expand Up @@ -181,6 +186,7 @@ func TestChainListByGateway(t *testing.T) {
chains.Ethereum,
chains.BitcoinTestnet,
chains.BitcoinSignetTestnet,
chains.BitcoinTestnet4,
chains.Mumbai,
chains.Amoy,
chains.BscTestnet,
Expand Down Expand Up @@ -224,6 +230,7 @@ func TestExternalChainList(t *testing.T) {
chains.Ethereum,
chains.BitcoinTestnet,
chains.BitcoinSignetTestnet,
chains.BitcoinTestnet4,
chains.Mumbai,
chains.Amoy,
chains.BscTestnet,
Expand Down
Loading

0 comments on commit 3425be0

Please sign in to comment.