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

Last changes from NeonLabs #909

Merged
merged 22 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c9c1cae
NDEV-2184: Report error when requested too early slot (#195)
andreisilviudragnea Sep 15, 2023
142388f
NDEV-2204: Use global RPC clients (#194)
andreisilviudragnea Sep 15, 2023
704c683
Remove emulate-hash, trace-hash and trace-next-block (#196)
anton-lisanin Sep 18, 2023
720c77c
NDEV-2183: Implement get_sync_status for eth_syncing (#193)
Deniskore Sep 19, 2023
2e6aff9
NDEV-2081: Upgrade Solana to v1.16.13 (#179)
andreisilviudragnea Sep 19, 2023
7e2e5a8
NDEV-2183: Remove the semicolon in query_is_startup (#199)
Deniskore Sep 21, 2023
b572475
Ndev 2093 add comment with dapps report (#198)
kristinaNikolaevaa Sep 21, 2023
26f5af7
added new label for tests (#202)
kristinaNikolaevaa Sep 25, 2023
1e215f1
NDEV-2249: Upgrade Solana to v1.16.14 (#203)
andreisilviudragnea Sep 25, 2023
c9f4839
fix-ci (#204)
kristinaNikolaevaa Sep 25, 2023
3a053b7
NDEV-2222: Add build-info to neon-cli and neon-api (#200)
andreisilviudragnea Sep 26, 2023
abeacf1
NDEV-1396 Implement missing precompiled contracts (#197)
anton-lisanin Sep 26, 2023
ee270cc
NDEV-2043: Improve performance of neon-api crate (#158)
andreisilviudragnea Sep 27, 2023
2980cc3
NDEV-2222: Revert env!(NEON_REVISION) initialization (#206)
andreisilviudragnea Sep 27, 2023
08d9dd6
Fix bn256 precompile arguments (#205)
anton-lisanin Sep 27, 2023
da3e1cc
move tests from evm_loader folder (#207)
kristinaNikolaevaa Sep 28, 2023
ba57c4a
NDEV-2292: Upgrade Solana to v1.16.15 (#211)
andreisilviudragnea Oct 9, 2023
08e6923
NDEV-2252: Clean up tracer implementation (#208)
andreisilviudragnea Oct 10, 2023
f307479
NDEV-2312: Upgrade Solana to v1.16.16 (#216)
andreisilviudragnea Oct 12, 2023
dc09161
Add 'write version' to EmulateRequestModel (#212)
stanislav-tkach Oct 12, 2023
030f4dc
NDEV-2321: Upgrade Solana to v1.16.17 (#217)
andreisilviudragnea Oct 17, 2023
076ecf3
DOPS-420 workflow change for neonevm/neon-evm repository (#224)
vodolaz Oct 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Dockerfile
Dockerfile.*
.*.swp

.git
.github
.gitignore
.gitmodules
Expand Down
38 changes: 25 additions & 13 deletions .github/workflows/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@

DOCKER_USER = os.environ.get("DHUBU")
DOCKER_PASSWORD = os.environ.get("DHUBP")
IMAGE_NAME = 'neonlabsorg/evm_loader'
SOLANA_NODE_VERSION = 'v1.14.20'
SOLANA_BPF_VERSION = 'v1.14.20'
IMAGE_NAME = os.environ.get("IMAGE_NAME")
RUN_LINK_REPO = os.environ.get("RUN_LINK_REPO")
SOLANA_NODE_VERSION = 'v1.16.17'
SOLANA_BPF_VERSION = 'v1.16.17'

VERSION_BRANCH_TEMPLATE = r"[vt]{1}\d{1,2}\.\d{1,2}\.x.*"
docker_client = docker.APIClient()
Expand Down Expand Up @@ -105,7 +106,7 @@ def run_tests(github_sha):
project_name = f"neon-evm-{github_sha}"
stop_containers(project_name)

run_subprocess(f"docker-compose -p {project_name} -f ./evm_loader/docker-compose-ci.yml up -d")
run_subprocess(f"docker-compose -p {project_name} -f ./ci/docker-compose-ci.yml up -d")
container_name = get_solana_container_name(project_name)
click.echo("Start tests")
exec_id = docker_client.exec_create(
Expand All @@ -126,6 +127,9 @@ def run_tests(github_sha):
print("Part of tests are skipped")

exec_status = docker_client.exec_inspect(exec_id['Id'])["ExitCode"]

run_subprocess(f"docker-compose -p {project_name} -f ./ci/docker-compose-ci.yml logs dk-neon-api")

stop_containers(project_name)

if tests_are_failed or exec_status == 1:
Expand All @@ -134,7 +138,7 @@ def run_tests(github_sha):

def get_solana_container_name(project_name):
data = subprocess.run(
f"docker-compose -p {project_name} -f ./evm_loader/docker-compose-ci.yml ps",
f"docker-compose -p {project_name} -f ./ci/docker-compose-ci.yml ps",
shell=True, capture_output=True, text=True).stdout
click.echo(data)
pattern = rf'{project_name}_solana_[1-9]+'
Expand All @@ -144,7 +148,7 @@ def get_solana_container_name(project_name):


def stop_containers(project_name):
run_subprocess(f"docker-compose -p {project_name} -f ./evm_loader/docker-compose-ci.yml down")
run_subprocess(f"docker-compose -p {project_name} -f ./ci/docker-compose-ci.yml down")


@cli.command(name="trigger_proxy_action")
Expand All @@ -155,16 +159,22 @@ def stop_containers(project_name):
@click.option('--token')
@click.option('--is_draft')
@click.option('--labels')
def trigger_proxy_action(head_ref_branch, base_ref_branch, github_ref, github_sha, token, is_draft, labels):
@click.option('--pr_url')
@click.option('--pr_number')
def trigger_proxy_action(head_ref_branch, base_ref_branch, github_ref, github_sha, token, is_draft, labels,
pr_url, pr_number):
is_develop_branch = github_ref in ['refs/heads/develop', 'refs/heads/master']
is_tag_creating = 'refs/tags/' in github_ref
is_version_branch = re.match(VERSION_BRANCH_TEMPLATE, github_ref.replace("refs/heads/", "")) is not None
is_FTS_labeled_not_draft = 'FullTestSuit' in labels and is_draft != "true"
is_FTS_labeled_not_draft = 'fullTestSuit' in labels and is_draft != "true"
is_extended_FTS_labeled_not_draft = 'extendedFullTestSuit' in labels and is_draft != "true"

if is_develop_branch or is_tag_creating or is_version_branch or is_FTS_labeled_not_draft:
full_test_suite = "true"
if is_extended_FTS_labeled_not_draft:
test_set = "extendedFullTestSuite"
elif is_develop_branch or is_tag_creating or is_version_branch or is_FTS_labeled_not_draft:
test_set = "fullTestSuite"
else:
full_test_suite = "false"
test_set = "basic"

github = GithubClient(token)

Expand All @@ -181,14 +191,16 @@ def trigger_proxy_action(head_ref_branch, base_ref_branch, github_ref, github_sh
proxy_branch = 'develop'
click.echo(f"Proxy branch: {proxy_branch}")

initial_pr = f"{pr_url}/{pr_number}/comments" if pr_number else ""

runs_before = github.get_proxy_runs_list(proxy_branch)
runs_count_before = github.get_proxy_runs_count(proxy_branch)
github.run_proxy_dispatches(proxy_branch, github_ref, github_sha, full_test_suite)
github.run_proxy_dispatches(proxy_branch, github_ref, github_sha, test_set, initial_pr)
wait_condition(lambda: github.get_proxy_runs_count(proxy_branch) > runs_count_before)

runs_after = github.get_proxy_runs_list(proxy_branch)
proxy_run_id = list(set(runs_after) - set(runs_before))[0]
link = f"https://github.com/neonlabsorg/proxy-model.py/actions/runs/{proxy_run_id}"
link = f"https://github.com/{RUN_LINK_REPO}/actions/runs/{proxy_run_id}"
click.echo(f"Proxy run link: {link}")
click.echo("Waiting for completed status...")
wait_condition(lambda: github.get_proxy_run_info(proxy_run_id)["status"] == "completed", timeout_sec=10800, delay=5)
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/github_api_client.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import click
import requests
import os


class GithubClient():
PROXY_ENDPOINT = "https://api.github.com/repos/neonlabsorg/proxy-model.py"
PROXY_ENDPOINT = os.environ.get("PROXY_ENDPOINT")

def __init__(self, token):
self.headers = {"Authorization": f"Bearer {token}",
Expand All @@ -22,11 +23,12 @@ def get_proxy_runs_count(self, proxy_branch):
f"{self.PROXY_ENDPOINT}/actions/workflows/pipeline.yml/runs?branch={proxy_branch}", headers=self.headers)
return int(response.json()["total_count"])

def run_proxy_dispatches(self, proxy_branch, github_ref, github_sha, full_test_suite):
def run_proxy_dispatches(self, proxy_branch, github_ref, github_sha, test_set, initial_pr):
data = {"ref": proxy_branch,
"inputs": {"full_test_suite": full_test_suite,
"inputs": {"test_set": test_set,
"neon_evm_commit": github_sha,
"neon_evm_branch": github_ref}
"neon_evm_branch": github_ref,
"initial_pr": initial_pr}
}
response = requests.post(
f"{self.PROXY_ENDPOINT}/actions/workflows/pipeline.yml/dispatches", json=data, headers=self.headers)
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
env:
DHUBU: ${{secrets.DHUBU}}
DHUBP: ${{secrets.DHUBP}}
IMAGE_NAME: ${{vars.IMAGE_NAME}}
PROXY_ENDPOINT: ${{vars.PROXY_ENDPOINT}}
RUN_LINK_REPO: ${{vars.RUN_LINK_REPO}}
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

concurrency:
Expand Down Expand Up @@ -64,7 +67,9 @@ jobs:
--github_ref=${{ github.ref }} \
--token=${{secrets.GHTOKEN }} \
--is_draft=${{github.event.pull_request.draft}} \
--labels='${{ toJson(github.event.pull_request.labels.*.name) }}'
--labels='${{ toJson(github.event.pull_request.labels.*.name) }}' \
--pr_url="${{ github.api_url }}/repos/${{ github.repository }}/issues" \
--pr_number="${{ github.event.pull_request.number }}"
finalize-image:
runs-on: neon-evm-1
needs:
Expand Down
62 changes: 31 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
ARG SOLANA_IMAGE
# Install BPF SDK
FROM solanalabs/rust:1.64.0 AS builder
FROM solanalabs/rust:1.69.0 AS builder
RUN cargo install rustfilt
WORKDIR /opt
ARG SOLANA_BPF_VERSION
RUN sh -c "$(curl -sSfL https://release.solana.com/"${SOLANA_BPF_VERSION}"/install)" && \
/root/.local/share/solana/install/active_release/bin/sdk/bpf/scripts/install.sh
/root/.local/share/solana/install/active_release/bin/sdk/sbf/scripts/install.sh
ENV PATH=/root/.local/share/solana/install/active_release/bin:/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin


# Build evm_loader
FROM builder AS evm-loader-builder
COPY ./evm_loader/ /opt/evm_loader/
WORKDIR /opt/evm_loader
COPY . /opt/neon-evm/
WORKDIR /opt/neon-evm/evm_loader
ARG REVISION
ENV NEON_REVISION=${REVISION}
RUN cargo fmt --check && \
cargo clippy --release && \
cargo build --release && \
cargo build-sbf --arch bpf --features devnet && cp target/deploy/evm_loader.so target/deploy/evm_loader-devnet.so && \
cargo build-sbf --arch bpf --features testnet && cp target/deploy/evm_loader.so target/deploy/evm_loader-testnet.so && \
cargo build-sbf --arch bpf --features govertest && cp target/deploy/evm_loader.so target/deploy/evm_loader-govertest.so && \
cargo build-sbf --arch bpf --features govertest,emergency && cp target/deploy/evm_loader.so target/deploy/evm_loader-govertest-emergency.so && \
cargo build-sbf --arch bpf --features mainnet && cp target/deploy/evm_loader.so target/deploy/evm_loader-mainnet.so && \
cargo build-sbf --arch bpf --features mainnet,emergency && cp target/deploy/evm_loader.so target/deploy/evm_loader-mainnet-emergency.so && \
cargo build-sbf --arch bpf --features ci --dump
cargo build-bpf --features devnet && cp target/deploy/evm_loader.so target/deploy/evm_loader-devnet.so && \
cargo build-bpf --features testnet && cp target/deploy/evm_loader.so target/deploy/evm_loader-testnet.so && \
cargo build-bpf --features govertest && cp target/deploy/evm_loader.so target/deploy/evm_loader-govertest.so && \
cargo build-bpf --features govertest,emergency && cp target/deploy/evm_loader.so target/deploy/evm_loader-govertest-emergency.so && \
cargo build-bpf --features mainnet && cp target/deploy/evm_loader.so target/deploy/evm_loader-mainnet.so && \
cargo build-bpf --features mainnet,emergency && cp target/deploy/evm_loader.so target/deploy/evm_loader-mainnet-emergency.so && \
cargo build-bpf --features ci --dump

# Build Solidity contracts
FROM ethereum/solc:0.8.0 AS solc
FROM ubuntu:20.04 AS contracts
RUN apt-get update && \
DEBIAN_FRONTEND=nontineractive apt-get -y install xxd && \
rm -rf /var/lib/apt/lists/* /var/lib/apt/cache/*
COPY evm_loader/tests/contracts/*.sol /opt/
COPY evm_loader/solidity/*.sol /opt/
COPY tests/contracts/*.sol /opt/
COPY solidity/*.sol /opt/
#COPY evm_loader/tests/test_solidity_precompiles.json /opt/
COPY --from=solc /usr/bin/solc /usr/bin/solc
WORKDIR /opt/
Expand All @@ -51,10 +51,10 @@ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install vim less openssl ca-certificates curl python3 python3-pip parallel && \
rm -rf /var/lib/apt/lists/*

COPY evm_loader/tests/requirements.txt /tmp/
COPY tests/requirements.txt /tmp/
RUN pip3 install -r /tmp/requirements.txt

COPY /evm_loader/solidity/ /opt/contracts/contracts/
#COPY /evm_loader/solidity/ /opt/contracts/contracts/
WORKDIR /opt

COPY --from=solana \
Expand All @@ -73,26 +73,26 @@ RUN /opt/solana/bin/solana program dump metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518
COPY evm_loader/solana-run-neon.sh \
/opt/solana/bin/

COPY --from=evm-loader-builder /opt/evm_loader/target/deploy/evm_loader*.so /opt/
COPY --from=evm-loader-builder /opt/evm_loader/target/deploy/evm_loader-dump.txt /opt/
COPY --from=evm-loader-builder /opt/evm_loader/target/release/neon-cli /opt/
COPY --from=evm-loader-builder /opt/evm_loader/target/release/neon-api /opt/
COPY --from=evm-loader-builder /opt/neon-evm/evm_loader/target/deploy/evm_loader*.so /opt/
COPY --from=evm-loader-builder /opt/neon-evm/evm_loader/target/deploy/evm_loader-dump.txt /opt/
COPY --from=evm-loader-builder /opt/neon-evm/evm_loader/target/release/neon-cli /opt/
COPY --from=evm-loader-builder /opt/neon-evm/evm_loader/target/release/neon-api /opt/
COPY --from=solana /usr/bin/spl-token /opt/spl-token
COPY --from=contracts /opt/ /opt/solidity/
COPY --from=contracts /usr/bin/solc /usr/bin/solc
COPY evm_loader/wait-for-solana.sh \
evm_loader/wait-for-neon.sh \
evm_loader/deploy-evm.sh \
evm_loader/deploy-test.sh \
evm_loader/create-test-accounts.sh \
evm_loader/evm_loader-keypair.json \
COPY ci/wait-for-solana.sh \
ci/wait-for-neon.sh \
ci/deploy-evm.sh \
ci/deploy-test.sh \
ci/create-test-accounts.sh \
ci/evm_loader-keypair.json \
/opt/

COPY evm_loader/operator-keypairs/ /opt/operator-keypairs
COPY evm_loader/tests /opt/tests
COPY evm_loader/operator-keypairs/id.json /root/.config/solana/id.json
COPY evm_loader/operator-keypairs/id2.json /root/.config/solana/id2.json
COPY evm_loader/keys/ /opt/keys
COPY ci/operator-keypairs/ /opt/operator-keypairs
COPY tests /opt/tests
COPY ci/operator-keypairs/id.json /root/.config/solana/id.json
COPY ci/operator-keypairs/id2.json /root/.config/solana/id2.json
COPY ci/keys/ /opt/keys

ENV CONTRACTS_DIR=/opt/solidity/
#ENV CONTRACTS_DIR=/opt/solidity/
ENV PATH=/opt/solana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 6 additions & 7 deletions evm_loader/docker-compose-ci.yml → ci/docker-compose-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ services:
- SOLANA_URL=http://solana:8899
hostname: solana
ports:
- 8899
- "8899"
expose:
- "8899"
ulimits:
nofile:
soft: 1048576
hard: 1048576
entrypoint:
/opt/solana/bin/solana-run-neon.sh
networks:
Expand All @@ -30,16 +34,11 @@ services:
NEON_CHAIN_ID: 111
COMMITMENT: confirmed
NEON_DB_CLICKHOUSE_URLS: "http://45.250.253.36:8123;http://45.250.253.38:8123"
NEON_DB_INDEXER_HOST: 45.250.253.32
NEON_DB_INDEXER_PORT: 5432
NEON_DB_INDEXER_DATABASE: indexer
NEON_DB_INDEXER_USER: postgres
NEON_DB_INDEXER_PASSWORD: ""
KEYPAIR: /opt/operator-keypairs/id.json
FEEPAIR: /opt/operator-keypairs/id.json
image: ${EVM_LOADER_IMAGE}
ports:
- 8085
- "8085"
networks:
- net

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading