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

debug_traceTransaction rpc failed for v5.41.0 astar mainnet #1293

Closed
wafeishushu opened this issue Jul 11, 2024 · 1 comment
Closed

debug_traceTransaction rpc failed for v5.41.0 astar mainnet #1293

wafeishushu opened this issue Jul 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@wafeishushu
Copy link

wafeishushu commented Jul 11, 2024

I want to run a tracing node for astar mainnet. I also encountered the Runtime api version call failed (trace) error like #905

dockerfile:

FROM ubuntu:22.04 as rust-builder

ENV CARGO_HOME="/cargo-home"
ENV PATH="/cargo-home/bin:$PATH"
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update -y && \
    apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
    apt-get clean && \
    rm -r /var/lib/apt/lists/*

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y

# RUN rustup toolchain uninstall $(rustup toolchain list) && \
#     rustup toolchain install {{ RUST_TOOLCHAIN }} && \
#     rustup default {{ RUST_TOOLCHAIN }} && \
#     rustup target list --installed && \
#     rustup show
RUN rustup default stable && rustup update && rustup target add wasm32-unknown-unknown && rustup show

RUN mkdir /data
WORKDIR /data

FROM rust-builder as builder-astar-bin

WORKDIR /data

COPY . .
RUN cargo build --release --features evm-tracing

FROM ubuntu:22.04 AS wasm-builder

RUN apt-get update && apt-get install -y wget ca-certificates git && update-ca-certificates
RUN wget https://github.com/AstarNetwork/Astar/releases/download/v5.41.0/evm-tracing-artifacts-v5.41.0.tar.gz && \
    tar -zxvf evm-tracing-artifacts-v5.41.0.tar.gz && cd evm-tracing-artifacts && \
    mkdir -p /wasm/evm-tracing && cp astar-90_evm_tracing_runtime.compact.compressed.wasm /wasm/evm-tracing


FROM debian:bookworm-slim

RUN useradd -m -u 1000 -U -s /bin/sh -d /astar astar && \
    mkdir -p /astar/.local/share && \
    mkdir /data && \
    chown -R astar:astar /data && \
    ln -s /data /astar/.local/share/astar && \
    rm -rf /usr/sbin

COPY --from=wasm-builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

USER astar

COPY --from=builder-astar-bin --chown=astar /data/target/release/astar-collator /astar/astar-collator
COPY --from=wasm-builder --chown=astar /wasm/evm-tracing /astar/wasm
RUN chmod uog+x /astar/astar-collator

# 30333 for parachain p2p
# 30334 for relaychain p2p
# 9933 for RPC call
# 9944 for Websocket
# 9615 for Prometheus (metrics)
EXPOSE 30333 30334 9933 9944 9615

VOLUME ["/data"]

ENTRYPOINT ["/astar/astar-collator"]

here is my docker command:

docker run -d \
--name astar-node \
-u $(id -u astar):$(id -g astar) \
-p 30333:30333 \
-p 30334:30334 \
-p 9944:9944 \
-p 8876:9933 \
-v "/data/docker/astar/:/data" \
astar:v5.41.0 \
--chain astar \
--rpc-cors all \
--name astar-node \
--base-path /data \
--unsafe-rpc-external \
--rpc-port 9933 \
--rpc-max-request-size 10 \
--rpc-max-response-size 50 \
--ethapi=txpool,debug,trace \
--enable-evm-rpc \
--runtime-cache-size 64 \
--wasm-runtime-overrides /data/wasm \
--telemetry-url 'wss://telemetry.polkadot.io/submit/ 0' \
-- \
--sync warp

When I run debug_traceTransaction, it returns the following:

{"jsonrpc":"2.0","error":{"code":-32603,"message":"Runtime api version call failed (trace)"},"id":1}

i used astar-90_evm_tracing_runtime.compact.compressed.wasm wasm file to override.
could you pls help me check this? thanks!

@wafeishushu wafeishushu added the bug Something isn't working label Jul 11, 2024
@Dinonard
Copy link
Member

If you only have astar-90_evm_tracing_runtime.compact.compressed.wasm, it will only work for transactions which were submitted since the astar-90 upgrade.
If you're tracing an older transaction, you need to have runtime appropriate for that block.

Ideally, your /data/wasm folder would contain all of the astar wasm blobs with tracing API enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants