Skip to content

Commit

Permalink
Merge branch 'develop' into fix-bitcoin-zrc20-withdraw
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie authored Sep 12, 2023
2 parents f5dfbed + f3c6d6e commit d1ee2cd
Show file tree
Hide file tree
Showing 130 changed files with 5,504 additions and 847 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-binaries/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
with:
run-tests: ${{ env.GITHUB_REF_NAME != 'develop' }}
build-indexer: false
go-version: '1.19'
go-version: '1.20'
```
2 changes: 1 addition & 1 deletion .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
- uses: actions/setup-go@v4
if: ${{ inputs.skip_go == 'false' }}
with:
go-version: '1.19.0'
go-version: '1.20'
cache: false

- uses: actions/setup-python@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/upgrade-testing/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
################
# BUILD ZETAVISOR
################
FROM golang:1.19 AS cosmovisor
FROM golang:1.20 AS cosmovisor
ENV GOBIN=/go/bin
ENV GOPATH=/go
ENV CGO_ENABLED=0
Expand All @@ -16,7 +16,7 @@ RUN apt update && \

FROM ubuntu:latest
RUN apt-get update && apt-get install -y curl ca-certificates
ENV GO_VERSION 1.19
ENV GO_VERSION 1.20
RUN curl -L https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
Expand Down
86 changes: 78 additions & 8 deletions .github/workflows/sast-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'

# - name: Install Pipeline Dependencies
# uses: ./.github/actions/install-dependencies
Expand Down Expand Up @@ -59,24 +59,94 @@ jobs:

lint:
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 15
env:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@v2

# - name: Install Pipeline Dependencies
# uses: ./.github/actions/install-dependencies
with:
fetch-depth: 0

- name: Install Pipeline Dependencies
uses: ./.github/actions/install-dependencies

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.19'

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.50
skip-cache: true
args: --timeout=30m
args: --timeout=15m

nosec_alert:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Getting files updated in the PR
id: changed-files
uses: tj-actions/changed-files@v39
with:
base_sha: ${{ github.event.pull_request.base.sha }}

- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
- name: Report nosec usage
run: |
nosec_list=()
nosec_detected=0
echo "Changed files: ${{ steps.changed-files.outputs.all_changed_files }}"
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
if git diff ${{ github.event.pull_request.base.sha }} $file | grep -q nosec; then
echo "nosec detected in $file"
nosec_list+=("$file,")
nosec_detected=1
else
echo "nosec not detected in $file"
fi
done
nosec_list_string="${nosec_list[@]}"
nosec_list_string="${nosec_list_string%,}"
echo "nosec_files=$nosec_list_string" >> $GITHUB_ENV
echo "nosec_detected=$nosec_detected" >> $GITHUB_ENV
- name: Report nosec uses
uses: mshick/add-pr-comment@v2
if: env.nosec_detected == 1
with:
message: |
*!!!WARNING!!!*
`nosec` detected in the following files: ${{ env.nosec_files }}
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.
Pay extra attention to the way `#nosec` is being used in the files listed above.
- name: Add Label
uses: actions/github-script@v6
if: env.nosec_detected == 1
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["nosec"]
})
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ linters:
- typecheck
- misspell
- prealloc
- depguard
- dogsled
- goconst
- bodyclose
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19-alpine
FROM golang:1.20-alpine

ENV GOPATH /go
ENV GOOS=linux
Expand All @@ -19,7 +19,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
RUN --mount=type=cache,target=/root/.cache/go-build \
make install-smoketest
#
#FROM golang:1.19-alpine
#FROM golang:1.20-alpine

#RUN apk --no-cache add openssh jq tmux vim curl bash
RUN ssh-keygen -A
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-athens3-ubuntu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19-bullseye
FROM golang:1.20-bullseye

ENV GOPATH /go
ENV GOOS=linux
Expand Down
2 changes: 1 addition & 1 deletion app/ante/handler_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate
}

