Skip to content

Commit

Permalink
⚡️ Review rpc networks failsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
KONFeature committed Jan 7, 2025
1 parent d02b4f5 commit e1b8fc2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions packages/erpc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
FROM oven/bun:latest AS bundler

# Clean up and create directory with proper permissions
RUN rm -rf /tmp/dev || true && mkdir -p /tmp/dev
RUN rm -rf /temp/dev || true && mkdir -p /temp/dev

# Bundle everything in a single erpc.js file
COPY . /tmp/dev
RUN cd /tmp/dev && bun install --production
RUN cd /tmp/dev && bun build --outfile ./erpc.js --minify --target node --external "@erpc-cloud/*" src/index.ts
COPY . /temp/dev
RUN cd /temp/dev && bun install --production
RUN cd /temp/dev && bun build --outfile ./erpc.js --minify --target node --external "@erpc-cloud/*" src/index.ts

# Final image
#FROM erpc-dev AS final
Expand All @@ -17,7 +17,7 @@ FROM ghcr.io/erpc/erpc@sha256:896792cfeb49093d1d922649962a587d00a963adb7de0cff67
RUN apt-get update && apt-get install -y curl

# Copy the bundled config
COPY --from=bundler ./tmp/dev/erpc.js /root/erpc.js
COPY --from=bundler ./temp/dev/erpc.js /root/erpc.js

# Run the server
CMD ["./erpc-server"]
10 changes: 5 additions & 5 deletions packages/erpc/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type { FailsafeConfig, NetworkConfig } from "@erpc-cloud/config";

const defaultFailsafe: FailsafeConfig = {
retry: {
maxAttempts: 5,
delay: "500ms",
backoffMaxDelay: "10s",
maxAttempts: 2,
delay: "100ms",
backoffMaxDelay: "2s",
backoffFactor: 0.5,
jitter: "200ms",
},
Expand All @@ -19,7 +19,7 @@ export const arbNetwork = {
failsafe: {
...defaultFailsafe,
timeout: {
duration: "30s",
duration: "5s",
},
},
evm: {
Expand All @@ -32,7 +32,7 @@ export const arbSepoliaNetwork = {
failsafe: {
...defaultFailsafe,
timeout: {
duration: "60s",
duration: "10s",
},
},
evm: {
Expand Down
4 changes: 2 additions & 2 deletions packages/erpc/src/rateLimits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ export const alchemyRateRules: RuleExport = [
genericRateLimitsRules(200),
{
method: "eth_getLogs",
maxCount: 30,
maxCount: 20,
period: "1s",
waitTime: "10s",
},
{
method: "eth_getBlockByNumber",
maxCount: 60,
maxCount: 30,
period: "1s",
waitTime: "10s",
},
Expand Down

0 comments on commit e1b8fc2

Please sign in to comment.