// SetGasMeter returns a new context with a gas meter set from a given context.
func SetGasMeter(simulate bool, ctx sdk.Context, gasLimit uint64) sdk.Context {
func SetGasMeter(_ bool, ctx sdk.Context, gasLimit uint64) sdk.Context {
// In various cases such as simulation and during the genesis block, we do not
// meter any gas utilization.
//if simulate || ctx.BlockHeight() == 0 {
Expand Down
5 changes: 4 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,10 @@ func New(
// If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper

app.EvmKeeper = app.EvmKeeper.SetHooks(app.ZetaCoreKeeper.Hooks())
app.EvmKeeper = app.EvmKeeper.SetHooks(evmkeeper.NewMultiEvmHooks(
app.ZetaCoreKeeper.Hooks(),
app.FungibleKeeper.EVMHooks(),
))

/**** Module Options ****/

Expand Down
2 changes: 1 addition & 1 deletion cmd/zetaclientd/p2p_diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"

cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/libp2p/go-libp2p"
libp2p "github.com/libp2p/go-libp2p"
dht "github.com/libp2p/go-libp2p-kad-dht"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/network"
Expand Down
2 changes: 1 addition & 1 deletion contrib/localnet/orchestrator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM zetanode:latest as zeta
FROM ethereum/client-go:v1.10.26 as geth
FROM golang:1.19-alpine as orchestrator
FROM golang:1.20-alpine as orchestrator

RUN apk --no-cache add jq curl bash make git build-base

Expand Down
2 changes: 1 addition & 1 deletion contrib/localnet/orchestrator/Dockerfile.fastbuild
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM zetanode:latest as zeta
FROM ethereum/client-go:v1.10.26 as geth
FROM golang:1.19-alpine as orchestrator
FROM golang:1.20-alpine as orchestrator

RUN apk --no-cache add jq curl bash make git build-base

Expand Down
62 changes: 62 additions & 0 deletions contrib/localnet/orchestrator/smoketest/contracts/vault/Vault.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "balances",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "deposit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "withdraw",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
608060405234801561001057600080fd5b50610904806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806347e7ef2414610046578063c23f001f14610062578063f3fef3a314610092575b600080fd5b610060600480360381019061005b9190610564565b6100ae565b005b61007c600480360381019061007791906105a4565b61024c565b60405161008991906105f3565b60405180910390f35b6100ac60048036038101906100a79190610564565b610271565b005b600081116100f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100e89061066b565b60405180910390fd5b60008290508073ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b81526004016101339392919061069a565b6020604051808303816000875af1158015610152573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101769190610709565b6101b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101ac90610782565b60405180910390fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461024091906107d1565b92505081905550505050565b6000602052816000526040600020602052806000526040600020600091509150505481565b600081116102b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ab9061066b565b60405180910390fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610372576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036990610851565b60405180910390fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546103fd9190610871565b9250508190555060008290508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b81526004016104449291906108a5565b6020604051808303816000875af1158015610463573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104879190610709565b6104c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104bd90610782565b60405180910390fd5b505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006104fb826104d0565b9050919050565b61050b816104f0565b811461051657600080fd5b50565b60008135905061052881610502565b92915050565b6000819050919050565b6105418161052e565b811461054c57600080fd5b50565b60008135905061055e81610538565b92915050565b6000806040838503121561057b5761057a6104cb565b5b600061058985828601610519565b925050602061059a8582860161054f565b9150509250929050565b600080604083850312156105bb576105ba6104cb565b5b60006105c985828601610519565b92505060206105da85828601610519565b9150509250929050565b6105ed8161052e565b82525050565b600060208201905061060860008301846105e4565b92915050565b600082825260208201905092915050565b7f416d6f756e742073686f756c642062652067726561746572207468616e203000600082015250565b6000610655601f8361060e565b91506106608261061f565b602082019050919050565b6000602082019050818103600083015261068481610648565b9050919050565b610694816104f0565b82525050565b60006060820190506106af600083018661068b565b6106bc602083018561068b565b6106c960408301846105e4565b949350505050565b60008115159050919050565b6106e6816106d1565b81146106f157600080fd5b50565b600081519050610703816106dd565b92915050565b60006020828403121561071f5761071e6104cb565b5b600061072d848285016106f4565b91505092915050565b7f5472616e73666572206661696c65640000000000000000000000000000000000600082015250565b600061076c600f8361060e565b915061077782610736565b602082019050919050565b6000602082019050818103600083015261079b8161075f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006107dc8261052e565b91506107e78361052e565b92508282019050808211156107ff576107fe6107a2565b5b92915050565b7f496e73756666696369656e742062616c616e6365000000000000000000000000600082015250565b600061083b60148361060e565b915061084682610805565b602082019050919050565b6000602082019050818103600083015261086a8161082e565b9050919050565b600061087c8261052e565b91506108878361052e565b925082820390508181111561089f5761089e6107a2565b5b92915050565b60006040820190506108ba600083018561068b565b6108c760208301846105e4565b939250505056fea2646970667358221220a4c5411c946fad1845e3d501f7c432ddc24537e71ab463a59742ccbcc57c107264736f6c63430008150033
Loading

0 comments on commit d1ee2cd

Please sign in to comment.