diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index fa47c439a..d8b847725 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -10,6 +10,8 @@ on: # - "src/**/*.js" # - "src/**/*.jsx" +permissions: {} + jobs: claude-review: if: github.event.pull_request.head.repo.full_name == github.repository @@ -60,6 +62,7 @@ jobs: uses: anthropics/claude-code-action@2cc1ac1331eac7a6a96d716dd204dd2888d0fcd2 # v1 with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + allowed_bots: 'prd-carapulse' claude_args: "--model claude-opus-4-6" plugin_marketplaces: 'https://github.com/anthropics/claude-code.git' plugins: 'code-review@claude-code-plugins' diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 247055ee2..4f05ea0b2 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -10,6 +10,8 @@ on: pull_request_review: types: [submitted] +permissions: {} + jobs: claude: if: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee7417b74..63bf17af1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,12 @@ concurrency: group: ${{ github.workflow }} cancel-in-progress: true +env: + AWS_REGION: ${{ vars.AWS_REGION }} + AWS_ROLE_ARN: ${{ vars.AWS_ROLE_ARN }} + ECR_REPOSITORY: ${{ vars.ECR_REPOSITORY }} + ECR_VALIDATOR_REPOSITORY: ${{ vars.ECR_VALIDATOR_REPOSITORY }} + on: workflow_dispatch: inputs: @@ -14,7 +20,7 @@ on: branches: - morpho-main -permissions: read-all +permissions: {} jobs: # Create Release PR - only on workflow_dispatch @@ -25,9 +31,9 @@ jobs: runs-on: "${{ github.repository_owner == 'erpc' && 'blacksmith-8vcpu-ubuntu-2404' || 'ubuntu-24.04' }}" if: github.event_name == 'workflow_dispatch' outputs: - version: ${{ steps.validate-version.outputs.version }} + version: ${{ steps.validate-version.outputs.version_tag }} steps: - - name: Validate version_tag + - name: Validate version tag id: validate-version shell: bash env: @@ -40,7 +46,7 @@ jobs: exit 1 fi - printf 'version=%s\n' "$VERSION_TAG" >> "$GITHUB_OUTPUT" + printf 'version_tag=%s\n' "$VERSION_TAG" >> "$GITHUB_OUTPUT" - name: Harden the runner (Audit all outbound calls) uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 @@ -58,7 +64,7 @@ jobs: - name: Generate types run: | - go install github.com/gzuidhof/tygo@latest + go install github.com/gzuidhof/tygo@v0.2.21 tygo generate - name: Setup Syft @@ -72,7 +78,7 @@ jobs: version: "~> v2" args: release --snapshot --clean env: - GORELEASER_CURRENT_TAG: ${{ steps.validate-version.outputs.version }} + GORELEASER_CURRENT_TAG: ${{ steps.validate-version.outputs.version_tag }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Setup pnpm + node and install dependencies @@ -99,7 +105,7 @@ jobs: # Update version in package.json files - name: Update package versions env: - VERSION_TAG: ${{ steps.validate-version.outputs.version }} + VERSION_TAG: ${{ steps.validate-version.outputs.version_tag }} run: | for pkg in . typescript/cli typescript/config; do cd "$pkg" @@ -111,9 +117,9 @@ jobs: - name: Generate CLI release files working-directory: typescript/cli env: - CHECKSUMS_FILE: ../../dist/checksums.txt + VERSION_TAG: ${{ steps.validate-version.outputs.version_tag }} COMMIT_SHA: ${{ github.sha }} - VERSION_TAG: ${{ steps.validate-version.outputs.version }} + CHECKSUMS_FILE: ../../dist/checksums.txt run: | export VERSION="$VERSION_TAG" export COMMIT_SHA @@ -127,21 +133,43 @@ jobs: # Create PR with all changes - name: Create Pull Request - uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11 - with: - commit-message: "chore: release ${{ steps.validate-version.outputs.version }}" - title: "chore: release ${{ steps.validate-version.outputs.version }}" - body: | - 🚀 Release preparation for version ${{ steps.validate-version.outputs.version }} - - This PR includes: - - Version bumps in package.json files - - Generated TypeScript types - - Generated release files - - Generated checksums - branch: "release/${{ steps.validate-version.outputs.version }}" - base: morpho-main - labels: release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION_TAG: ${{ steps.validate-version.outputs.version_tag }} + run: | + set -euo pipefail + BRANCH="release/${VERSION_TAG}" + TITLE="chore: release ${VERSION_TAG}" + BODY_FILE="$(mktemp)" + + git config user.name github-actions + git config user.email github-actions@github.com + git checkout -B "$BRANCH" + + if [ -z "$(git status --porcelain)" ]; then + echo "No release changes to commit" + exit 0 + fi + + git add . + git commit -m "$TITLE" + git push --force-with-lease origin "$BRANCH" + + cat > "$BODY_FILE" </dev/null 2>&1; then + gh pr edit "$BRANCH" --repo "$GITHUB_REPOSITORY" --title "$TITLE" --body-file "$BODY_FILE" --add-label release + else + gh pr create --repo "$GITHUB_REPOSITORY" --base morpho-main --head "$BRANCH" --title "$TITLE" --body-file "$BODY_FILE" --label release + fi # Run on release PR merge release: @@ -279,14 +307,17 @@ jobs: attestations: write id-token: write runs-on: "${{ github.repository_owner == 'erpc' && 'blacksmith-8vcpu-ubuntu-2404' || 'ubuntu-24.04' }}" - needs: [prepare-release, release] - if: always() && github.ref == 'refs/heads/morpho-main' + if: github.event_name == 'push' && github.ref == 'refs/heads/morpho-main' timeout-minutes: 35 outputs: digest_main: ${{ steps.build_main.outputs.digest }} digest_release: ${{ steps.build_release.outputs.digest }} digest_main_validator: ${{ steps.build_main_validator.outputs.digest }} digest_release_validator: ${{ steps.build_release_validator.outputs.digest }} + digest_main_ecr: ${{ steps.build_main_ecr.outputs.digest }} + digest_release_ecr: ${{ steps.build_release_ecr.outputs.digest }} + digest_main_validator_ecr: ${{ steps.build_main_validator_ecr.outputs.digest }} + digest_release_validator_ecr: ${{ steps.build_release_validator_ecr.outputs.digest }} steps: - name: Harden the runner (Audit all outbound calls) uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 @@ -304,12 +335,17 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Setup Blacksmith Builder - if: github.repository_owner == 'erpc' - uses: useblacksmith/setup-docker-builder@ef12d5b165b596e3aa44ea8198d8fde563eab402 # v1.4.0 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4 + with: + role-to-assume: ${{ env.AWS_ROLE_ARN }} + aws-region: ${{ env.AWS_REGION }} + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@376925c9d111252e87ae59691e5a442dd100ef6a # v2 - name: Set up Docker Buildx - if: github.repository_owner != 'erpc' uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 - name: Compute repo and short SHA @@ -341,6 +377,19 @@ jobs: sbom: false # not supported on docker driver, maybe works with blacksmith? outputs: type=registry,name=ghcr.io/${{ steps.meta.outputs.repo }},push-by-digest=true + - name: Build+push to ECR by digest (branch) + id: build_main_ecr + if: github.event.inputs.version_tag == '' + uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2 + with: + context: . + platforms: linux/amd64 + build-args: | + VERSION=${{ github.ref_name }} + COMMIT_SHA=${{ steps.meta.outputs.short_sha }} + sbom: false # not supported on docker driver, maybe works with blacksmith? + outputs: type=registry,name=${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }},push-by-digest=true + - name: Build+push by digest (release) id: build_release if: "contains(github.event.head_commit.message, 'chore: release')" @@ -354,6 +403,19 @@ jobs: sbom: false # not supported on docker driver, maybe works with blacksmith? outputs: type=registry,name=ghcr.io/${{ steps.meta.outputs.repo }},push-by-digest=true + - name: Build+push to ECR by digest (release) + id: build_release_ecr + if: "contains(github.event.head_commit.message, 'chore: release')" + uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2 + with: + context: . + platforms: linux/amd64 + build-args: | + VERSION=${{ steps.version.outputs.VERSION }} + COMMIT_SHA=${{ steps.meta.outputs.short_sha }} + sbom: false # not supported on docker driver, maybe works with blacksmith? + outputs: type=registry,name=${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }},push-by-digest=true + - name: Build+push validator by digest (branch) id: build_main_validator if: github.event.inputs.version_tag == '' @@ -368,6 +430,20 @@ jobs: sbom: false # not supported on docker driver, maybe works with blacksmith? outputs: type=registry,name=ghcr.io/${{ steps.meta.outputs.repo }}-validator,push-by-digest=true + - name: Build+push validator to ECR by digest (branch) + id: build_main_validator_ecr + if: github.event.inputs.version_tag == '' + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 + with: + context: . + file: Dockerfile.validator + platforms: linux/amd64 + build-args: | + VERSION=${{ github.ref_name }} + COMMIT_SHA=${{ steps.meta.outputs.short_sha }} + sbom: false # not supported on docker driver, maybe works with blacksmith? + outputs: type=registry,name=${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_VALIDATOR_REPOSITORY }},push-by-digest=true + - name: Build+push validator by digest (release) id: build_release_validator if: "contains(github.event.head_commit.message, 'chore: release')" @@ -382,6 +458,20 @@ jobs: sbom: false # not supported on docker driver, maybe works with blacksmith? outputs: type=registry,name=ghcr.io/${{ steps.meta.outputs.repo }}-validator,push-by-digest=true + - name: Build+push validator to ECR by digest (release) + id: build_release_validator_ecr + if: "contains(github.event.head_commit.message, 'chore: release')" + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 + with: + context: . + file: Dockerfile.validator + platforms: linux/amd64 + build-args: | + VERSION=${{ steps.version.outputs.VERSION }} + COMMIT_SHA=${{ steps.meta.outputs.short_sha }} + sbom: false # not supported on docker driver, maybe works with blacksmith? + outputs: type=registry,name=${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_VALIDATOR_REPOSITORY }},push-by-digest=true + - name: Attest build provenance (Docker Build) uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0 if: steps.build_release.outputs.digest != '' || steps.build_main.outputs.digest != '' @@ -405,14 +495,17 @@ jobs: attestations: write id-token: write runs-on: "${{ github.repository_owner == 'erpc' && 'blacksmith-8vcpu-ubuntu-2404-arm' || 'ubuntu-24.04-arm' }}" - needs: [prepare-release, release] - if: always() && github.ref == 'refs/heads/morpho-main' + if: github.event_name == 'push' && github.ref == 'refs/heads/morpho-main' timeout-minutes: 35 outputs: digest_main: ${{ steps.build_main.outputs.digest }} digest_release: ${{ steps.build_release.outputs.digest }} digest_main_validator: ${{ steps.build_main_validator.outputs.digest }} digest_release_validator: ${{ steps.build_release_validator.outputs.digest }} + digest_main_ecr: ${{ steps.build_main_ecr.outputs.digest }} + digest_release_ecr: ${{ steps.build_release_ecr.outputs.digest }} + digest_main_validator_ecr: ${{ steps.build_main_validator_ecr.outputs.digest }} + digest_release_validator_ecr: ${{ steps.build_release_validator_ecr.outputs.digest }} steps: - name: Harden the runner (Audit all outbound calls) uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 @@ -430,12 +523,17 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Setup Blacksmith Builder - if: github.repository_owner == 'erpc' - uses: useblacksmith/setup-docker-builder@ef12d5b165b596e3aa44ea8198d8fde563eab402 # v1.4.0 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4 + with: + role-to-assume: ${{ env.AWS_ROLE_ARN }} + aws-region: ${{ env.AWS_REGION }} + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@376925c9d111252e87ae59691e5a442dd100ef6a # v2 - name: Set up Docker Buildx - if: github.repository_owner != 'erpc' uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 - name: Compute repo and short SHA @@ -467,6 +565,19 @@ jobs: sbom: false # not supported on docker driver, maybe works with blacksmith? outputs: type=registry,name=ghcr.io/${{ steps.meta.outputs.repo }},push-by-digest=true + - name: Build+push to ECR by digest (branch) + id: build_main_ecr + if: github.event.inputs.version_tag == '' + uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2 + with: + context: . + platforms: linux/arm64 + build-args: | + VERSION=${{ github.ref_name }} + COMMIT_SHA=${{ steps.meta.outputs.short_sha }} + sbom: false # not supported on docker driver, maybe works with blacksmith? + outputs: type=registry,name=${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }},push-by-digest=true + - name: Build+push by digest (release) id: build_release if: "contains(github.event.head_commit.message, 'chore: release')" @@ -480,6 +591,19 @@ jobs: sbom: false # not supported on docker driver, maybe works with blacksmith? outputs: type=registry,name=ghcr.io/${{ steps.meta.outputs.repo }},push-by-digest=true + - name: Build+push to ECR by digest (release) + id: build_release_ecr + if: "contains(github.event.head_commit.message, 'chore: release')" + uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2 + with: + context: . + platforms: linux/arm64 + build-args: | + VERSION=${{ steps.version.outputs.VERSION }} + COMMIT_SHA=${{ steps.meta.outputs.short_sha }} + sbom: false # not supported on docker driver, maybe works with blacksmith? + outputs: type=registry,name=${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }},push-by-digest=true + - name: Build+push validator by digest (branch) id: build_main_validator if: github.event.inputs.version_tag == '' @@ -494,6 +618,20 @@ jobs: sbom: false # not supported on docker driver, maybe works with blacksmith? outputs: type=registry,name=ghcr.io/${{ steps.meta.outputs.repo }}-validator,push-by-digest=true + - name: Build+push validator to ECR by digest (branch) + id: build_main_validator_ecr + if: github.event.inputs.version_tag == '' + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 + with: + context: . + file: Dockerfile.validator + platforms: linux/arm64 + build-args: | + VERSION=${{ github.ref_name }} + COMMIT_SHA=${{ steps.meta.outputs.short_sha }} + sbom: false # not supported on docker driver, maybe works with blacksmith? + outputs: type=registry,name=${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_VALIDATOR_REPOSITORY }},push-by-digest=true + - name: Build+push validator by digest (release) id: build_release_validator if: "contains(github.event.head_commit.message, 'chore: release')" @@ -507,6 +645,20 @@ jobs: COMMIT_SHA=${{ steps.meta.outputs.short_sha }} sbom: false # not supported on docker driver, maybe works with blacksmith? outputs: type=registry,name=ghcr.io/${{ steps.meta.outputs.repo }}-validator,push-by-digest=true + + - name: Build+push validator to ECR by digest (release) + id: build_release_validator_ecr + if: "contains(github.event.head_commit.message, 'chore: release')" + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 + with: + context: . + file: Dockerfile.validator + platforms: linux/arm64 + build-args: | + VERSION=${{ steps.version.outputs.VERSION }} + COMMIT_SHA=${{ steps.meta.outputs.short_sha }} + sbom: false # not supported on docker driver, maybe works with blacksmith? + outputs: type=registry,name=${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_VALIDATOR_REPOSITORY }},push-by-digest=true - name: Attest build provenance (Docker Build) uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0 @@ -532,7 +684,7 @@ jobs: id-token: write runs-on: "${{ github.repository_owner == 'erpc' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-24.04' }}" needs: [docker-build-amd64, docker-build-arm64] - if: always() && github.ref == 'refs/heads/morpho-main' + if: always() && github.event_name == 'push' && github.ref == 'refs/heads/morpho-main' steps: - name: Harden the runner (Audit all outbound calls) uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 @@ -546,6 +698,16 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4 + with: + role-to-assume: ${{ env.AWS_ROLE_ARN }} + aws-region: ${{ env.AWS_REGION }} + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@376925c9d111252e87ae59691e5a442dd100ef6a # v2 + - name: Compute repo id: meta run: | @@ -582,6 +744,21 @@ jobs: echo "digest_main=${DIGEST_MAIN#*@}" >> "$GITHUB_OUTPUT" echo "digest_main_validator=${DIGEST_MAIN_VALIDATOR#*@}" >> "$GITHUB_OUTPUT" + - name: Create ECR multi-arch manifest for branch + if: github.event.inputs.version_tag == '' + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + run: | + docker buildx imagetools create \ + -t "$ECR_REGISTRY/${{ env.ECR_REPOSITORY }}:${{ github.sha }}" \ + "$ECR_REGISTRY/${{ env.ECR_REPOSITORY }}@${{ needs.docker-build-amd64.outputs.digest_main_ecr }}" \ + "$ECR_REGISTRY/${{ env.ECR_REPOSITORY }}@${{ needs.docker-build-arm64.outputs.digest_main_ecr }}" + + docker buildx imagetools create \ + -t "$ECR_REGISTRY/${{ env.ECR_VALIDATOR_REPOSITORY }}:${{ github.sha }}" \ + "$ECR_REGISTRY/${{ env.ECR_VALIDATOR_REPOSITORY }}@${{ needs.docker-build-amd64.outputs.digest_main_validator_ecr }}" \ + "$ECR_REGISTRY/${{ env.ECR_VALIDATOR_REPOSITORY }}@${{ needs.docker-build-arm64.outputs.digest_main_validator_ecr }}" + - name: Create multi-arch manifests for release id: release if: "contains(github.event.head_commit.message, 'chore: release')" @@ -621,6 +798,21 @@ jobs: echo "digest_latest_validator=${DIGEST_LATEST_VALIDATOR#*@}" } >> "$GITHUB_OUTPUT" + - name: Create ECR multi-arch manifests for release + if: "contains(github.event.head_commit.message, 'chore: release')" + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + run: | + docker buildx imagetools create \ + -t "$ECR_REGISTRY/${{ env.ECR_REPOSITORY }}:${{ steps.version.outputs.VERSION }}" \ + "$ECR_REGISTRY/${{ env.ECR_REPOSITORY }}@${{ needs.docker-build-amd64.outputs.digest_release_ecr }}" \ + "$ECR_REGISTRY/${{ env.ECR_REPOSITORY }}@${{ needs.docker-build-arm64.outputs.digest_release_ecr }}" + + docker buildx imagetools create \ + -t "$ECR_REGISTRY/${{ env.ECR_VALIDATOR_REPOSITORY }}:${{ steps.version.outputs.VERSION }}" \ + "$ECR_REGISTRY/${{ env.ECR_VALIDATOR_REPOSITORY }}@${{ needs.docker-build-amd64.outputs.digest_release_validator_ecr }}" \ + "$ECR_REGISTRY/${{ env.ECR_VALIDATOR_REPOSITORY }}@${{ needs.docker-build-arm64.outputs.digest_release_validator_ecr }}" + - name: Attest build provenance (Docker Manifest Main) uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0 if: github.event.inputs.version_tag == '' @@ -676,7 +868,7 @@ jobs: packages: write runs-on: "${{ github.repository_owner == 'erpc' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-24.04' }}" needs: [docker-manifest] - if: always() && github.ref == 'refs/heads/morpho-main' + if: always() && github.event_name == 'push' && github.ref == 'refs/heads/morpho-main' steps: - name: Harden the runner (Audit all outbound calls) uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 08dfff21c..79e2c6de2 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -14,8 +14,7 @@ on: push: branches: ["main"] -# Declare default permissions as read only. -permissions: read-all +permissions: {} jobs: analysis: diff --git a/architecture/evm/eth_call.go b/architecture/evm/eth_call.go index d155bb0b7..1551fb942 100644 --- a/architecture/evm/eth_call.go +++ b/architecture/evm/eth_call.go @@ -89,6 +89,13 @@ func projectPreForward_eth_call(ctx context.Context, network common.Network, nq return false, nil, nil } + // Diagnostic mode: skip eth_call-specific pre-forward (multicall3 batching, + // param normalization, cache pre-check) so the request reaches Network.Forward + // unwrapped and each upstream is probed with the original payload. + if nq.ShouldCheckAllUpstreams() { + return false, nil, nil + } + // Normalize params: ensure block param is present jrq.RLock() paramsLen := len(jrq.Params) diff --git a/common/postgresql_identifier.go b/common/postgresql_identifier.go new file mode 100644 index 000000000..e6e64c51d --- /dev/null +++ b/common/postgresql_identifier.go @@ -0,0 +1,44 @@ +package common + +import ( + "fmt" + "strings" + "unicode" +) + +// ValidatePostgreSQLTableIdentifier rejects table identifiers that cannot be +// safely interpolated after pgx identifier quoting. +func ValidatePostgreSQLTableIdentifier(name string) error { + _, err := PostgreSQLTableIdentifierParts(name) + return err +} + +// PostgreSQLTableIdentifierParts returns one table component or schema/table +// components after validating each component as an unquoted PostgreSQL identifier. +func PostgreSQLTableIdentifierParts(name string) ([]string, error) { + parts := strings.Split(name, ".") + if len(parts) > 2 { + return nil, fmt.Errorf("postgres table identifier %q: too many qualifying parts", name) + } + for _, part := range parts { + if !isPostgreSQLIdentifierComponent(part) { + return nil, fmt.Errorf("postgres table identifier %q: invalid component %q", name, part) + } + } + return parts, nil +} + +func isPostgreSQLIdentifierComponent(name string) bool { + for i, r := range name { + if i == 0 { + if r != '_' && !unicode.IsLetter(r) { + return false + } + continue + } + if r != '_' && r != '$' && !unicode.IsLetter(r) && !unicode.IsDigit(r) { + return false + } + } + return name != "" +} diff --git a/common/postgresql_identifier_test.go b/common/postgresql_identifier_test.go new file mode 100644 index 000000000..35e768f58 --- /dev/null +++ b/common/postgresql_identifier_test.go @@ -0,0 +1,54 @@ +package common + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" +) + +func TestPostgreSQLConnectorConfigValidateTableIdentifier(t *testing.T) { + baseConfig := func(table string) *PostgreSQLConnectorConfig { + return &PostgreSQLConnectorConfig{ + Table: table, + ConnectionUri: "postgres://user:pass@localhost/db?sslmode=disable", + InitTimeout: Duration(time.Second), + GetTimeout: Duration(time.Second), + SetTimeout: Duration(time.Second), + MinConns: 1, + MaxConns: 2, + } + } + + for _, table := range []string{ + "erpc_json_rpc_cache", + "myschema.cache", + "_schema.table_1", + "CamelCase", + "schema.cache$2026", + "\u00e9rpc_cache", + } { + t.Run("valid_"+table, func(t *testing.T) { + require.NoError(t, baseConfig(table).Validate()) + }) + } + + for _, table := range []string{ + "; DROP TABLE foo; --", + "schema.table.extra", + "bad-name", + "1table", + ".table", + "schema.", + "schema.*", + "$table", + "schema.$cache", + "table name", + } { + t.Run("invalid_"+table, func(t *testing.T) { + err := baseConfig(table).Validate() + require.Error(t, err) + require.ErrorContains(t, err, "database.*.connector.postgresql.table is invalid") + }) + } +} diff --git a/common/request.go b/common/request.go index 7f362c075..9e79d04a6 100644 --- a/common/request.go +++ b/common/request.go @@ -44,6 +44,7 @@ const ( headerDirectiveSkipCacheRead = "X-ERPC-Skip-Cache-Read" headerDirectiveCacheMaxAge = "X-ERPC-Cache-Max-Age" headerDirectiveUseUpstream = "X-ERPC-Use-Upstream" + headerDirectiveCheckAllUpstreams = "X-ERPC-Check-All-Upstreams" headerDirectiveSkipInterpolation = "X-ERPC-Skip-Interpolation" headerDirectiveEnforceHighestBlock = "X-ERPC-Enforce-Highest-Block" headerDirectiveEnforceGetLogsRange = "X-ERPC-Enforce-GetLogs-Range" @@ -70,6 +71,7 @@ const ( queryDirectiveSkipCacheRead = "skip-cache-read" queryDirectiveCacheMaxAge = "cache-max-age" queryDirectiveUseUpstream = "use-upstream" + queryDirectiveCheckAllUpstreams = "check-all-upstreams" queryDirectiveSkipInterpolation = "skip-interpolation" queryDirectiveEnforceHighestBlock = "enforce-highest-block" queryDirectiveEnforceGetLogsRange = "enforce-getlogs-range" @@ -96,6 +98,7 @@ var directiveKeyRegistry = []directiveKeyNames{ {header: headerDirectiveSkipCacheRead, query: queryDirectiveSkipCacheRead}, {header: headerDirectiveCacheMaxAge, query: queryDirectiveCacheMaxAge}, {header: headerDirectiveUseUpstream, query: queryDirectiveUseUpstream}, + {header: headerDirectiveCheckAllUpstreams, query: queryDirectiveCheckAllUpstreams}, {header: headerDirectiveSkipInterpolation, query: queryDirectiveSkipInterpolation}, {header: headerDirectiveEnforceHighestBlock, query: queryDirectiveEnforceHighestBlock}, {header: headerDirectiveEnforceGetLogsRange, query: queryDirectiveEnforceGetLogsRange}, @@ -151,6 +154,16 @@ type RequestDirectives struct { // For example "alchemy" or "my-own-*", etc. UseUpstream string `json:"useUpstream,omitempty"` + // CheckAllUpstreams instructs the network to execute this request against + // every selected upstream and return a diagnostic result instead of the + // first usable upstream response. It is intended for probing provider-specific + // limits such as calldata, returndata, and gas limits. + // + // Setting this also bypasses request multiplexing and cache reads/writes + // for the originating request, and disables eth_call multicall3 batching, + // so each upstream is probed with the original payload. + CheckAllUpstreams bool `json:"checkAllUpstreams,omitempty"` + // Instruct the proxy to bypass method exclusion checks. ByPassMethodExclusion bool `json:"-"` @@ -247,6 +260,7 @@ func (d *RequestDirectives) Clone() *RequestDirectives { SkipCacheRead: d.SkipCacheRead, CacheMaxAgeSeconds: nil, UseUpstream: d.UseUpstream, + CheckAllUpstreams: d.CheckAllUpstreams, ByPassMethodExclusion: d.ByPassMethodExclusion, SkipInterpolation: d.SkipInterpolation, EnforceHighestBlock: d.EnforceHighestBlock, @@ -733,6 +747,9 @@ func (r *NormalizedRequest) EnrichFromHttp(headers http.Header, queryArgs url.Va if hv := headers.Get(headerDirectiveUseUpstream); hv != "" { r.directives.UseUpstream = hv } + if hv := headers.Get(headerDirectiveCheckAllUpstreams); hv != "" { + r.directives.CheckAllUpstreams = strings.ToLower(strings.TrimSpace(hv)) == "true" + } if hv := headers.Get(headerDirectiveSkipInterpolation); hv != "" { r.directives.SkipInterpolation = strings.ToLower(strings.TrimSpace(hv)) == "true" } @@ -801,6 +818,9 @@ func (r *NormalizedRequest) EnrichFromHttp(headers http.Header, queryArgs url.Va if useUpstream := queryArgs.Get(queryDirectiveUseUpstream); useUpstream != "" { r.directives.UseUpstream = strings.TrimSpace(useUpstream) } + if checkAllUpstreams := queryArgs.Get(queryDirectiveCheckAllUpstreams); checkAllUpstreams != "" { + r.directives.CheckAllUpstreams = strings.ToLower(strings.TrimSpace(checkAllUpstreams)) == "true" + } if retryEmpty := queryArgs.Get(queryDirectiveRetryEmpty); retryEmpty != "" { r.directives.RetryEmpty = strings.ToLower(strings.TrimSpace(retryEmpty)) == "true" @@ -924,6 +944,13 @@ func (r *NormalizedRequest) CacheMaxAgeExplicit() bool { return r.directives.CacheMaxAgeExplicit } +func (r *NormalizedRequest) ShouldCheckAllUpstreams() bool { + if r == nil || r.directives == nil { + return false + } + return r.directives.CheckAllUpstreams +} + func (r *NormalizedRequest) Directives() *RequestDirectives { if r == nil { return nil diff --git a/common/request_test.go b/common/request_test.go index 8b8bf1d7e..3febe5c7f 100644 --- a/common/request_test.go +++ b/common/request_test.go @@ -372,6 +372,73 @@ func TestEnrichFromHttp_CacheMaxAgeDirective(t *testing.T) { }) } +func TestEnrichFromHttp_CheckAllUpstreamsDirective(t *testing.T) { + t.Run("header_sets_directive", func(t *testing.T) { + req := NewNormalizedRequest([]byte(`{"jsonrpc":"2.0","id":1,"method":"eth_call"}`)) + headers := http.Header{} + headers.Set("X-ERPC-Check-All-Upstreams", "true") + + req.EnrichFromHttp(headers, nil, UserAgentTrackingModeSimplified) + + if dir := req.Directives(); dir == nil || !dir.CheckAllUpstreams { + t.Fatalf("expected CheckAllUpstreams=true after header directive") + } + }) + + t.Run("query_sets_directive", func(t *testing.T) { + req := NewNormalizedRequest([]byte(`{"jsonrpc":"2.0","id":1,"method":"eth_call"}`)) + query := url.Values{} + query.Set("check-all-upstreams", "true") + + req.EnrichFromHttp(nil, query, UserAgentTrackingModeSimplified) + + if dir := req.Directives(); dir == nil || !dir.CheckAllUpstreams { + t.Fatalf("expected CheckAllUpstreams=true after query directive") + } + }) + + t.Run("parsing_edge_cases", func(t *testing.T) { + cases := []struct { + value string + enabled bool + }{ + {"true", true}, + {"TRUE", true}, + {" true ", true}, + {"false", false}, + {"FALSE", false}, + {"1", false}, // only literal "true" (case-insensitive) enables + {"yes", false}, + {"", false}, // empty value should leave directive unchanged + } + for _, tc := range cases { + t.Run("header="+tc.value, func(t *testing.T) { + req := NewNormalizedRequest([]byte(`{"jsonrpc":"2.0","id":1,"method":"eth_call"}`)) + headers := http.Header{} + if tc.value != "" { + headers.Set("X-ERPC-Check-All-Upstreams", tc.value) + } + req.EnrichFromHttp(headers, nil, UserAgentTrackingModeSimplified) + if got := req.Directives() != nil && req.Directives().CheckAllUpstreams; got != tc.enabled { + t.Fatalf("value=%q: expected CheckAllUpstreams=%v, got %v", tc.value, tc.enabled, got) + } + }) + } + }) +} + +func TestShouldCheckAllUpstreams_NilSafety(t *testing.T) { + var nilReq *NormalizedRequest + if nilReq.ShouldCheckAllUpstreams() { + t.Fatalf("expected false from nil receiver") + } + + req := NewNormalizedRequest([]byte(`{"jsonrpc":"2.0","id":1,"method":"eth_call"}`)) + if req.ShouldCheckAllUpstreams() { + t.Fatalf("expected false from request with no directives set") + } +} + // TestHeaderOverridesConfigDefault_ValidateTransactionsRoot verifies that when the // config defaults set ValidateTransactionsRoot=true, a header/query-string can // override it to false. diff --git a/common/validation.go b/common/validation.go index 8f77fe1f8..0601bae35 100644 --- a/common/validation.go +++ b/common/validation.go @@ -555,6 +555,9 @@ func (p *PostgreSQLConnectorConfig) Validate() error { if p.Table == "" { return fmt.Errorf("database.*.connector.postgresql.table is required") } + if err := ValidatePostgreSQLTableIdentifier(p.Table); err != nil { + return fmt.Errorf("database.*.connector.postgresql.table is invalid: %w", err) + } if p.MinConns == 0 { return fmt.Errorf("database.*.connector.postgresql.minConns is required") } diff --git a/data/postgresql.go b/data/postgresql.go index d4eb301bb..651c93d2d 100644 --- a/data/postgresql.go +++ b/data/postgresql.go @@ -34,6 +34,8 @@ type PostgreSQLConnector struct { minConns int32 maxConns int32 table string + tableSchema string + tableName string cleanupTicker *time.Ticker initTimeout time.Duration getTimeout time.Duration @@ -70,10 +72,17 @@ func NewPostgreSQLConnector( lg := logger.With().Str("connector", id).Logger() lg.Debug().Interface("config", cfg).Msg("creating postgresql connector") + tableIdentifier, err := newPostgreSQLTableIdentifier(cfg.Table) + if err != nil { + return nil, err + } + connector := &PostgreSQLConnector{ id: id, logger: &lg, - table: cfg.Table, + table: tableIdentifier.sql, + tableSchema: tableIdentifier.schema, + tableName: tableIdentifier.name, minConns: cfg.MinConns, maxConns: cfg.MaxConns, initTimeout: cfg.InitTimeout.Duration(), @@ -132,18 +141,26 @@ func (p *PostgreSQLConnector) connectTask(ctx context.Context, cfg *common.Postg expires_at TIMESTAMP WITH TIME ZONE, PRIMARY KEY (partition_key, range_key) ) - `, cfg.Table)) + `, p.table)) if err != nil { return err } // Migrate existing TEXT column to BYTEA if needed var dataType string - err = conn.QueryRow(ctx, ` + dataTypeQuery := ` SELECT data_type FROM information_schema.columns WHERE table_name = $1 AND column_name = 'value' - `, cfg.Table).Scan(&dataType) + ` + dataTypeArgs := []interface{}{p.tableName} + if p.tableSchema != "" { + dataTypeQuery += " AND table_schema = $2" + dataTypeArgs = append(dataTypeArgs, p.tableSchema) + } else { + dataTypeQuery += " AND table_schema = current_schema()" + } + err = conn.QueryRow(ctx, dataTypeQuery, dataTypeArgs...).Scan(&dataType) if err == nil && dataType == "text" { // Migration needed @@ -152,7 +169,7 @@ func (p *PostgreSQLConnector) connectTask(ctx context.Context, cfg *common.Postg // Add temporary column _, err = conn.Exec(ctx, fmt.Sprintf(` ALTER TABLE %s ADD COLUMN IF NOT EXISTS value_new BYTEA - `, cfg.Table)) + `, p.table)) if err != nil { return fmt.Errorf("failed to add temporary column: %w", err) } @@ -160,7 +177,7 @@ func (p *PostgreSQLConnector) connectTask(ctx context.Context, cfg *common.Postg // Copy data (converting text to bytea) _, err = conn.Exec(ctx, fmt.Sprintf(` UPDATE %s SET value_new = value::bytea WHERE value IS NOT NULL - `, cfg.Table)) + `, p.table)) if err != nil { return fmt.Errorf("failed to migrate data: %w", err) } @@ -169,7 +186,7 @@ func (p *PostgreSQLConnector) connectTask(ctx context.Context, cfg *common.Postg _, err = conn.Exec(ctx, fmt.Sprintf(` ALTER TABLE %s DROP COLUMN value; ALTER TABLE %s RENAME COLUMN value_new TO value; - `, cfg.Table, cfg.Table)) + `, p.table, p.table)) if err != nil { return fmt.Errorf("failed to complete migration: %w", err) } @@ -181,7 +198,7 @@ func (p *PostgreSQLConnector) connectTask(ctx context.Context, cfg *common.Postg _, err = conn.Exec(ctx, fmt.Sprintf(` ALTER TABLE %s ADD COLUMN IF NOT EXISTS expires_at TIMESTAMP WITH TIME ZONE - `, cfg.Table)) + `, p.table)) if err != nil { return fmt.Errorf("failed to add expires_at column: %w", err) } @@ -192,7 +209,7 @@ func (p *PostgreSQLConnector) connectTask(ctx context.Context, cfg *common.Postg // and migrate/downgrade the old index separately. _, err = conn.Exec(ctx, fmt.Sprintf(` CREATE INDEX IF NOT EXISTS idx_range_partition ON %s (range_key, partition_key) - `, cfg.Table)) + `, p.table)) if err != nil { return fmt.Errorf("failed to create reverse index: %w", err) } @@ -201,7 +218,7 @@ func (p *PostgreSQLConnector) connectTask(ctx context.Context, cfg *common.Postg _, err = conn.Exec(ctx, fmt.Sprintf(` CREATE INDEX IF NOT EXISTS idx_expires_at ON %s (expires_at) WHERE expires_at IS NOT NULL - `, cfg.Table)) + `, p.table)) if err != nil { return fmt.Errorf("failed to create TTL index: %w", err) } @@ -249,6 +266,35 @@ func (p *PostgreSQLConnector) Id() string { return p.id } +type postgreSQLTableIdentifier struct { + sql string + schema string + name string +} + +func newPostgreSQLTableIdentifier(name string) (postgreSQLTableIdentifier, error) { + parts, err := common.PostgreSQLTableIdentifierParts(name) + if err != nil { + return postgreSQLTableIdentifier{}, err + } + + normalizedParts := make([]string, len(parts)) + for i, part := range parts { + normalizedParts[i] = strings.ToLower(part) + } + + identifier := postgreSQLTableIdentifier{ + sql: pgx.Identifier(normalizedParts).Sanitize(), + } + if len(normalizedParts) == 1 { + identifier.name = normalizedParts[0] + } else { + identifier.schema = normalizedParts[0] + identifier.name = normalizedParts[1] + } + return identifier, nil +} + func (p *PostgreSQLConnector) Set(ctx context.Context, partitionKey, rangeKey string, value []byte, ttl *time.Duration) error { ctx, span := common.StartSpan(ctx, "PostgreSQLConnector.Set") defer span.End() @@ -299,12 +345,12 @@ func (p *PostgreSQLConnector) Set(ctx context.Context, partitionKey, rangeKey st // Avoid repeated large updates on hot keys: only update when we need to clear expires_at // or the stored value is actually different. _, err = p.conn.Exec(ctx, fmt.Sprintf(` - INSERT INTO %s (partition_key, range_key, value, expires_at) + INSERT INTO %s AS existing (partition_key, range_key, value, expires_at) VALUES ($1, $2, $3, NULL) ON CONFLICT (partition_key, range_key) DO UPDATE SET value = EXCLUDED.value, expires_at = NULL - WHERE %s.expires_at IS NOT NULL OR %s.value IS DISTINCT FROM EXCLUDED.value - `, p.table, p.table, p.table), partitionKey, rangeKey, value) + WHERE existing.expires_at IS NOT NULL OR existing.value IS DISTINCT FROM EXCLUDED.value + `, p.table), partitionKey, rangeKey, value) } if err != nil { diff --git a/data/postgresql_identifier_test.go b/data/postgresql_identifier_test.go new file mode 100644 index 000000000..5f9f8f270 --- /dev/null +++ b/data/postgresql_identifier_test.go @@ -0,0 +1,74 @@ +package data + +import ( + "context" + "io" + "testing" + "time" + + "github.com/erpc/erpc/common" + "github.com/rs/zerolog" + "github.com/stretchr/testify/require" +) + +func TestNewPostgreSQLTableIdentifier(t *testing.T) { + tests := []struct { + name string + table string + wantSQL string + wantSchema string + wantName string + }{ + { + name: "unqualified", + table: "erpc_json_rpc_cache", + wantSQL: `"erpc_json_rpc_cache"`, + wantName: "erpc_json_rpc_cache", + }, + { + name: "schema qualified", + table: "myschema.cache", + wantSQL: `"myschema"."cache"`, + wantSchema: "myschema", + wantName: "cache", + }, + { + name: "matches postgres unquoted case folding", + table: "MySchema.Cache", + wantSQL: `"myschema"."cache"`, + wantSchema: "myschema", + wantName: "cache", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := newPostgreSQLTableIdentifier(tt.table) + require.NoError(t, err) + require.Equal(t, tt.wantSQL, got.sql) + require.Equal(t, tt.wantSchema, got.schema) + require.Equal(t, tt.wantName, got.name) + }) + } +} + +func TestNewPostgreSQLConnectorRejectsInvalidTableIdentifier(t *testing.T) { + logger := zerolog.New(io.Discard) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + cfg := &common.PostgreSQLConnectorConfig{ + Table: "; DROP TABLE foo; --", + ConnectionUri: "postgres://user:pass@127.0.0.1:9876/bogusdb?sslmode=disable", + InitTimeout: common.Duration(time.Second), + GetTimeout: common.Duration(time.Second), + SetTimeout: common.Duration(time.Second), + MinConns: 1, + MaxConns: 2, + } + + connector, err := NewPostgreSQLConnector(ctx, &logger, "test-invalid-table", cfg) + require.Error(t, err) + require.Nil(t, connector) + require.ErrorContains(t, err, "postgres table identifier") +} diff --git a/docs/pages/operation/directives.mdx b/docs/pages/operation/directives.mdx index d6b9898b3..643ff8982 100644 --- a/docs/pages/operation/directives.mdx +++ b/docs/pages/operation/directives.mdx @@ -246,6 +246,35 @@ curl --location 'http://localhost:4000/main/evm/42161?use-upstream=up123' # ... ``` +## Check every selected upstream + +For compatibility investigations you can ask eRPC to run the same request against every selected upstream and return a diagnostic result instead of the first usable upstream response. + +Use either: + +* Header `X-ERPC-Check-All-Upstreams: true` +* Or query parameter `?check-all-upstreams=true` + +This mode bypasses request multiplexing and cache reads/writes for that request, and disables `eth_call` multicall3 batching, so each upstream is probed with the original payload. The response reports each selected upstream's ID, vendor, success status, latency, result size when available, and error details. EVM execution exceptions (for example an `eth_call` revert with data) are marked with `executionException: true` and count as a successful upstream execution, because the provider accepted and executed the call even though the EVM reverted. + +`allSucceeded` reflects only whether each provider accepted and executed the request — it does **not** compare result payloads across upstreams. A revert with execution data on every upstream still yields `allSucceeded: true`. The summary also exposes a separate `executionExceptions` counter so operators can distinguish plain successes from upstreams that reverted. + +This is useful for checking whether calldata size, returndata/revertdata size, or gas requirements work across all upstreams that could be selected at runtime. + +```bash +curl --location 'http://localhost:4000/main/evm/42161?check-all-upstreams=true' \ +--header 'Content-Type: application/json' \ +--data '{ + "method": "eth_call", + "params": [ + {"data": "0x..."}, + "latest" + ], + "id": 1, + "jsonrpc": "2.0" +}' +``` + ## Validation directives For high-integrity use-cases (such as indexing) where data accuracy is critical, eRPC provides validation directives that check response structure and consistency. When validation fails, the response is rejected and retry/consensus policies automatically try other upstreams. diff --git a/docs/plans/2026-05-06-pgx-v5-migration.md b/docs/plans/2026-05-06-pgx-v5-migration.md new file mode 100644 index 000000000..b92c795ad --- /dev/null +++ b/docs/plans/2026-05-06-pgx-v5-migration.md @@ -0,0 +1,31 @@ +# pgx v5 Migration Audit + +**Date:** 2026-05-06 +**Status:** Draft + +Scope: `github.com/jackc/pgx/v4` in `data/postgresql.go`. + +Current usage is concentrated in the PostgreSQL connector: + +- Imports: `github.com/jackc/pgx/v4` and `github.com/jackc/pgx/v4/pgxpool`. +- Pool lifecycle: `pgxpool.ParseConfig`, `pgxpool.ConnectConfig`, `Pool.Acquire`, `Config.ConnString()`. +- Queries: `Exec`, `QueryRow`, `Query`, `Rows.Next`, `Rows.Scan`, `Rows.Err`, `CommandTag.RowsAffected`. +- Transactions and locking: `Pool.Begin`, `pgx.Tx`, `QueryRow`, `Commit`, `Rollback`. +- Pubsub: `pg_notify`, `LISTEN`, `Conn().WaitForNotification`. +- Error mapping: `pgx.ErrNoRows`. + +Migration notes: + +- Update imports to `github.com/jackc/pgx/v5` and `github.com/jackc/pgx/v5/pgxpool`. +- Replace `pgxpool.ConnectConfig` with `pgxpool.NewWithConfig`; pgx v5 renamed pool constructors and pools always connect lazily. +- Re-check startup behavior because current initialization expects the first connection attempt to happen during `NewPostgreSQLConnector`. +- Keep `pgxpool.ParseConfig` and `Config.ConnString()`; both remain in v5 docs. +- Validate `pgx.ErrNoRows` handling; v5 keeps it and wraps `sql.ErrNoRows`. +- No direct `pgtype`, `pgconn`, or `pgproto3` code usage exists outside indirect dependencies, so most v5 type-system churn should not affect repo code. +- Run the real Postgres connector tests because listener reconnects, advisory-lock transactions, and startup readiness are the highest-risk paths. +- Reference: https://github.com/jackc/pgx/blob/master/CHANGELOG.md + +Suggested follow-up: + +- Dedicated pgx v5 PR that updates the imports, adapts pool creation, and adds/updates connector tests for lazy pool startup. +- Validation: `go test ./data -run 'TestPostgre' -count=1`, `go test ./data -run 'TestPostgreSQLDistributedLocking' -count=1`, and full `make test-fast` if runtime allows. diff --git a/erpc/networks.go b/erpc/networks.go index 28106942d..069c7e115 100644 --- a/erpc/networks.go +++ b/erpc/networks.go @@ -1,6 +1,7 @@ package erpc import ( + "bytes" "context" "errors" "fmt" @@ -93,6 +94,29 @@ func classifyAttemptReason(consensusEnabled bool, retries, hedges int) string { } } +type allUpstreamsCheckResult struct { + AllSucceeded bool `json:"allSucceeded"` + Total int `json:"total"` + Succeeded int `json:"succeeded"` + ExecutionExceptions int `json:"executionExceptions"` + Failed int `json:"failed"` + Upstreams []allUpstreamsCheckUpstreamResult `json:"upstreams"` +} + +type allUpstreamsCheckUpstreamResult struct { + ID string `json:"id"` + Vendor string `json:"vendor"` + Succeeded bool `json:"succeeded"` + ExecutionException bool `json:"executionException,omitempty"` + RetryableSkip bool `json:"retryableSkip,omitempty"` + DurationMs int64 `json:"durationMs"` + ResultSize int `json:"resultSize,omitempty"` + Error string `json:"error,omitempty"` + ErrorCode string `json:"errorCode,omitempty"` + ErrorSummary string `json:"errorSummary,omitempty"` + ErrorFingerprint string `json:"errorFingerprint,omitempty"` +} + type getSortedUpstreamsForNetworkFn func( ctx context.Context, registry *upstream.UpstreamsRegistry, @@ -197,6 +221,155 @@ func shouldSkipNetworkRateLimit(ctx context.Context) bool { return false } +func cloneRequestForAllUpstreamsCheck(ctx context.Context, source *common.NormalizedRequest) (*common.NormalizedRequest, error) { + body, err := source.ForwardBody(ctx) + if err != nil { + return nil, err + } + + cloned := common.NewNormalizedRequest(bytes.Clone(body)) + if directives := source.Directives(); directives != nil { + clonedDirs := directives.Clone() + // Force per-probe to bypass cache reads so the diagnostic truly + // contacts each upstream instead of returning a cache hit from + // EVM hook paths (e.g. handleUserMulticall3 honors SkipCacheRead). + clonedDirs.SkipCacheRead = "true" + cloned.SetDirectives(clonedDirs) + } + if source.ForwardHeaders != nil { + cloned.ForwardHeaders = source.ForwardHeaders.Clone() + } + cloned.CopyHttpContextFrom(source) + cloned.SetSkipMultiplex(true) + + return cloned, nil +} + +func (n *Network) forwardAllUpstreamsCheck( + ctx context.Context, + req *common.NormalizedRequest, + upsList []common.Upstream, + method string, +) (*common.NormalizedResponse, error) { + result := allUpstreamsCheckResult{ + AllSucceeded: true, + Total: len(upsList), + Upstreams: make([]allUpstreamsCheckUpstreamResult, 0, len(upsList)), + } + + for _, ups := range upsList { + entry := n.probeUpstreamForAllUpstreamsCheck(ctx, req, ups, method) + + switch { + case entry.ExecutionException: + result.ExecutionExceptions++ + result.Succeeded++ + case entry.Succeeded: + result.Succeeded++ + default: + result.Failed++ + result.AllSucceeded = false + } + result.Upstreams = append(result.Upstreams, entry) + } + + if result.Total == 0 { + // AllSucceeded over an empty fleet is misleading; signal explicitly. + result.AllSucceeded = false + } + + jrr, err := common.NewJsonRpcResponse(req.ID(), result, nil) + if err != nil { + n.logger.Error().Err(err).Msg("failed to marshal check-all-upstreams diagnostic result") + return nil, err + } + + resp := common.NewNormalizedResponse().WithRequest(req).WithJsonRpcResponse(jrr) + resp.SetAttempts(len(upsList)) + return resp, nil +} + +// probeUpstreamForAllUpstreamsCheck runs a single upstream probe for the +// CheckAllUpstreams diagnostic mode and returns the populated entry. +func (n *Network) probeUpstreamForAllUpstreamsCheck( + ctx context.Context, + req *common.NormalizedRequest, + ups common.Upstream, + method string, +) allUpstreamsCheckUpstreamResult { + started := time.Now() + entry := allUpstreamsCheckUpstreamResult{ + ID: ups.Id(), + Vendor: ups.VendorName(), + } + + probeReq, err := cloneRequestForAllUpstreamsCheck(ctx, req) + if err == nil { + probeReq.SetNetwork(n) + probeReq.SetCacheDal(n.cacheDal) + + if skipErr, isRetryable := n.checkUpstreamBlockAvailability(ctx, ups, probeReq, method); skipErr != nil { + err = skipErr + entry.RetryableSkip = isRetryable + } else { + var probeResp *common.NormalizedResponse + probeResp, err = n.doForward(ctx, ups, probeReq, true) + if probeResp != nil { + jrr, jrrErr := probeResp.JsonRpcResponse(ctx) + switch { + case jrrErr != nil: + // Don't silently swallow parse/decompression failures — + // surface them as the upstream's failure if no other error + // already won. + if err == nil { + err = jrrErr + } + n.logger.Warn(). + Err(jrrErr). + Str("upstreamId", ups.Id()). + Msg("check-all-upstreams: failed to parse upstream JSON-RPC response") + case jrr != nil: + entry.ResultSize = len(jrr.GetResultBytes()) + if jrr.Error != nil && err == nil { + // jrr.Error is a *ErrJsonRpcExceptionExternal whose top-level + // type code is not ErrCodeEndpointExecutionException. Wrap + // revert/call exceptions into ErrEndpointExecutionException so + // downstream HasErrorCode(...) detects them as execution + // exceptions — matching how the rest of the proxy classifies + // these errors and what the directive's docs promise. + switch common.JsonRpcErrorNumber(jrr.Error.Code) { + case common.JsonRpcErrorEvmReverted, + common.JsonRpcErrorCallException, + common.JsonRpcErrorTransactionRejected: + err = common.NewErrEndpointExecutionException(jrr.Error) + default: + err = jrr.Error + } + } + } + probeResp.Release() + } + } + } + + entry.DurationMs = time.Since(started).Milliseconds() + entry.ExecutionException = common.HasErrorCode(err, common.ErrCodeEndpointExecutionException) + entry.Succeeded = err == nil || entry.ExecutionException + if err != nil { + entry.Error = err.Error() + entry.ErrorSummary = common.ErrorSummary(err) + entry.ErrorFingerprint = common.ErrorFingerprint(err) + var se common.StandardError + if errors.As(err, &se) { + if base := se.Base(); base != nil { + entry.ErrorCode = string(base.Code) + } + } + } + + return entry +} + func (n *Network) Bootstrap(ctx context.Context) error { // Initialize policy evaluator if configured if n.cfg.SelectionPolicy != nil { @@ -422,6 +595,8 @@ func (n *Network) Forward(ctx context.Context, req *common.NormalizedRequest) (* method, _ := req.Method() lg := n.logger.With().Str("method", method).Interface("id", req.ID()).Str("ptr", fmt.Sprintf("%p", req)).Logger() + var resp *common.NormalizedResponse + var err error var upstreamCalls atomic.Int64 defer func() { telemetry.ObserveNetworkUpstreamCallsPerRequest( @@ -465,27 +640,32 @@ func (n *Network) Forward(ctx context.Context, req *common.NormalizedRequest) (* } } - mlx, resp, err := n.handleMultiplexing(ctx, &lg, req, startTime) - if err != nil || resp != nil { - // When the original request is already fulfilled by multiplexer (follower path) - forwardSpan.SetAttributes( - attribute.Bool("multiplexed", true), - attribute.String("multiplexer.role", "follower"), - ) - if err != nil { - common.SetTraceSpanError(forwardSpan, err) + var mlx *Multiplexer + checkAllUpstreams := req.ShouldCheckAllUpstreams() + forwardSpan.SetAttributes(attribute.Bool("check_all_upstreams", checkAllUpstreams)) + if !checkAllUpstreams { + mlx, resp, err = n.handleMultiplexing(ctx, &lg, req, startTime) + if err != nil || resp != nil { + // When the original request is already fulfilled by multiplexer (follower path) + forwardSpan.SetAttributes( + attribute.Bool("multiplexed", true), + attribute.String("multiplexer.role", "follower"), + ) + if err != nil { + common.SetTraceSpanError(forwardSpan, err) + } + return resp, err + } + if mlx != nil { + forwardSpan.SetAttributes( + attribute.String("multiplexer.hash", mlx.hash), + attribute.String("multiplexer.role", "leader"), + ) + defer n.cleanupMultiplexer(mlx) } - return resp, err - } - if mlx != nil { - forwardSpan.SetAttributes( - attribute.String("multiplexer.hash", mlx.hash), - attribute.String("multiplexer.role", "leader"), - ) - defer n.cleanupMultiplexer(mlx) } - if n.cacheDal != nil && !req.ShouldSkipCacheRead("") { + if n.cacheDal != nil && !req.ShouldSkipCacheRead("") && !checkAllUpstreams { lg.Debug().Msgf("checking cache for request") resp, err := n.cacheDal.Get(ctx, req) if err != nil { @@ -677,6 +857,14 @@ func (n *Network) Forward(ctx context.Context, req *common.NormalizedRequest) (* return nil, err } + if checkAllUpstreams { + resp, err := n.forwardAllUpstreamsCheck(ctx, req, upsList, method) + if err != nil { + common.SetTraceSpanError(forwardSpan, err) + } + return resp, err + } + // 5) Iterate over upstreams and forward the request until success or fatal failure tryForward := func( u common.Upstream, diff --git a/erpc/networks_check_all_upstreams_test.go b/erpc/networks_check_all_upstreams_test.go new file mode 100644 index 000000000..b5888000b --- /dev/null +++ b/erpc/networks_check_all_upstreams_test.go @@ -0,0 +1,217 @@ +package erpc + +import ( + "context" + "encoding/json" + "net/http" + "strings" + "testing" + + "github.com/erpc/erpc/common" + "github.com/erpc/erpc/util" + "github.com/h2non/gock" + "github.com/stretchr/testify/require" +) + +// upstreamCheckEntry mirrors allUpstreamsCheckUpstreamResult for JSON decoding +// in tests. Field tags must stay in sync with the production struct. +type upstreamCheckEntry struct { + ID string `json:"id"` + Vendor string `json:"vendor"` + Succeeded bool `json:"succeeded"` + ExecutionException bool `json:"executionException,omitempty"` + RetryableSkip bool `json:"retryableSkip,omitempty"` + DurationMs int64 `json:"durationMs"` + ResultSize int `json:"resultSize,omitempty"` + Error string `json:"error,omitempty"` + ErrorCode string `json:"errorCode,omitempty"` + ErrorSummary string `json:"errorSummary,omitempty"` + ErrorFingerprint string `json:"errorFingerprint,omitempty"` +} + +type upstreamCheckResult struct { + AllSucceeded bool `json:"allSucceeded"` + Total int `json:"total"` + Succeeded int `json:"succeeded"` + ExecutionExceptions int `json:"executionExceptions"` + Failed int `json:"failed"` + Upstreams []upstreamCheckEntry `json:"upstreams"` +} + +func TestNetworkForwardCheckAllUpstreams(t *testing.T) { + util.ResetGock() + defer util.ResetGock() + util.SetupMocksForEvmStatePoller() + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + for _, upstreamURL := range []string{"http://rpc1.localhost", "http://rpc2.localhost"} { + gock.New(upstreamURL). + Post(""). + Persist(). + Filter(func(request *http.Request) bool { + return strings.Contains(util.SafeReadBody(request), "eth_call") + }). + Reply(200). + JSON(map[string]interface{}{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x1234", + }) + } + + gock.New("http://rpc3.localhost"). + Post(""). + Persist(). + Filter(func(request *http.Request) bool { + return strings.Contains(util.SafeReadBody(request), "eth_call") + }). + Reply(500). + JSON(map[string]interface{}{ + "error": "payload too large", + }) + + network := setupTestNetworkForTiming(t, ctx, &common.FailsafeConfig{}) + + req := common.NewNormalizedRequest([]byte(`{ + "jsonrpc": "2.0", + "id": 1, + "method": "eth_call", + "params": [{"data":"0x1234"}, "latest"] + }`)) + req.SetDirectives(&common.RequestDirectives{CheckAllUpstreams: true}) + + resp, err := network.Forward(ctx, req) + require.NoError(t, err) + require.NotNil(t, resp) + defer resp.Release() + + jrr, err := resp.JsonRpcResponse(ctx) + require.NoError(t, err) + require.NotNil(t, jrr) + require.Nil(t, jrr.Error) + + var result upstreamCheckResult + require.NoError(t, json.Unmarshal(jrr.GetResultBytes(), &result)) + require.False(t, result.AllSucceeded) + require.Equal(t, 3, result.Total) + require.Equal(t, 2, result.Succeeded) + require.Equal(t, 0, result.ExecutionExceptions) + require.Equal(t, 1, result.Failed) + require.Len(t, result.Upstreams, 3) + + seen := map[string]upstreamCheckEntry{} + for _, u := range result.Upstreams { + seen[u.ID] = u + } + require.Len(t, seen, 3) + + for _, id := range []string{"rpc1", "rpc2"} { + entry := seen[id] + require.True(t, entry.Succeeded, id) + require.False(t, entry.ExecutionException, id) + require.Empty(t, entry.Error, id) + require.Empty(t, entry.ErrorCode, id) + require.Greater(t, entry.ResultSize, 0, "ResultSize should reflect non-empty result for %s", id) + require.GreaterOrEqual(t, entry.DurationMs, int64(0), id) + } + + rpc3 := seen["rpc3"] + require.False(t, rpc3.Succeeded) + require.False(t, rpc3.ExecutionException) + require.Contains(t, rpc3.Error, "payload too large") + require.NotEmpty(t, rpc3.ErrorSummary) + require.NotEmpty(t, rpc3.ErrorFingerprint) +} + +// TestNetworkForwardCheckAllUpstreams_ExecutionException covers the headline +// behavior: an upstream that returns a JSON-RPC revert with data must be +// reported as Succeeded=true with ExecutionException=true, and counted under +// `executionExceptions` in the summary. +func TestNetworkForwardCheckAllUpstreams_ExecutionException(t *testing.T) { + util.ResetGock() + defer util.ResetGock() + util.SetupMocksForEvmStatePoller() + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + // rpc1 + rpc2 succeed; rpc3 returns an EVM revert with data. + for _, upstreamURL := range []string{"http://rpc1.localhost", "http://rpc2.localhost"} { + gock.New(upstreamURL). + Post(""). + Persist(). + Filter(func(request *http.Request) bool { + return strings.Contains(util.SafeReadBody(request), "eth_call") + }). + Reply(200). + JSON(map[string]interface{}{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x1234", + }) + } + + gock.New("http://rpc3.localhost"). + Post(""). + Persist(). + Filter(func(request *http.Request) bool { + return strings.Contains(util.SafeReadBody(request), "eth_call") + }). + Reply(200). + JSON(map[string]interface{}{ + "jsonrpc": "2.0", + "id": 1, + "error": map[string]interface{}{ + "code": 3, + "message": "execution reverted", + "data": "0x08c379a0", + }, + }) + + network := setupTestNetworkForTiming(t, ctx, &common.FailsafeConfig{}) + + req := common.NewNormalizedRequest([]byte(`{ + "jsonrpc": "2.0", + "id": 1, + "method": "eth_call", + "params": [{"data":"0x1234"}, "latest"] + }`)) + req.SetDirectives(&common.RequestDirectives{CheckAllUpstreams: true}) + + resp, err := network.Forward(ctx, req) + require.NoError(t, err) + require.NotNil(t, resp) + defer resp.Release() + + jrr, err := resp.JsonRpcResponse(ctx) + require.NoError(t, err) + require.NotNil(t, jrr) + require.Nil(t, jrr.Error) + + var result upstreamCheckResult + require.NoError(t, json.Unmarshal(jrr.GetResultBytes(), &result)) + require.True(t, result.AllSucceeded, "every upstream executed (revert counts as execution)") + require.Equal(t, 3, result.Total) + require.Equal(t, 3, result.Succeeded) + require.Equal(t, 1, result.ExecutionExceptions) + require.Equal(t, 0, result.Failed) + require.Len(t, result.Upstreams, 3) + + var rpc3 upstreamCheckEntry + for _, u := range result.Upstreams { + if u.ID == "rpc3" { + rpc3 = u + } + } + require.True(t, rpc3.Succeeded) + require.True(t, rpc3.ExecutionException) + // ErrorCode is the outermost StandardError code; it may be the upstream- + // request wrapper, but it must be populated so operators can correlate + // telemetry. The execution-exception classification is conveyed via + // ExecutionException above (which walks the wrap chain). + require.NotEmpty(t, rpc3.ErrorCode) + require.NotEmpty(t, rpc3.ErrorSummary) + require.NotEmpty(t, rpc3.ErrorFingerprint) +} diff --git a/go.mod b/go.mod index 146480f97..a2704fa90 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/IGLOU-EU/go-wildcard/v2 v2.1.0 github.com/aws/aws-sdk-go v1.55.8 github.com/blockchain-data-standards/manifesto v0.0.0 - github.com/bytedance/sonic v1.15.0 + github.com/bytedance/sonic v1.15.1 github.com/dgraph-io/ristretto/v2 v2.4.0 github.com/dustin/go-humanize v1.0.1 github.com/envoyproxy/go-control-plane/envoy v1.37.0 @@ -62,7 +62,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.24.2 // indirect github.com/bytedance/gopkg v0.1.3 // indirect - github.com/bytedance/sonic/loader v0.5.0 // indirect + github.com/bytedance/sonic/loader v0.5.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect diff --git a/go.sum b/go.sum index c8a8ad90f..896a4b75a 100644 --- a/go.sum +++ b/go.sum @@ -40,10 +40,10 @@ github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= github.com/bytedance/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M= github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM= -github.com/bytedance/sonic v1.15.0 h1:/PXeWFaR5ElNcVE84U0dOHjiMHQOwNIx3K4ymzh/uSE= -github.com/bytedance/sonic v1.15.0/go.mod h1:tFkWrPz0/CUCLEF4ri4UkHekCIcdnkqXw9VduqpJh0k= -github.com/bytedance/sonic/loader v0.5.0 h1:gXH3KVnatgY7loH5/TkeVyXPfESoqSBSBEiDd5VjlgE= -github.com/bytedance/sonic/loader v0.5.0/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo= +github.com/bytedance/sonic v1.15.1 h1:nJD5PmM0vY7J8CT6MxoqbVAAMhkSmV2HgRAUrrpLoOw= +github.com/bytedance/sonic v1.15.1/go.mod h1:mT2NbXunuaEbnZ+mRIX/vYqKISmgEuHFDI4UzmKx2SA= +github.com/bytedance/sonic/loader v0.5.1 h1:Ygpfa9zwRCCKSlrp5bBP/b/Xzc3VxsAW+5NIYXrOOpI= +github.com/bytedance/sonic/loader v0.5.1/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= diff --git a/package.json b/package.json index 25193d444..1b0732fc5 100644 --- a/package.json +++ b/package.json @@ -15,5 +15,5 @@ "engines": { "node": ">=18.14" }, - "version": "0.0.78" + "version": "0.0.81" } diff --git a/typescript/cli/package.json b/typescript/cli/package.json index 806ccbe4b..3e51ca5a9 100644 --- a/typescript/cli/package.json +++ b/typescript/cli/package.json @@ -1,6 +1,6 @@ { "name": "@erpc-cloud/cli", - "version": "0.0.78", + "version": "0.0.81", "description": "Library providing the erpc CLI", "bin": "./dist/bin.js", "repository": { diff --git a/typescript/cli/src/generated/checksums.ts b/typescript/cli/src/generated/checksums.ts index 5a4c8873c..9f0a5bc26 100644 --- a/typescript/cli/src/generated/checksums.ts +++ b/typescript/cli/src/generated/checksums.ts @@ -2,9 +2,9 @@ import type { Checksums } from "../types"; export const CHECKSUMS: Checksums = { - "darwin_x86_64": "8babbde35f5e4305d104a38799d2b8303daae8b2a4d6c00d0c575c98bbc83dd2", - "darwin_arm64": "1760410b6d41db39e12a1773818b917c990234149219af545f378f9a95ff3978", - "linux_x86_64": "f009768a0ea386852d6b438fe22c6f03f4e44cb9dd4421317399761714854547", - "linux_arm64": "60fb2f6fde9b0c675760beef5d84cdc05adc022c7b4e6c9725d49b4620087460", - "windows_x86_64": "a9c54fd309147bc93bf3cd859f1515eb990363ec9698181658d6e13f5b0298b0" + "darwin_x86_64": "6326111dd29a6d953a5bacc802d9f96a47180acfed46906bfe191c16015cbf29", + "darwin_arm64": "f7675165da485493ebe3c731b75b55699d5d5d95e119226b8c00bfe8d071c2aa", + "linux_x86_64": "02bc5891dc0a34ba50ee6617cff457739145cf445b90386c748a8dd22043d623", + "linux_arm64": "7dfbaa07caa1f8495e4ced6358634cd680c434a0dcfb2d36bc25a533cea4206d", + "windows_x86_64": "29751a1109601ce8cd917955ad32f413f321a7b01798e96ee2f9c31483718436" }; diff --git a/typescript/cli/src/generated/release.ts b/typescript/cli/src/generated/release.ts index 00fc75ca1..3992a044d 100644 --- a/typescript/cli/src/generated/release.ts +++ b/typescript/cli/src/generated/release.ts @@ -2,6 +2,6 @@ import type { ReleaseInfo } from "../types"; export const RELEASE_INFO: ReleaseInfo = { - version: '0.0.78', - commitSha: 'a2c81a95af4f3ba06fbaa7a03836e6672d0c0e57', + version: '0.0.81', + commitSha: '3cb8a017ad69b48f0ba922c64c67c65688de4eb8', }; diff --git a/typescript/config/lib/generated.d.ts b/typescript/config/lib/generated.d.ts index 12c560a68..a82f19651 100644 --- a/typescript/config/lib/generated.d.ts +++ b/typescript/config/lib/generated.d.ts @@ -857,11 +857,37 @@ export interface NetworkConfig { alias?: string; methods?: MethodsConfig; multiplexing?: boolean; + staticResponses?: (StaticResponseConfig | undefined)[]; +} +/** + * StaticResponseConfig declares a canned JSON-RPC response for a specific + * (method, params) pair on a network. + */ +export interface StaticResponseConfig { + method: string; + params?: any[]; + response?: StaticResponseBodyConfig; +} +/** + * StaticResponseBodyConfig holds the JSON-RPC payload to serve. Exactly one + * of Result or Error must be set. + */ +export interface StaticResponseBodyConfig { + result?: any; + error?: StaticResponseErrorConfig; +} +/** + * StaticResponseErrorConfig mirrors a JSON-RPC error object. + */ +export interface StaticResponseErrorConfig { + code: number; + message: string; + data?: any; } export interface DirectiveDefaultsConfig { retryEmpty?: boolean; retryPending?: boolean; - skipCacheRead?: boolean; + skipCacheRead?: any; cacheMaxAgeSeconds?: number; useUpstream?: string; skipInterpolation?: boolean; @@ -1215,6 +1241,57 @@ export interface NetworkStrategyConfig { rateLimitBudget?: string; ipAsUser?: boolean; } +/** + * X402StrategyConfig enables x402 payment authentication (HTTP 402 Payment Required). + */ +export interface X402StrategyConfig { + /** + * FacilitatorURL is the x402 facilitator endpoint for verify/settle operations. + */ + facilitatorUrl: string; + /** + * SellerAddress is the wallet address that receives payments. + */ + sellerAddress: string; + /** + * PricePerRequest is the cost per request in atomic units. + */ + pricePerRequest: string; + /** + * Network is the x402 network name for payment. + */ + network: string; + /** + * Asset is the token contract address used for payment. + */ + asset?: string; + /** + * Scheme is the x402 payment scheme. + */ + scheme?: string; + /** + * Description is a human-readable description included in 402 responses. + */ + description?: string; + /** + * MaxTimeoutSeconds is the payment authorization validity period. + */ + maxTimeoutSeconds?: number; + /** + * RateLimitBudget, if set, is applied to the authenticated payer. + */ + rateLimitBudget?: string; + /** + * VerifyOnly when true skips settlement. + */ + verifyOnly?: boolean; + /** + * Extra contains additional fields merged into the payment requirement's extra object. + */ + extra?: { + [key: string]: any; + }; +} export type LabelMode = string; export declare const ErrorLabelModeVerbose: LabelMode; export declare const ErrorLabelModeCompact: LabelMode; diff --git a/typescript/config/lib/generated.d.ts.map b/typescript/config/lib/generated.d.ts.map index cf91d92b9..302ed2e14 100644 --- a/typescript/config/lib/generated.d.ts.map +++ b/typescript/config/lib/generated.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"generated.d.ts","sourceRoot":"","sources":["../src/generated.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAA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EAAE,KAAiB,CAAC;AAC7C;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAAkB,CAAC;AAC/C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC;AAChC,MAAM,MAAM,QAAQ,GAAG,GAAG,CAAC;AAK3B,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,MAAM,CAAC;CACzB"} \ No newline at end of file diff --git a/typescript/config/lib/index.js.map b/typescript/config/lib/index.js.map index be74b284f..7b7a87a1f 100644 --- a/typescript/config/lib/index.js.map +++ b/typescript/config/lib/index.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../src/index.ts", "../src/generated.ts"], - "sourcesContent": ["export type {\n // Tygo generic replacement\n LogLevel,\n Duration,\n ByteSize,\n NetworkArchitecture,\n ConnectorDriverType,\n ConnectorConfig,\n UpstreamType,\n // Policy evaluation\n PolicyEvalUpstreamMetrics,\n PolicyEvalUpstream,\n SelectionPolicyEvalFunction,\n EvmNetworkConfigForDefaults,\n} from \"./types\";\nexport {\n // Data finality const exports\n DataFinalityStateUnfinalized,\n DataFinalityStateFinalized,\n DataFinalityStateRealtime,\n DataFinalityStateUnknown,\n // Scope exports\n ScopeNetwork,\n ScopeUpstream,\n // Cache behavior exports\n CacheEmptyBehaviorIgnore,\n CacheEmptyBehaviorAllow,\n CacheEmptyBehaviorOnly,\n // Evm node type\n EvmNodeTypeFull,\n EvmNodeTypeArchive,\n EvmNodeTypeUnknown,\n // Evm syncing type\n EvmSyncingStateUnknown,\n EvmSyncingStateSyncing,\n EvmSyncingStateNotSyncing,\n // Architecture export\n ArchitectureEvm,\n // Upstream types const exprots\n UpstreamTypeEvm,\n // Auth types\n AuthTypeSecret,\n AuthTypeJwt,\n AuthTypeSiwe,\n AuthTypeNetwork,\n // Consensus related\n ConsensusLowParticipantsBehaviorReturnError,\n ConsensusLowParticipantsBehaviorAcceptMostCommonValidResult,\n ConsensusLowParticipantsBehaviorPreferBlockHeadLeader,\n ConsensusLowParticipantsBehaviorOnlyBlockHeadLeader,\n ConsensusDisputeBehaviorReturnError,\n ConsensusDisputeBehaviorAcceptMostCommonValidResult,\n ConsensusDisputeBehaviorPreferBlockHeadLeader,\n ConsensusDisputeBehaviorOnlyBlockHeadLeader,\n // Rate limiter periods\n RateLimitPeriodSecond,\n RateLimitPeriodMinute,\n RateLimitPeriodHour,\n RateLimitPeriodDay,\n RateLimitPeriodWeek,\n RateLimitPeriodMonth,\n RateLimitPeriodYear,\n} from \"./generated\";\nexport type {\n Config,\n ProjectConfig,\n HealthCheckConfig,\n // Provider related\n ProviderConfig,\n VendorSettings,\n // Upstream related\n UpstreamConfig,\n EvmUpstreamConfig,\n UpstreamIntegrityConfig,\n UpstreamIntegrityEthGetBlockReceiptsConfig,\n RoutingConfig,\n ScoreMultiplierConfig,\n RateLimitAutoTuneConfig,\n JsonRpcUpstreamConfig,\n // Failsafe related\n FailsafeConfig,\n RetryPolicyConfig,\n CircuitBreakerPolicyConfig,\n HedgePolicyConfig,\n TimeoutPolicyConfig,\n ConsensusPolicyConfig,\n // Network related\n NetworkConfig,\n EvmNetworkConfig,\n EvmIntegrityConfig,\n SelectionPolicyConfig,\n DirectiveDefaultsConfig,\n // DB related\n DatabaseConfig,\n CacheConfig,\n DataFinalityState,\n CacheEmptyBehavior,\n CachePolicyConfig,\n MemoryConnectorConfig,\n RedisConnectorConfig,\n DynamoDBConnectorConfig,\n AwsAuthConfig,\n PostgreSQLConnectorConfig,\n // Auth related\n AuthStrategyConfig,\n SecretStrategyConfig,\n JwtStrategyConfig,\n SiweStrategyConfig,\n NetworkStrategyConfig,\n // Rate limits related\n RateLimiterConfig,\n RateLimitBudgetConfig,\n RateLimitRuleConfig,\n // Server config related\n ServerConfig,\n CORSConfig,\n MetricsConfig,\n AdminConfig,\n AliasingConfig,\n AliasingRuleConfig,\n TLSConfig,\n // Proxy pools related\n ProxyPoolConfig,\n} from \"./generated\";\n\nimport type { Config } from './generated'\n\nexport const createConfig = (\n cfg: Config\n): Config => {\n return cfg;\n};\n", "// Code generated by tygo. DO NOT EDIT.\nimport type { \n LogLevel,\n Duration,\n ByteSize,\n ConnectorDriverType as TsConnectorDriverType,\n ConnectorConfig as TsConnectorConfig,\n UpstreamType as TsUpstreamType,\n NetworkArchitecture as TsNetworkArchitecture,\n AuthType as TsAuthType,\n AuthStrategyConfig as TsAuthStrategyConfig,\n EvmNetworkConfigForDefaults as TsEvmNetworkConfigForDefaults,\n SelectionPolicyEvalFunction\n} from \"./types\"\n\n//////////\n// source: architecture_evm.go\n\nexport const UpstreamTypeEvm: UpstreamType = \"evm\";\nexport type EvmUpstream = \n Upstream;\nexport type AvailbilityConfidence = number /* int */;\nexport const AvailbilityConfidenceBlockHead: AvailbilityConfidence = 1;\nexport const AvailbilityConfidenceFinalized: AvailbilityConfidence = 2;\nexport type EvmNodeType = string;\nexport const EvmNodeTypeUnknown: EvmNodeType = \"unknown\";\nexport const EvmNodeTypeFull: EvmNodeType = \"full\";\nexport const EvmNodeTypeArchive: EvmNodeType = \"archive\";\nexport type EvmSyncingState = number /* int */;\nexport const EvmSyncingStateUnknown: EvmSyncingState = 0;\nexport const EvmSyncingStateSyncing: EvmSyncingState = 1;\nexport const EvmSyncingStateNotSyncing: EvmSyncingState = 2;\nexport type EvmStatePoller = any;\n/**\n * EvmStatePollerDiagnostics contains diagnostic information about the state poller\n * including block bounds, probe status, and any detection issues.\n */\nexport interface EvmStatePollerDiagnostics {\n enabled: boolean;\n /**\n * Block head information\n */\n latestBlock: number /* int64 */;\n finalizedBlock: number /* int64 */;\n /**\n * Syncing state\n */\n syncingState: string;\n skipSyncingCheck?: boolean;\n syncingCheckError?: string;\n /**\n * Latest block detection status\n */\n skipLatestBlockCheck?: boolean;\n latestBlockFailureCount?: number /* int */;\n latestBlockSuccessfulOnce?: boolean;\n latestBlockDetectionIssue?: string;\n /**\n * Finalized block detection status\n */\n skipFinalizedCheck?: boolean;\n finalizedBlockFailureCount?: number /* int */;\n finalizedBlockSuccessfulOnce?: boolean;\n finalizedBlockDetectionIssue?: string;\n /**\n * Earliest block bounds per probe type\n */\n earliestByProbe?: { [key: EvmAvailabilityProbeType]: EvmProbeEarliestInfo | undefined};\n}\n/**\n * EvmProbeEarliestInfo contains information about earliest block detection for a specific probe type\n */\nexport interface EvmProbeEarliestInfo {\n probeType: EvmAvailabilityProbeType;\n earliestBlock: number /* int64 */;\n schedulerRunning?: boolean;\n}\n\n//////////\n// source: batch_upstream_selection.go\n\nexport interface BatchUpstreamSelectionKey {\n networkid: string;\n method: string;\n finality: DataFinalityState;\n useupstream: string;\n upstreamgroup: string;\n}\nexport interface BatchUpstreamSelectionCache {\n}\n\n//////////\n// source: cache_dal.go\n\nexport type CacheDAL = any;\n\n//////////\n// source: cache_mock.go\n\nexport interface MockCacheDal {\n mock: any /* mock.Mock */;\n}\n\n//////////\n// source: config.go\n\n/**\n * Config represents the configuration of the application.\n */\nexport interface Config {\n logLevel?: LogLevel;\n clusterKey?: string;\n server?: ServerConfig;\n healthCheck?: HealthCheckConfig;\n admin?: AdminConfig;\n database?: DatabaseConfig;\n projects?: (ProjectConfig | undefined)[];\n rateLimiters?: RateLimiterConfig;\n metrics?: MetricsConfig;\n proxyPools?: (ProxyPoolConfig | undefined)[];\n tracing?: TracingConfig;\n}\nexport interface ServerConfig {\n listenV4?: boolean;\n httpHostV4?: string;\n listenV6?: boolean;\n httpHostV6?: string;\n httpPort?: number /* int */; // Deprecated: use HttpPortV4\n httpPortV4?: number /* int */;\n httpPortV6?: number /* int */;\n maxTimeout?: Duration;\n readTimeout?: Duration;\n writeTimeout?: Duration;\n maxBatchConcurrency?: number /* int */;\n enableGzip?: boolean;\n tls?: TLSConfig;\n aliasing?: AliasingConfig;\n waitBeforeShutdown?: Duration;\n waitAfterShutdown?: Duration;\n includeErrorDetails?: boolean;\n trustedIPForwarders?: string[];\n trustedIPHeaders?: string[];\n responseHeaders?: { [key: string]: string};\n}\nexport interface HealthCheckConfig {\n mode?: HealthCheckMode;\n auth?: AuthConfig;\n defaultEval?: string;\n}\nexport type HealthCheckMode = string;\nexport const HealthCheckModeSimple: HealthCheckMode = \"simple\";\nexport const HealthCheckModeNetworks: HealthCheckMode = \"networks\";\nexport const HealthCheckModeVerbose: HealthCheckMode = \"verbose\";\nexport const EvalAnyInitializedUpstreams = \"any:initializedUpstreams\";\nexport const EvalAnyErrorRateBelow90 = \"any:errorRateBelow90\";\nexport const EvalAllErrorRateBelow90 = \"all:errorRateBelow90\";\nexport const EvalAnyErrorRateBelow100 = \"any:errorRateBelow100\";\nexport const EvalAllErrorRateBelow100 = \"all:errorRateBelow100\";\nexport const EvalEvmAnyChainId = \"any:evm:eth_chainId\";\nexport const EvalEvmAllChainId = \"all:evm:eth_chainId\";\nexport const EvalAllActiveUpstreams = \"all:activeUpstreams\";\nexport type TracingProtocol = string;\nexport const TracingProtocolHttp: TracingProtocol = \"http\";\nexport const TracingProtocolGrpc: TracingProtocol = \"grpc\";\nexport interface TracingConfig {\n enabled?: boolean;\n endpoint?: string;\n protocol?: TracingProtocol;\n sampleRate?: number /* float64 */;\n detailed?: boolean;\n serviceName?: string;\n headers?: { [key: string]: string};\n tls?: TLSConfig;\n resourceAttributes?: { [key: string]: string};\n /**\n * ForceTraceMatchers defines conditions for force-tracing requests.\n * Each matcher can specify network and/or method patterns.\n * Multiple patterns can be separated by \"|\" (OR within field).\n * Both network and method must match if both are specified (AND between fields).\n * If only one field is specified, only that field is checked.\n */\n forceTraceMatchers?: (ForceTraceMatcher | undefined)[];\n}\n/**\n * ForceTraceMatcher defines a condition for force-tracing requests.\n */\nexport interface ForceTraceMatcher {\n /**\n * Network patterns to match (e.g., \"evm:1\", \"evm:1|evm:42161\", \"evm:*\")\n * Multiple patterns separated by \"|\" act as OR conditions.\n */\n network?: string;\n /**\n * Method patterns to match (e.g., \"eth_call\", \"debug_*|trace_*\")\n * Multiple patterns separated by \"|\" act as OR conditions.\n */\n method?: string;\n}\nexport interface AdminConfig {\n auth?: AuthConfig;\n cors?: CORSConfig;\n}\nexport interface AliasingConfig {\n rules: (AliasingRuleConfig | undefined)[];\n}\nexport interface AliasingRuleConfig {\n matchDomain: string;\n serveProject: string;\n serveArchitecture: string;\n serveChain: string;\n}\nexport interface DatabaseConfig {\n evmJsonRpcCache?: CacheConfig;\n sharedState?: SharedStateConfig;\n}\nexport interface SharedStateConfig {\n /**\n * ClusterKey identifies the logical group for shared counters across replicas (multi-tenant friendly)\n */\n clusterKey?: string;\n /**\n * Connector contains the storage driver configuration (redis, postgresql, dynamodb, memory)\n */\n connector?: ConnectorConfig;\n /**\n * FallbackTimeout is the timeout for remote storage operations (get/set/publish).\n * It is a seconds-scale network timeout and NOT a foreground latency budget.\n */\n fallbackTimeout?: Duration;\n /**\n * LockTtl is the expiration for the distributed lock key in the backing store.\n * Should comfortably exceed the expected duration of remote writes.\n */\n lockTtl?: Duration;\n /**\n * LockMaxWait caps how long the foreground path will wait to acquire the lock\n * before proceeding locally and deferring the remote write to background.\n */\n lockMaxWait?: Duration;\n /**\n * UpdateMaxWait caps how long the foreground path will spend computing a new value\n * (e.g., polling latest block) before returning the current local value.\n */\n updateMaxWait?: Duration;\n}\nexport interface CacheConfig {\n /**\n * Envelope wraps cached values with a small header containing magic+version+cached-at timestamp.\n * Used for cache observability and safer evolution of cached payload formats.\n */\n envelope?: boolean;\n connectors?: TsConnectorConfig[];\n policies?: (CachePolicyConfig | undefined)[];\n compression?: CompressionConfig;\n}\nexport interface CompressionConfig {\n enabled?: boolean;\n algorithm?: string; // \"zstd\" for now, can be extended\n zstdLevel?: string; // \"fastest\", \"default\", \"better\", \"best\"\n threshold?: number /* int */; // Minimum size in bytes to compress\n}\nexport interface CacheMethodConfig {\n /**\n * Profile references a reusable workload profile from network.methods.profiles.\n */\n profile?: string;\n reqRefs: any[][];\n respRefs: any[][];\n finalized: boolean;\n realtime: boolean;\n stateful?: boolean;\n /**\n * Requires lists upstream capabilities required to route this method.\n */\n requires?: string[];\n /**\n * TranslateLatestTag controls whether the method-level tag translation should convert \"latest\" to a concrete hex block number.\n * When nil or true, translation is enabled by default.\n */\n translateLatestTag?: boolean;\n /**\n * TranslateFinalizedTag controls whether the method-level tag translation should convert \"finalized\" to a concrete hex block number.\n * When nil or true, translation is enabled by default.\n */\n translateFinalizedTag?: boolean;\n /**\n * EnforceBlockAvailability controls whether per-upstream block availability bounds (upper/lower)\n * are enforced for this method at the network level. When nil or true, enforcement is enabled.\n */\n enforceBlockAvailability?: boolean;\n /**\n * Multiplex controls method-level request coalescing. When nil, network-level multiplexing applies.\n */\n multiplex?: boolean;\n}\nexport interface CachePolicyConfig {\n connector: string;\n network?: string;\n method?: string;\n params?: any[];\n finality?: DataFinalityState;\n empty?: CacheEmptyBehavior;\n appliesTo?: 'get' | 'set' | 'both';\n minItemSize?: ByteSize;\n maxItemSize?: ByteSize;\n ttl?: Duration;\n}\nexport type ConnectorDriverType = string;\nexport const DriverMemory: ConnectorDriverType = \"memory\";\nexport const DriverRedis: ConnectorDriverType = \"redis\";\nexport const DriverPostgreSQL: ConnectorDriverType = \"postgresql\";\nexport const DriverDynamoDB: ConnectorDriverType = \"dynamodb\";\nexport const DriverGrpc: ConnectorDriverType = \"grpc\";\nexport interface ConnectorConfig {\n id?: string;\n driver: TsConnectorDriverType;\n memory?: MemoryConnectorConfig;\n redis?: RedisConnectorConfig;\n dynamodb?: DynamoDBConnectorConfig;\n postgresql?: PostgreSQLConnectorConfig;\n grpc?: GrpcConnectorConfig;\n}\nexport interface GrpcConnectorConfig {\n bootstrap?: string;\n servers?: string[];\n headers?: { [key: string]: string};\n getTimeout?: Duration;\n}\nexport interface MemoryConnectorConfig {\n maxItems: number /* int */;\n maxTotalSize: string;\n emitMetrics?: boolean;\n}\nexport interface MockConnectorConfig {\n memoryconnectorconfig: MemoryConnectorConfig;\n getdelay: number /* time in nanoseconds (time.Duration) */;\n setdelay: number /* time in nanoseconds (time.Duration) */;\n geterrorrate: number /* float64 */;\n seterrorrate: number /* float64 */;\n}\nexport interface TLSConfig {\n enabled: boolean;\n certFile: string;\n keyFile: string;\n caFile?: string;\n insecureSkipVerify?: boolean;\n}\nexport interface RedisConnectorConfig {\n addr?: string;\n username?: string;\n db?: number /* int */;\n tls?: TLSConfig;\n connPoolSize?: number /* int */;\n uri: string;\n initTimeout?: Duration;\n getTimeout?: Duration;\n setTimeout?: Duration;\n lockRetryInterval?: Duration;\n}\nexport interface DynamoDBConnectorConfig {\n table?: string;\n region?: string;\n endpoint?: string;\n auth?: AwsAuthConfig;\n partitionKeyName?: string;\n rangeKeyName?: string;\n reverseIndexName?: string;\n ttlAttributeName?: string;\n initTimeout?: Duration;\n getTimeout?: Duration;\n setTimeout?: Duration;\n maxRetries?: number /* int */;\n statePollInterval?: Duration;\n lockRetryInterval?: Duration;\n}\nexport interface PostgreSQLConnectorConfig {\n connectionUri: string;\n table: string;\n minConns?: number /* int32 */;\n maxConns?: number /* int32 */;\n initTimeout?: Duration;\n getTimeout?: Duration;\n setTimeout?: Duration;\n}\nexport interface AwsAuthConfig {\n mode: 'file' | 'env' | 'secret'; // \"file\", \"env\", \"secret\"\n credentialsFile: string;\n profile: string;\n accessKeyID: string;\n secretAccessKey: string;\n}\nexport interface ProjectConfig {\n id: string;\n auth?: AuthConfig;\n cors?: CORSConfig;\n providers?: (ProviderConfig | undefined)[];\n upstreamDefaults?: UpstreamConfig;\n upstreams?: (UpstreamConfig | undefined)[];\n networkDefaults?: NetworkDefaults;\n networks?: (NetworkConfig | undefined)[];\n rateLimitBudget?: string;\n scoreMetricsWindowSize?: Duration;\n scoreRefreshInterval?: Duration;\n /**\n * RoutingStrategy selects the upstream ordering algorithm.\n * \"score-based\" (default): penalty-based sticky routing.\n * \"round-robin\": time-rotating equal distribution across upstreams.\n * \"latency-aware\": lowest latency first (with sticky switching).\n * \"cost-aware\": prefers lower throttled/error pressure.\n * \"rendezvous\": deterministic hash-based ordering per method.\n */\n routingStrategy?: string;\n /**\n * ScoreGranularity controls whether penalties are computed per-upstream or per-method.\n * \"upstream\" (default): one penalty across all methods using aggregate metrics.\n * \"method\": separate penalty per (upstream, method) pair.\n */\n scoreGranularity?: string;\n /**\n * ScorePenaltyDecayRate is the fraction of previous penalty retained per refresh tick (0..1).\n * Lower = faster forgetting. At 0.85 with 30s ticks a penalty halves in ~2 minutes.\n * Use a negative value (e.g. -1) to disable EMA memory entirely (instant penalty = no decay).\n */\n scorePenaltyDecayRate?: number /* float64 */;\n /**\n * ScoreSwitchHysteresis prevents primary flip-flop: the challenger's penalty\n * must be at least this fraction lower than the current primary's penalty to\n * trigger a switch (0..1). For example 0.10 means 10% better. Negative disables stickiness.\n */\n scoreSwitchHysteresis?: number /* float64 */;\n /**\n * ScoreMinSwitchInterval is the cooldown between primary upstream switches.\n */\n scoreMinSwitchInterval?: Duration;\n /**\n * ScoreMetricsMode controls label cardinality for upstream score metrics for this project.\n * Allowed values:\n * - \"compact\": emit compact series by setting upstream and category labels to 'n/a'\n * - \"detailed\": emit full project/vendor/network/upstream/category series\n */\n scoreMetricsMode?: string;\n healthCheck?: DeprecatedProjectHealthCheckConfig;\n /**\n * Configure user agent tracking at the project level\n */\n userAgentMode?: UserAgentTrackingMode;\n}\n/**\n * UserAgentTrackingMode controls how user agents are recorded for metrics/labels\n */\nexport type UserAgentTrackingMode = string;\n/**\n * UserAgentTrackingModeSimplified lowers cardinality by bucketing common user agents\n */\nexport const UserAgentTrackingModeSimplified: UserAgentTrackingMode = \"simplified\";\n/**\n * UserAgentTrackingModeRaw records the user agent string as-is (high cardinality)\n */\nexport const UserAgentTrackingModeRaw: UserAgentTrackingMode = \"raw\";\nexport interface NetworkDefaults {\n rateLimitBudget?: string;\n failsafe?: (FailsafeConfig | undefined)[];\n selectionPolicy?: SelectionPolicyConfig;\n directiveDefaults?: DirectiveDefaultsConfig;\n evm?: TsEvmNetworkConfigForDefaults;\n multiplexing?: boolean;\n}\nexport interface CORSConfig {\n allowedOrigins: string[];\n allowedMethods: string[];\n allowedHeaders: string[];\n exposedHeaders: string[];\n allowCredentials?: boolean;\n maxAge: number /* int */;\n}\nexport type VendorSettings = { [key: string]: any};\nexport interface ProviderConfig {\n id?: string;\n vendor: string;\n settings?: VendorSettings;\n onlyNetworks?: string[];\n ignoreNetworks?: string[];\n upstreamIdTemplate?: string;\n overrides?: { [key: string]: UpstreamConfig | undefined};\n}\nexport interface UpstreamConfig {\n id?: string;\n type?: TsUpstreamType;\n group?: string;\n vendorName?: string;\n endpoint?: string;\n evm?: EvmUpstreamConfig;\n jsonRpc?: JsonRpcUpstreamConfig;\n ignoreMethods?: string[];\n allowMethods?: string[];\n autoIgnoreUnsupportedMethods?: boolean;\n failsafe?: (FailsafeConfig | undefined)[];\n rateLimitBudget?: string;\n rateLimitAutoTune?: RateLimitAutoTuneConfig;\n routing?: RoutingConfig;\n capabilities?: string[];\n shadow?: ShadowUpstreamConfig;\n}\nexport interface ShadowUpstreamConfig {\n enabled: boolean;\n ignoreFields?: { [key: string]: string[]};\n}\nexport interface UpstreamIntegrityConfig {\n eth_getBlockReceipts?: UpstreamIntegrityEthGetBlockReceiptsConfig;\n}\nexport interface UpstreamIntegrityEthGetBlockReceiptsConfig {\n enabled?: boolean;\n checkLogIndexStrictIncrements?: boolean;\n checkLogsBloom?: boolean;\n}\nexport interface RoutingConfig {\n scoreMultipliers: (ScoreMultiplierConfig | undefined)[];\n scoreLatencyQuantile?: number /* float64 */;\n}\nexport interface ScoreMultiplierConfig {\n network: string;\n method: string;\n finality?: DataFinalityState[];\n overall?: number /* float64 */;\n errorRate?: number /* float64 */;\n respLatency?: number /* float64 */;\n totalRequests?: number /* float64 */;\n throttledRate?: number /* float64 */;\n blockHeadLag?: number /* float64 */;\n finalizationLag?: number /* float64 */;\n misbehaviors?: number /* float64 */;\n}\nexport type Alias = UpstreamConfig;\nexport interface RateLimitAutoTuneConfig {\n enabled?: boolean;\n adjustmentPeriod: Duration;\n errorRateThreshold: number /* float64 */;\n increaseFactor: number /* float64 */;\n decreaseFactor: number /* float64 */;\n minBudget: number /* int */;\n maxBudget: number /* int */;\n}\nexport interface JsonRpcUpstreamConfig {\n supportsBatch?: boolean;\n batchMaxSize?: number /* int */;\n batchMaxWait?: Duration;\n enableGzip?: boolean;\n headers?: { [key: string]: string};\n proxyPool?: string;\n}\nexport interface EvmUpstreamConfig {\n chainId: number /* int64 */;\n statePollerInterval?: Duration;\n statePollerDebounce?: Duration;\n blockAvailability?: EvmBlockAvailabilityConfig;\n getLogsAutoSplittingRangeThreshold?: number /* int64 */;\n skipWhenSyncing?: boolean;\n integrity?: UpstreamIntegrityConfig;\n /**\n * @deprecated: use blockAvailability bounds instead; kept for config back-compat only\n */\n nodeType?: EvmNodeType;\n /**\n * @deprecated: should be removed in a future release\n */\n maxAvailableRecentBlocks?: number /* int64 */;\n}\n/**\n * EvmBlockAvailability defines optional lower/upper block availability expressions for an upstream.\n * Presence of lower/upper implies the feature is active. When both are nil, it's effectively off\n */\nexport interface EvmBlockAvailabilityConfig {\n lower?: EvmAvailabilityBoundConfig;\n upper?: EvmAvailabilityBoundConfig;\n}\n/**\n * EvmBound represents a single bound definition.\n * Exactly one of ExactBlock, LatestMinus, EarliestPlus should be set.\n * UpdateRate only applies to earliestBlockPlus bounds: 0 means freeze at first evaluation; >0 means recompute on that cadence.\n * For latestBlockMinus, updateRate is ignored: bounds are computed on-demand using the continuously-updated latest block from evmStatePoller.\n */\nexport type EvmAvailabilityProbeType = string;\nexport const EvmProbeBlockHeader: EvmAvailabilityProbeType = \"blockHeader\";\nexport const EvmProbeEventLogs: EvmAvailabilityProbeType = \"eventLogs\";\nexport const EvmProbeCallState: EvmAvailabilityProbeType = \"callState\";\nexport const EvmProbeTraceData: EvmAvailabilityProbeType = \"traceData\";\nexport interface EvmAvailabilityBoundConfig {\n exactBlock?: number /* int64 */;\n latestBlockMinus?: number /* int64 */;\n earliestBlockPlus?: number /* int64 */;\n probe?: EvmAvailabilityProbeType;\n updateRate?: Duration;\n}\nexport interface FailsafeConfig {\n matchMethod?: string;\n matchFinality?: DataFinalityState[];\n matchUpstreamGroup?: string;\n retry?: RetryPolicyConfig;\n circuitBreaker?: CircuitBreakerPolicyConfig;\n timeout?: TimeoutPolicyConfig;\n hedge?: HedgePolicyConfig;\n consensus?: ConsensusPolicyConfig;\n}\nexport interface RetryPolicyConfig {\n maxAttempts: number /* int */;\n delay?: Duration;\n backoffMaxDelay?: Duration;\n backoffFactor?: number /* float32 */;\n jitter?: Duration;\n emptyResultConfidence?: AvailbilityConfidence;\n /**\n * EmptyResultAccept lists methods for which an empty/null result is considered valid\n * and should NOT be retried (e.g. eth_getLogs, eth_call where empty is a legitimate response).\n */\n emptyResultAccept?: string[];\n /**\n * @deprecated: use EmptyResultAccept instead.\n */\n emptyResultIgnore?: string[];\n /**\n * EmptyResultMaxAttempts limits total attempts when retries are triggered due to empty responses.\n */\n emptyResultMaxAttempts?: number /* int */;\n /**\n * EmptyResultDelay is the fixed delay between retry attempts triggered by empty results.\n * When set, empty result retries wait this long instead of using the normal error delay/backoff.\n */\n emptyResultDelay?: Duration;\n /**\n * BlockUnavailableDelay is the fixed delay before retrying when all upstreams failed because the\n * requested block is not yet available (ErrUpstreamBlockUnavailable). This gives upstream nodes\n * time to receive and index the block before the retry. Typical values: 500ms-2s for fast chains.\n */\n blockUnavailableDelay?: Duration;\n}\nexport interface CircuitBreakerPolicyConfig {\n failureThresholdCount: number /* uint */;\n failureThresholdCapacity: number /* uint */;\n halfOpenAfter?: Duration;\n successThresholdCount: number /* uint */;\n successThresholdCapacity: number /* uint */;\n}\nexport interface TimeoutPolicyConfig {\n duration?: Duration;\n}\nexport interface HedgePolicyConfig {\n delay?: Duration;\n maxCount: number /* int */;\n quantile?: number /* float64 */;\n minDelay?: Duration;\n maxDelay?: Duration;\n}\nexport type ConsensusLowParticipantsBehavior = string;\nexport const ConsensusLowParticipantsBehaviorReturnError: ConsensusLowParticipantsBehavior = \"returnError\";\nexport const ConsensusLowParticipantsBehaviorAcceptMostCommonValidResult: ConsensusLowParticipantsBehavior = \"acceptMostCommonValidResult\";\nexport const ConsensusLowParticipantsBehaviorPreferBlockHeadLeader: ConsensusLowParticipantsBehavior = \"preferBlockHeadLeader\";\nexport const ConsensusLowParticipantsBehaviorOnlyBlockHeadLeader: ConsensusLowParticipantsBehavior = \"onlyBlockHeadLeader\";\nexport type ConsensusDisputeBehavior = string;\nexport const ConsensusDisputeBehaviorReturnError: ConsensusDisputeBehavior = \"returnError\";\nexport const ConsensusDisputeBehaviorAcceptMostCommonValidResult: ConsensusDisputeBehavior = \"acceptMostCommonValidResult\";\nexport const ConsensusDisputeBehaviorPreferBlockHeadLeader: ConsensusDisputeBehavior = \"preferBlockHeadLeader\";\nexport const ConsensusDisputeBehaviorOnlyBlockHeadLeader: ConsensusDisputeBehavior = \"onlyBlockHeadLeader\";\nexport interface ConsensusPolicyConfig {\n maxParticipants: number /* int */;\n agreementThreshold?: number /* int */;\n disputeBehavior?: ConsensusDisputeBehavior;\n lowParticipantsBehavior?: ConsensusLowParticipantsBehavior;\n punishMisbehavior?: PunishMisbehaviorConfig;\n disputeLogLevel?: string; // \"trace\", \"debug\", \"info\", \"warn\", \"error\"\n ignoreFields?: { [key: string]: string[]};\n preferNonEmpty?: boolean;\n preferLargerResponses?: boolean;\n misbehaviorsDestination?: MisbehaviorsDestinationConfig;\n /**\n * PreferHighestValueFor specifies methods that should use highest-value comparison\n * instead of hash-based consensus. Map key is method name, value is array of field paths.\n * Field paths: \"result\" for direct result value (e.g., eth_getTransactionCount returns hex),\n * or field name for nested result objects (e.g., \"nonce\" for result.nonce).\n * When multiple fields are specified, they act as tie-breakers in order.\n */\n preferHighestValueFor?: { [key: string]: string[]};\n /**\n * FireAndForget when true, allows consensus to return a response to the client immediately\n * upon short-circuit, but does NOT cancel in-flight requests to other upstreams.\n * This is useful for write operations like eth_sendRawTransaction where you want to\n * broadcast the transaction to as many nodes as possible while still returning quickly.\n * Default is false (normal behavior - cancel remaining requests on short-circuit).\n */\n fireAndForget?: boolean;\n}\nexport type MisbehaviorsDestinationType = string;\nexport const MisbehaviorsDestinationTypeFile: MisbehaviorsDestinationType = \"file\";\nexport const MisbehaviorsDestinationTypeS3: MisbehaviorsDestinationType = \"s3\";\nexport interface MisbehaviorsDestinationConfig {\n /**\n * Type of destination: \"file\" or \"s3\"\n */\n type: 'file' | 's3';\n /**\n * Path for file destination, or S3 URI (s3://bucket/prefix/) for S3 destination\n */\n path: string;\n /**\n * Pattern for generating file names. Supports placeholders:\n * {dateByHour} - formatted as 2006-01-02-15\n * {dateByDay} - formatted as 2006-01-02\n * {method} - the RPC method name\n * {networkId} - the network ID with : replaced by _\n * {instanceId} - unique instance identifier\n */\n filePattern?: string;\n /**\n * S3-specific settings for bulk flushing\n */\n s3?: S3FlushConfig;\n}\nexport interface S3FlushConfig {\n /**\n * Maximum number of records to buffer before flushing (default: 100)\n */\n maxRecords?: number /* int */;\n /**\n * Maximum size in bytes to buffer before flushing (default: 1MB)\n */\n maxSize?: number /* int64 */;\n /**\n * Maximum time to wait before flushing buffered records (default: 60s)\n */\n flushInterval?: Duration;\n /**\n * AWS region for S3 bucket (defaults to AWS_REGION env var)\n */\n region?: string;\n /**\n * AWS credentials config (optional). If not specified, uses standard AWS credential chain:\n * 1. Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)\n * 2. IAM role (for EC2/ECS/EKS)\n * 3. Shared credentials file (~/.aws/credentials)\n * Supported modes: \"env\", \"file\", \"secret\"\n */\n credentials?: AwsAuthConfig;\n /**\n * Content type for uploaded files (default: \"application/jsonl\")\n */\n contentType?: string;\n}\nexport interface PunishMisbehaviorConfig {\n disputeThreshold: number /* uint */;\n disputeWindow?: Duration;\n sitOutPenalty?: Duration;\n}\nexport interface RateLimiterConfig {\n store?: RateLimitStoreConfig;\n budgets: RateLimitBudgetConfig[];\n}\nexport interface RateLimitBudgetConfig {\n id: string;\n rules: RateLimitRuleConfig[];\n}\nexport interface RateLimitRuleConfig {\n method: string;\n maxCount: number /* uint32 */;\n /**\n * Period is the canonical period selector. Supported: second, minute, hour, day, week, month, year\n */\n period: RateLimitPeriod;\n waitTime?: Duration;\n perIP?: boolean;\n perUser?: boolean;\n perNetwork?: boolean;\n}\n/**\n * RateLimitPeriod enumerates supported periods for rate limiting.\n * It is an int enum to enable strong typing in TypeScript generation, while\n * marshaling to JSON/YAML as human-readable strings like \"second\", \"minute\", etc.\n */\nexport type RateLimitPeriod = number /* int */;\nexport const RateLimitPeriodSecond: RateLimitPeriod = 0;\nexport const RateLimitPeriodMinute: RateLimitPeriod = 1;\nexport const RateLimitPeriodHour: RateLimitPeriod = 2;\nexport const RateLimitPeriodDay: RateLimitPeriod = 3;\nexport const RateLimitPeriodWeek: RateLimitPeriod = 4;\nexport const RateLimitPeriodMonth: RateLimitPeriod = 5;\nexport const RateLimitPeriodYear: RateLimitPeriod = 6;\nexport interface ProxyPoolConfig {\n id: string;\n urls: string[];\n}\nexport interface DeprecatedProjectHealthCheckConfig {\n scoreMetricsWindowSize: Duration;\n}\nexport interface MethodsConfig {\n preserveDefaultMethods?: boolean;\n profiles?: { [key: string]: MethodWorkloadProfileConfig | undefined};\n definitions?: { [key: string]: CacheMethodConfig | undefined};\n}\nexport interface MethodWorkloadProfileConfig {\n cache?: MethodCacheProfileConfig;\n failsafe?: (FailsafeConfig | undefined)[];\n routing?: MethodRoutingProfileConfig;\n multiplex?: MethodMultiplexProfileConfig;\n}\nexport interface MethodCacheProfileConfig {\n reqRefs?: any[][];\n respRefs?: any[][];\n finalized?: boolean;\n realtime?: boolean;\n stateful?: boolean;\n translateLatestTag?: boolean;\n translateFinalizedTag?: boolean;\n enforceBlockAvailability?: boolean;\n}\nexport interface MethodRoutingProfileConfig {\n requires?: string[];\n}\nexport interface MethodMultiplexProfileConfig {\n enabled?: boolean;\n}\nexport interface NetworkConfig {\n architecture: TsNetworkArchitecture;\n rateLimitBudget?: string;\n failsafe?: (FailsafeConfig | undefined)[];\n evm?: EvmNetworkConfig;\n selectionPolicy?: SelectionPolicyConfig;\n directiveDefaults?: DirectiveDefaultsConfig;\n alias?: string;\n methods?: MethodsConfig;\n multiplexing?: boolean;\n}\nexport interface DirectiveDefaultsConfig {\n retryEmpty?: boolean;\n retryPending?: boolean;\n skipCacheRead?: boolean;\n cacheMaxAgeSeconds?: number /* int64 */;\n useUpstream?: string;\n skipInterpolation?: boolean;\n /**\n * Validation: Block Integrity\n */\n enforceHighestBlock?: boolean;\n enforceGetLogsBlockRange?: boolean;\n enforceNonNullTaggedBlocks?: boolean;\n /**\n * ValidateTransactionsRoot: checks transactionsRoot vs transaction count consistency.\n * Defaults to true. Disable for non-standard chains that use unusual trie roots.\n */\n validateTransactionsRoot?: boolean;\n /**\n * Validation: Header Field Lengths\n */\n validateHeaderFieldLengths?: boolean;\n /**\n * Validation: Transactions (for eth_getBlockByNumber/Hash with full txs)\n */\n validateTransactionFields?: boolean;\n validateTransactionBlockInfo?: boolean;\n /**\n * Validation: Receipts & Logs\n */\n enforceLogIndexStrictIncrements?: boolean;\n validateTxHashUniqueness?: boolean;\n validateTransactionIndex?: boolean;\n validateLogFields?: boolean;\n /**\n * Validation: Bloom Filter (simplified to 2 checks)\n * ValidateLogsBloomEmptiness: if logs exist, bloom must not be zero; if bloom is non-zero, logs must exist\n */\n validateLogsBloomEmptiness?: boolean;\n /**\n * ValidateLogsBloomMatch: recalculate bloom from logs and verify it matches the provided bloom\n */\n validateLogsBloomMatch?: boolean;\n /**\n * Validation: Receipt-to-Transaction Cross-Validation (requires GroundTruthTransactions in library-mode)\n */\n validateReceiptTransactionMatch?: boolean;\n validateContractCreation?: boolean;\n /**\n * Validation: numeric checks\n */\n receiptsCountExact?: number /* int64 */;\n receiptsCountAtLeast?: number /* int64 */;\n /**\n * Validation: Expected Ground Truths\n */\n validationExpectedBlockHash?: string;\n validationExpectedBlockNumber?: number /* int64 */;\n}\nexport interface EvmNetworkConfig {\n chainId: number /* int64 */;\n fallbackFinalityDepth?: number /* int64 */;\n fallbackStatePollerDebounce?: Duration;\n integrity?: EvmIntegrityConfig;\n getLogsMaxAllowedRange?: number /* int64 */;\n getLogsMaxAllowedAddresses?: number /* int64 */;\n getLogsMaxAllowedTopics?: number /* int64 */;\n /**\n * GetLogsMaxResponseBytes caps the decompressed upstream response size for eth_getLogs.\n * When exceeded, the request is treated as \"too large\" and split/retried with smaller sub-requests.\n * Default is set in SetDefaults(). Set to 0 to disable (not recommended in production).\n */\n getLogsMaxResponseBytes?: number /* int64 */;\n /**\n * GetLogsMaxDataBytes caps the size of a single log's `data` payload in eth_getLogs responses.\n * Logs whose payload exceeds this size are dropped before merge/cache. Set to 0 to disable.\n */\n getLogsMaxDataBytes?: number /* int64 */;\n getLogsSplitOnError?: boolean;\n getLogsSplitConcurrency?: number /* int */;\n getLogsCacheChunkSize?: number /* int64 */;\n /**\n * GetLogsCacheChunkConcurrency controls the base concurrency for cache-chunked eth_getLogs sub-requests.\n * The effective concurrency is max(GetLogsCacheChunkConcurrency, GetLogsSplitConcurrency) to ensure\n * recursive splits within cache chunks are not throttled below the split concurrency.\n */\n getLogsCacheChunkConcurrency?: number /* int */;\n /**\n * EnforceBlockAvailability controls whether the network should enforce per-upstream\n * block availability bounds (upper/lower) for methods by default. Method-level config may override.\n * When nil or true, enforcement is enabled.\n */\n enforceBlockAvailability?: boolean;\n /**\n * MaxRetryableBlockDistance controls the maximum block distance for which an upstream\n * block unavailability error is considered retryable. If the requested block is within\n * this distance from the upstream's latest block, the error is retryable (upstream may catch up).\n * If the distance is larger, the error is not retryable (upstream is too far behind).\n * Default: 128 blocks.\n */\n maxRetryableBlockDistance?: number /* int64 */;\n /**\n * MarkEmptyAsErrorMethods lists methods for which an empty/null result from an upstream\n * should be treated as a \"missing data\" error, triggering retry on other upstreams.\n * This is useful for point-lookups (blocks, transactions, receipts, traces) where an\n * empty result likely means the upstream hasn't indexed that data yet.\n * Default includes common point-lookup methods like eth_getBlockByNumber, eth_getTransactionByHash, etc.\n */\n markEmptyAsErrorMethods?: string[];\n /**\n * IdempotentTransactionBroadcast enables idempotency handling for eth_sendRawTransaction.\n * When enabled (default), \"already known\" and verified \"nonce too low\" errors are converted\n * to success responses with the transaction hash. This allows failsafe policies (retry/hedge)\n * to work safely with transaction broadcasting.\n * Set to false to disable this behavior and return raw upstream errors.\n */\n idempotentTransactionBroadcast?: boolean;\n /**\n * Multicall3Aggregation configures aggregating eth_call requests into Multicall3.\n * Accepts either a boolean (backward compat) or a full config object.\n * Default: disabled; must be explicitly enabled.\n */\n multicall3Aggregation?: Multicall3AggregationConfig;\n}\n/**\n * Multicall3AggregationConfig configures network-level batching of eth_call requests\n * into Multicall3 aggregate calls. This batches requests across all entrypoints\n * (HTTP single, HTTP batch, gRPC) rather than just JSON-RPC batch requests.\n */\nexport interface Multicall3AggregationConfig {\n /**\n * Enabled enables/disables Multicall3 aggregation. Default: false\n */\n enabled: boolean;\n /**\n * WindowMs is the maximum time (milliseconds) to wait for a batch to fill.\n * Default: 25ms\n */\n windowMs?: number /* int */;\n /**\n * MinWaitMs is the minimum time (milliseconds) to wait for additional requests\n * to join a batch. Default: 2ms\n */\n minWaitMs?: number /* int */;\n /**\n * SafetyMarginMs is subtracted from request deadlines when computing flush time.\n * Default: min(2, MinWaitMs)\n */\n safetyMarginMs?: number /* int */;\n /**\n * OnlyIfPending: if true, don't add latency unless a batch is already open.\n * Default: false\n */\n onlyIfPending?: boolean;\n /**\n * MaxCalls is the maximum number of calls per batch. Default: 20\n */\n maxCalls?: number /* int */;\n /**\n * MaxCalldataBytes is the maximum total calldata size per batch. Default: 64000\n */\n maxCalldataBytes?: number /* int */;\n /**\n * MaxQueueSize is the maximum total enqueued requests across all batches.\n * Default: 1000\n */\n maxQueueSize?: number /* int */;\n /**\n * MaxPendingBatches is the maximum number of distinct batch keys.\n * Default: 200\n */\n maxPendingBatches?: number /* int */;\n /**\n * CachePerCall enables per-call cache writes after successful Multicall3.\n * Default: true\n */\n cachePerCall?: boolean;\n /**\n * AllowCrossUserBatching: if true, requests from different users can share a batch.\n * Default: true\n */\n allowCrossUserBatching?: boolean;\n /**\n * AllowPendingTagBatching: if true, allow batching calls with \"pending\" block tag.\n * Default: false\n */\n allowPendingTagBatching?: boolean;\n /**\n * AutoDetectBypass: if true, automatically detect contracts that revert when called\n * via Multicall3 (e.g., contracts checking msg.sender code size). When a call reverts\n * in a batch but succeeds individually, the contract is added to a runtime bypass cache.\n * Default: false\n */\n autoDetectBypass?: boolean;\n /**\n * BypassContracts is a list of contract addresses that should NOT be batched via Multicall3.\n * Use this for contracts that check if msg.sender has code (e.g., Chronicle Oracle feeds)\n * and revert when called from a contract. Addresses are case-insensitive.\n * Example: [\"0x057f30e63A69175C69A4Af5656b8C9EE647De3D0\"]\n */\n bypassContracts?: string[];\n}\n/**\n * EvmIntegrityConfig is deprecated. Use DirectiveDefaultsConfig for validation settings.\n */\nexport interface EvmIntegrityConfig {\n /**\n * @deprecated: use DirectiveDefaults.EnforceHighestBlock\n */\n enforceHighestBlock?: boolean;\n /**\n * @deprecated: use DirectiveDefaults.EnforceGetLogsBlockRange\n */\n enforceGetLogsBlockRange?: boolean;\n /**\n * @deprecated: use DirectiveDefaults.EnforceNonNullTaggedBlocks\n */\n enforceNonNullTaggedBlocks?: boolean;\n}\nexport interface SelectionPolicyConfig {\n evalInterval?: Duration;\n evalFunction?: SelectionPolicyEvalFunction | undefined;\n rules?: (SelectionPolicyRuleConfig | undefined)[];\n evalPerMethod?: boolean;\n resampleExcluded?: boolean;\n resampleInterval?: Duration;\n resampleCount?: number /* int */;\n}\nexport type SelectionPolicyRuleAction = string;\nexport const SelectionPolicyRuleActionInclude: SelectionPolicyRuleAction = \"include\";\nexport const SelectionPolicyRuleActionExclude: SelectionPolicyRuleAction = \"exclude\";\nexport interface SelectionPolicyRuleConfig {\n name?: string;\n matchMethod?: string;\n matchUpstreamId?: string;\n matchUpstreamGroup?: string;\n maxErrorRate?: number /* float64 */;\n maxBlockHeadLag?: number /* float64 */;\n maxFinalizationLag?: number /* float64 */;\n maxP90ResponseSeconds?: number /* float64 */;\n maxP95ResponseSeconds?: number /* float64 */;\n maxP99ResponseSeconds?: number /* float64 */;\n maxThrottledRate?: number /* float64 */;\n action?: SelectionPolicyRuleAction;\n}\nexport type AuthType = string;\nexport const AuthTypeSecret: AuthType = \"secret\";\nexport const AuthTypeDatabase: AuthType = \"database\";\nexport const AuthTypeJwt: AuthType = \"jwt\";\nexport const AuthTypeSiwe: AuthType = \"siwe\";\nexport const AuthTypeNetwork: AuthType = \"network\";\nexport interface AuthConfig {\n strategies: TsAuthStrategyConfig[];\n}\nexport interface AuthStrategyConfig {\n ignoreMethods?: string[];\n allowMethods?: string[];\n rateLimitBudget?: string;\n type: TsAuthType;\n network?: NetworkStrategyConfig;\n secret?: SecretStrategyConfig;\n database?: DatabaseStrategyConfig;\n jwt?: JwtStrategyConfig;\n siwe?: SiweStrategyConfig;\n}\nexport interface SecretStrategyConfig {\n id: string;\n value: string;\n /**\n * RateLimitBudget, if set, is applied to the authenticated user from this strategy\n */\n rateLimitBudget?: string;\n}\nexport interface DatabaseStrategyConfig {\n connector?: ConnectorConfig;\n cache?: DatabaseStrategyCacheConfig;\n retry?: DatabaseRetryConfig;\n failOpen?: DatabaseFailOpenConfig;\n maxWait?: Duration;\n}\nexport interface DatabaseStrategyCacheConfig {\n ttl?: number /* time in nanoseconds (time.Duration) */;\n maxSize?: number /* int64 */;\n maxCost?: number /* int64 */;\n numCounters?: number /* int64 */;\n}\nexport interface DatabaseRetryConfig {\n maxAttempts?: number /* int */;\n baseBackoff?: Duration;\n}\nexport interface DatabaseFailOpenConfig {\n enabled: boolean;\n userId?: string;\n rateLimitBudget?: string;\n}\nexport interface JwtStrategyConfig {\n allowedIssuers: string[];\n allowedAudiences: string[];\n allowedAlgorithms: string[];\n requiredClaims: string[];\n verificationKeys: { [key: string]: string};\n /**\n * RateLimitBudgetClaimName is the JWT claim name that, if present,\n * will be used to set the per-user RateLimitBudget override.\n * Defaults to \"rlm\".\n */\n rateLimitBudgetClaimName?: string;\n}\nexport interface SiweStrategyConfig {\n allowedDomains: string[];\n /**\n * RateLimitBudget, if set, is applied to the authenticated user\n */\n rateLimitBudget?: string;\n}\nexport interface NetworkStrategyConfig {\n allowedIPs: string[];\n allowedCIDRs: string[];\n allowLocalhost: boolean;\n trustedProxies: string[];\n /**\n * RateLimitBudget, if set, is applied to the authenticated user (client IP)\n */\n rateLimitBudget?: string;\n ipAsUser?: boolean;\n}\nexport type LabelMode = string;\nexport const ErrorLabelModeVerbose: LabelMode = \"verbose\";\nexport const ErrorLabelModeCompact: LabelMode = \"compact\";\nexport interface MetricsConfig {\n enabled?: boolean;\n listenV4?: boolean;\n hostV4?: string;\n listenV6?: boolean;\n hostV6?: string;\n port?: number /* int */;\n errorLabelMode?: LabelMode;\n histogramBuckets?: string;\n}\n/**\n * RateLimitStoreConfig defines where rate limit counters are stored\n */\nexport interface RateLimitStoreConfig {\n driver: string; // \"redis\" | \"memory\"\n redis?: RedisConnectorConfig;\n cacheKeyPrefix?: string;\n nearLimitRatio?: number /* float32 */;\n}\n\n//////////\n// source: data.go\n\nexport type DataFinalityState = number /* int */;\n/**\n * Finalized gets 0 intentionally so that when user has not specified finality,\n * it defaults to finalized, which is safest sane default for caching.\n * This attribute will be calculated based on extracted block number (from request and/or response)\n * and comparing to the upstream (one that returned the response) 'finalized' block (fetch via evm state poller).\n */\nexport const DataFinalityStateFinalized: DataFinalityState = 0;\n/**\n * When we CAN determine the block number, and it's after the upstream 'finalized' block, we consider the data unfinalized.\n */\nexport const DataFinalityStateUnfinalized: DataFinalityState = 1;\n/**\n * Certain methods points are meant to be realtime and updated with every new block (e.g. eth_gasPrice).\n * These can be cached with short TTLs to improve performance.\n */\nexport const DataFinalityStateRealtime: DataFinalityState = 2;\n/**\n * When we CANNOT determine the block number (e.g some trace by hash calls), we consider the data unknown.\n * Most often it is safe to cache this data for longer as they're access when block hash is provided directly.\n */\nexport const DataFinalityStateUnknown: DataFinalityState = 3;\nexport type CacheEmptyBehavior = number /* int */;\nexport const CacheEmptyBehaviorIgnore: CacheEmptyBehavior = 0;\nexport const CacheEmptyBehaviorAllow: CacheEmptyBehavior = 1;\nexport const CacheEmptyBehaviorOnly: CacheEmptyBehavior = 2;\n/**\n * CachePolicyAppliesTo controls whether a cache policy applies to get, set, or both operations.\n */\nexport type CachePolicyAppliesTo = string;\nexport const CachePolicyAppliesToBoth: CachePolicyAppliesTo = \"both\";\nexport const CachePolicyAppliesToGet: CachePolicyAppliesTo = \"get\";\nexport const CachePolicyAppliesToSet: CachePolicyAppliesTo = \"set\";\n\n//////////\n// source: error_extractor.go\n\n/**\n * JsonRpcErrorExtractor allows callers to inject architecture-specific\n * JSON-RPC error normalization logic into HTTP clients without creating\n * package import cycles.\n */\nexport type JsonRpcErrorExtractor = any;\n/**\n * JsonRpcErrorExtractorFunc is an adapter to allow normal functions to be used\n * as JsonRpcErrorExtractor implementations.\n * Similar to http.HandlerFunc style adapters.\n */\nexport type JsonRpcErrorExtractorFunc = any;\n\n//////////\n// source: network.go\n\nexport type NetworkArchitecture = string;\nexport const ArchitectureEvm: NetworkArchitecture = \"evm\";\nexport type Network = any;\nexport type QuantileTracker = any;\nexport type TrackedMetrics = any;\n\n//////////\n// source: upstream.go\n\nexport type Scope = string;\n/**\n * Policies must be created with a \"network\" in mind,\n * assuming there will be many upstreams e.g. Retry might endup using a different upstream\n */\nexport const ScopeNetwork: Scope = \"network\";\n/**\n * Policies must be created with one only \"upstream\" in mind\n * e.g. Retry with be towards the same upstream\n */\nexport const ScopeUpstream: Scope = \"upstream\";\nexport type UpstreamType = string;\n/**\n * HealthTracker is an interface for tracking upstream health metrics\n */\nexport type HealthTracker = any;\nexport type Upstream = any;\n\n//////////\n// source: user.go\n\nexport interface User {\n id: string;\n ratelimitbudget: string;\n}\n"], - "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACkBO,IAAM,kBAAgC;AAOtC,IAAM,qBAAkC;AACxC,IAAM,kBAA+B;AACrC,IAAM,qBAAkC;AAExC,IAAM,yBAA0C;AAChD,IAAM,yBAA0C;AAChD,IAAM,4BAA6C;AA8mBnD,IAAM,8CAAgF;AACtF,IAAM,8DAAgG;AACtG,IAAM,wDAA0F;AAChG,IAAM,sDAAwF;AAE9F,IAAM,sCAAgE;AACtE,IAAM,sDAAgF;AACtF,IAAM,gDAA0E;AAChF,IAAM,8CAAwE;AAoH9E,IAAM,wBAAyC;AAC/C,IAAM,wBAAyC;AAC/C,IAAM,sBAAuC;AAC7C,IAAM,qBAAsC;AAC5C,IAAM,sBAAuC;AAC7C,IAAM,uBAAwC;AAC9C,IAAM,sBAAuC;AAoS7C,IAAM,iBAA2B;AAEjC,IAAM,cAAwB;AAC9B,IAAM,eAAyB;AAC/B,IAAM,kBAA4B;AA6GlC,IAAM,6BAAgD;AAItD,IAAM,+BAAkD;AAKxD,IAAM,4BAA+C;AAKrD,IAAM,2BAA8C;AAEpD,IAAM,2BAA+C;AACrD,IAAM,0BAA8C;AACpD,IAAM,yBAA6C;AA6BnD,IAAM,kBAAuC;AAa7C,IAAM,eAAsB;AAK5B,IAAM,gBAAuB;;;ADtmC7B,IAAM,eAAe,CAC1B,QACW;AACX,SAAO;AACT;", + "sourcesContent": ["export type {\n // Tygo generic replacement\n LogLevel,\n Duration,\n ByteSize,\n NetworkArchitecture,\n ConnectorDriverType,\n ConnectorConfig,\n UpstreamType,\n // Policy evaluation\n PolicyEvalUpstreamMetrics,\n PolicyEvalUpstream,\n SelectionPolicyEvalFunction,\n EvmNetworkConfigForDefaults,\n} from \"./types\";\nexport {\n // Data finality const exports\n DataFinalityStateUnfinalized,\n DataFinalityStateFinalized,\n DataFinalityStateRealtime,\n DataFinalityStateUnknown,\n // Scope exports\n ScopeNetwork,\n ScopeUpstream,\n // Cache behavior exports\n CacheEmptyBehaviorIgnore,\n CacheEmptyBehaviorAllow,\n CacheEmptyBehaviorOnly,\n // Evm node type\n EvmNodeTypeFull,\n EvmNodeTypeArchive,\n EvmNodeTypeUnknown,\n // Evm syncing type\n EvmSyncingStateUnknown,\n EvmSyncingStateSyncing,\n EvmSyncingStateNotSyncing,\n // Architecture export\n ArchitectureEvm,\n // Upstream types const exprots\n UpstreamTypeEvm,\n // Auth types\n AuthTypeSecret,\n AuthTypeJwt,\n AuthTypeSiwe,\n AuthTypeNetwork,\n // Consensus related\n ConsensusLowParticipantsBehaviorReturnError,\n ConsensusLowParticipantsBehaviorAcceptMostCommonValidResult,\n ConsensusLowParticipantsBehaviorPreferBlockHeadLeader,\n ConsensusLowParticipantsBehaviorOnlyBlockHeadLeader,\n ConsensusDisputeBehaviorReturnError,\n ConsensusDisputeBehaviorAcceptMostCommonValidResult,\n ConsensusDisputeBehaviorPreferBlockHeadLeader,\n ConsensusDisputeBehaviorOnlyBlockHeadLeader,\n // Rate limiter periods\n RateLimitPeriodSecond,\n RateLimitPeriodMinute,\n RateLimitPeriodHour,\n RateLimitPeriodDay,\n RateLimitPeriodWeek,\n RateLimitPeriodMonth,\n RateLimitPeriodYear,\n} from \"./generated\";\nexport type {\n Config,\n ProjectConfig,\n HealthCheckConfig,\n // Provider related\n ProviderConfig,\n VendorSettings,\n // Upstream related\n UpstreamConfig,\n EvmUpstreamConfig,\n EvmQueryShimConfig,\n UpstreamIntegrityConfig,\n UpstreamIntegrityEthGetBlockReceiptsConfig,\n RoutingConfig,\n ScoreMultiplierConfig,\n RateLimitAutoTuneConfig,\n JsonRpcUpstreamConfig,\n // Failsafe related\n FailsafeConfig,\n RetryPolicyConfig,\n CircuitBreakerPolicyConfig,\n HedgePolicyConfig,\n TimeoutPolicyConfig,\n ConsensusPolicyConfig,\n // Network related\n NetworkConfig,\n EvmNetworkConfig,\n EvmIntegrityConfig,\n SelectionPolicyConfig,\n DirectiveDefaultsConfig,\n // DB related\n DatabaseConfig,\n CacheConfig,\n DataFinalityState,\n CacheEmptyBehavior,\n CachePolicyConfig,\n MemoryConnectorConfig,\n RedisConnectorConfig,\n DynamoDBConnectorConfig,\n AwsAuthConfig,\n PostgreSQLConnectorConfig,\n // Auth related\n AuthStrategyConfig,\n SecretStrategyConfig,\n JwtStrategyConfig,\n SiweStrategyConfig,\n NetworkStrategyConfig,\n // Rate limits related\n RateLimiterConfig,\n RateLimitBudgetConfig,\n RateLimitRuleConfig,\n // Server config related\n ServerConfig,\n CORSConfig,\n MetricsConfig,\n AdminConfig,\n AliasingConfig,\n AliasingRuleConfig,\n TLSConfig,\n // Proxy pools related\n ProxyPoolConfig,\n} from \"./generated\";\n\nimport type { Config } from './generated'\n\nexport const createConfig = (\n cfg: Config\n): Config => {\n return cfg;\n};\n", "// Code generated by tygo. DO NOT EDIT.\nimport type {\n LogLevel,\n Duration,\n ByteSize,\n ConnectorDriverType as TsConnectorDriverType,\n ConnectorConfig as TsConnectorConfig,\n UpstreamType as TsUpstreamType,\n NetworkArchitecture as TsNetworkArchitecture,\n AuthType as TsAuthType,\n AuthStrategyConfig as TsAuthStrategyConfig,\n EvmNetworkConfigForDefaults as TsEvmNetworkConfigForDefaults,\n SelectionPolicyEvalFunction,\n BoolOrString\n} from \"./types\"\n\n//////////\n// source: architecture_evm.go\n\nexport const UpstreamTypeEvm: UpstreamType = \"evm\";\nexport type EvmUpstream = \n Upstream;\nexport type AvailbilityConfidence = number /* int */;\nexport const AvailbilityConfidenceBlockHead: AvailbilityConfidence = 1;\nexport const AvailbilityConfidenceFinalized: AvailbilityConfidence = 2;\nexport type EvmNodeType = string;\nexport const EvmNodeTypeUnknown: EvmNodeType = \"unknown\";\nexport const EvmNodeTypeFull: EvmNodeType = \"full\";\nexport const EvmNodeTypeArchive: EvmNodeType = \"archive\";\nexport type EvmSyncingState = number /* int */;\nexport const EvmSyncingStateUnknown: EvmSyncingState = 0;\nexport const EvmSyncingStateSyncing: EvmSyncingState = 1;\nexport const EvmSyncingStateNotSyncing: EvmSyncingState = 2;\nexport type EvmStatePoller = any;\n/**\n * EvmStatePollerDiagnostics contains diagnostic information about the state poller\n * including block bounds, probe status, and any detection issues.\n */\nexport interface EvmStatePollerDiagnostics {\n enabled: boolean;\n /**\n * Block head information\n */\n latestBlock: number /* int64 */;\n finalizedBlock: number /* int64 */;\n /**\n * Syncing state\n */\n syncingState: string;\n skipSyncingCheck?: boolean;\n syncingCheckError?: string;\n /**\n * Latest block detection status\n */\n skipLatestBlockCheck?: boolean;\n latestBlockFailureCount?: number /* int */;\n latestBlockSuccessfulOnce?: boolean;\n latestBlockDetectionIssue?: string;\n /**\n * Finalized block detection status\n */\n skipFinalizedCheck?: boolean;\n finalizedBlockFailureCount?: number /* int */;\n finalizedBlockSuccessfulOnce?: boolean;\n finalizedBlockDetectionIssue?: string;\n /**\n * Earliest block bounds per probe type\n */\n earliestByProbe?: { [key: EvmAvailabilityProbeType]: EvmProbeEarliestInfo | undefined};\n}\n/**\n * EvmProbeEarliestInfo contains information about earliest block detection for a specific probe type\n */\nexport interface EvmProbeEarliestInfo {\n probeType: EvmAvailabilityProbeType;\n earliestBlock: number /* int64 */;\n schedulerRunning?: boolean;\n}\n\n//////////\n// source: batch_upstream_selection.go\n\nexport interface BatchUpstreamSelectionKey {\n networkid: string;\n method: string;\n finality: DataFinalityState;\n useupstream: string;\n upstreamgroup: string;\n}\nexport interface BatchUpstreamSelectionCache {\n}\n\n//////////\n// source: cache_dal.go\n\nexport type CacheDAL = any;\n\n//////////\n// source: cache_mock.go\n\nexport interface MockCacheDal {\n mock: any /* mock.Mock */;\n}\n\n//////////\n// source: config.go\n\n/**\n * Config represents the configuration of the application.\n */\nexport interface Config {\n logLevel?: LogLevel;\n clusterKey?: string;\n server?: ServerConfig;\n healthCheck?: HealthCheckConfig;\n admin?: AdminConfig;\n database?: DatabaseConfig;\n projects?: (ProjectConfig | undefined)[];\n rateLimiters?: RateLimiterConfig;\n metrics?: MetricsConfig;\n proxyPools?: (ProxyPoolConfig | undefined)[];\n tracing?: TracingConfig;\n}\nexport interface ServerConfig {\n listenV4?: boolean;\n httpHostV4?: string;\n listenV6?: boolean;\n httpHostV6?: string;\n httpPort?: number /* int */; // Deprecated: use HttpPortV4\n httpPortV4?: number /* int */;\n httpPortV6?: number /* int */;\n grpcEnabled?: boolean;\n grpcHostV4?: string;\n grpcPortV4?: number /* int */;\n grpcHostV6?: string;\n grpcPortV6?: number /* int */;\n grpcMaxRecvMsgSize?: number /* int */;\n grpcMaxSendMsgSize?: number /* int */;\n maxTimeout?: Duration;\n readTimeout?: Duration;\n writeTimeout?: Duration;\n maxBatchConcurrency?: number /* int */;\n enableGzip?: boolean;\n tls?: TLSConfig;\n aliasing?: AliasingConfig;\n waitBeforeShutdown?: Duration;\n waitAfterShutdown?: Duration;\n includeErrorDetails?: boolean;\n trustedIPForwarders?: string[];\n trustedIPHeaders?: string[];\n responseHeaders?: { [key: string]: string};\n}\nexport interface HealthCheckConfig {\n mode?: HealthCheckMode;\n auth?: AuthConfig;\n defaultEval?: string;\n}\nexport type HealthCheckMode = string;\nexport const HealthCheckModeSimple: HealthCheckMode = \"simple\";\nexport const HealthCheckModeNetworks: HealthCheckMode = \"networks\";\nexport const HealthCheckModeVerbose: HealthCheckMode = \"verbose\";\nexport const EvalAnyInitializedUpstreams = \"any:initializedUpstreams\";\nexport const EvalAnyErrorRateBelow90 = \"any:errorRateBelow90\";\nexport const EvalAllErrorRateBelow90 = \"all:errorRateBelow90\";\nexport const EvalAnyErrorRateBelow100 = \"any:errorRateBelow100\";\nexport const EvalAllErrorRateBelow100 = \"all:errorRateBelow100\";\nexport const EvalEvmAnyChainId = \"any:evm:eth_chainId\";\nexport const EvalEvmAllChainId = \"all:evm:eth_chainId\";\nexport const EvalAllActiveUpstreams = \"all:activeUpstreams\";\nexport type TracingProtocol = string;\nexport const TracingProtocolHttp: TracingProtocol = \"http\";\nexport const TracingProtocolGrpc: TracingProtocol = \"grpc\";\nexport interface TracingConfig {\n enabled?: boolean;\n endpoint?: string;\n protocol?: TracingProtocol;\n sampleRate?: number /* float64 */;\n detailed?: boolean;\n serviceName?: string;\n headers?: { [key: string]: string};\n tls?: TLSConfig;\n resourceAttributes?: { [key: string]: string};\n /**\n * ForceTraceMatchers defines conditions for force-tracing requests.\n * Each matcher can specify network and/or method patterns.\n * Multiple patterns can be separated by \"|\" (OR within field).\n * Both network and method must match if both are specified (AND between fields).\n * If only one field is specified, only that field is checked.\n */\n forceTraceMatchers?: (ForceTraceMatcher | undefined)[];\n}\n/**\n * ForceTraceMatcher defines a condition for force-tracing requests.\n */\nexport interface ForceTraceMatcher {\n /**\n * Network patterns to match (e.g., \"evm:1\", \"evm:1|evm:42161\", \"evm:*\")\n * Multiple patterns separated by \"|\" act as OR conditions.\n */\n network?: string;\n /**\n * Method patterns to match (e.g., \"eth_call\", \"debug_*|trace_*\")\n * Multiple patterns separated by \"|\" act as OR conditions.\n */\n method?: string;\n}\nexport interface AdminConfig {\n auth?: AuthConfig;\n cors?: CORSConfig;\n}\nexport interface AliasingConfig {\n rules: (AliasingRuleConfig | undefined)[];\n}\nexport interface AliasingRuleConfig {\n matchDomain: string;\n serveProject: string;\n serveArchitecture: string;\n serveChain: string;\n}\nexport interface DatabaseConfig {\n evmJsonRpcCache?: CacheConfig;\n sharedState?: SharedStateConfig;\n}\nexport interface SharedStateConfig {\n /**\n * ClusterKey identifies the logical group for shared counters across replicas (multi-tenant friendly)\n */\n clusterKey?: string;\n /**\n * Connector contains the storage driver configuration (redis, postgresql, dynamodb, memory)\n */\n connector?: ConnectorConfig;\n /**\n * FallbackTimeout is the timeout for remote storage operations (get/set/publish).\n * It is a seconds-scale network timeout and NOT a foreground latency budget.\n */\n fallbackTimeout?: Duration;\n /**\n * LockTtl is the expiration for the distributed lock key in the backing store.\n * Should comfortably exceed the expected duration of remote writes.\n */\n lockTtl?: Duration;\n /**\n * LockMaxWait caps how long the foreground path will wait to acquire the lock\n * before proceeding locally and deferring the remote write to background.\n */\n lockMaxWait?: Duration;\n /**\n * UpdateMaxWait caps how long the foreground path will spend computing a new value\n * (e.g., polling latest block) before returning the current local value.\n */\n updateMaxWait?: Duration;\n}\nexport interface CacheConfig {\n /**\n * Envelope wraps cached values with a small header containing magic+version+cached-at timestamp.\n * Used for cache observability and safer evolution of cached payload formats.\n */\n envelope?: boolean;\n connectors?: TsConnectorConfig[];\n policies?: (CachePolicyConfig | undefined)[];\n compression?: CompressionConfig;\n}\nexport interface CompressionConfig {\n enabled?: boolean;\n algorithm?: string; // \"zstd\" for now, can be extended\n zstdLevel?: string; // \"fastest\", \"default\", \"better\", \"best\"\n threshold?: number /* int */; // Minimum size in bytes to compress\n}\nexport interface CacheMethodConfig {\n /**\n * Profile references a reusable workload profile from network.methods.profiles.\n */\n profile?: string;\n reqRefs: any[][];\n respRefs: any[][];\n finalized: boolean;\n realtime: boolean;\n stateful?: boolean;\n /**\n * Requires lists upstream capabilities required to route this method.\n */\n requires?: string[];\n /**\n * TranslateLatestTag controls whether the method-level tag translation should convert \"latest\" to a concrete hex block number.\n * When nil or true, translation is enabled by default.\n */\n translateLatestTag?: boolean;\n /**\n * TranslateFinalizedTag controls whether the method-level tag translation should convert \"finalized\" to a concrete hex block number.\n * When nil or true, translation is enabled by default.\n */\n translateFinalizedTag?: boolean;\n /**\n * EnforceBlockAvailability controls whether per-upstream block availability bounds (upper/lower)\n * are enforced for this method at the network level. When nil or true, enforcement is enabled.\n */\n enforceBlockAvailability?: boolean;\n /**\n * Multiplex controls method-level request coalescing. When nil, network-level multiplexing applies.\n */\n multiplex?: boolean;\n}\nexport interface CachePolicyConfig {\n connector: string;\n network?: string;\n method?: string;\n params?: any[];\n finality?: DataFinalityState;\n empty?: CacheEmptyBehavior;\n appliesTo?: 'get' | 'set' | 'both';\n minItemSize?: ByteSize;\n maxItemSize?: ByteSize;\n ttl?: Duration;\n}\nexport type ConnectorDriverType = string;\nexport const DriverMemory: ConnectorDriverType = \"memory\";\nexport const DriverRedis: ConnectorDriverType = \"redis\";\nexport const DriverPostgreSQL: ConnectorDriverType = \"postgresql\";\nexport const DriverDynamoDB: ConnectorDriverType = \"dynamodb\";\nexport const DriverGrpc: ConnectorDriverType = \"grpc\";\nexport interface ConnectorConfig {\n id?: string;\n driver: TsConnectorDriverType;\n memory?: MemoryConnectorConfig;\n redis?: RedisConnectorConfig;\n dynamodb?: DynamoDBConnectorConfig;\n postgresql?: PostgreSQLConnectorConfig;\n grpc?: GrpcConnectorConfig;\n failsafeForGets?: (FailsafeConfig | undefined)[];\n failsafeForSets?: (FailsafeConfig | undefined)[];\n}\nexport interface GrpcConnectorConfig {\n bootstrap?: string;\n servers?: string[];\n headers?: { [key: string]: string};\n getTimeout?: Duration;\n}\nexport interface MemoryConnectorConfig {\n maxItems: number /* int */;\n maxTotalSize: string;\n emitMetrics?: boolean;\n}\nexport interface MockConnectorConfig {\n memoryconnectorconfig: MemoryConnectorConfig;\n getdelay: number /* time in nanoseconds (time.Duration) */;\n setdelay: number /* time in nanoseconds (time.Duration) */;\n geterrorrate: number /* float64 */;\n seterrorrate: number /* float64 */;\n}\nexport interface TLSConfig {\n enabled: boolean;\n certFile: string;\n keyFile: string;\n caFile?: string;\n insecureSkipVerify?: boolean;\n}\nexport interface RedisConnectorConfig {\n addr?: string;\n username?: string;\n db?: number /* int */;\n tls?: TLSConfig;\n connPoolSize?: number /* int */;\n uri: string;\n initTimeout?: Duration;\n getTimeout?: Duration;\n setTimeout?: Duration;\n lockRetryInterval?: Duration;\n}\nexport interface DynamoDBConnectorConfig {\n table?: string;\n region?: string;\n endpoint?: string;\n auth?: AwsAuthConfig;\n partitionKeyName?: string;\n rangeKeyName?: string;\n reverseIndexName?: string;\n ttlAttributeName?: string;\n initTimeout?: Duration;\n getTimeout?: Duration;\n setTimeout?: Duration;\n maxRetries?: number /* int */;\n statePollInterval?: Duration;\n lockRetryInterval?: Duration;\n}\nexport interface PostgreSQLConnectorConfig {\n connectionUri: string;\n table: string;\n minConns?: number /* int32 */;\n maxConns?: number /* int32 */;\n initTimeout?: Duration;\n getTimeout?: Duration;\n setTimeout?: Duration;\n}\nexport interface AwsAuthConfig {\n mode: 'file' | 'env' | 'secret'; // \"file\", \"env\", \"secret\"\n credentialsFile: string;\n profile: string;\n accessKeyID: string;\n secretAccessKey: string;\n}\nexport interface ProjectConfig {\n id: string;\n auth?: AuthConfig;\n cors?: CORSConfig;\n providers?: (ProviderConfig | undefined)[];\n upstreamDefaults?: UpstreamConfig;\n upstreams?: (UpstreamConfig | undefined)[];\n networkDefaults?: NetworkDefaults;\n networks?: (NetworkConfig | undefined)[];\n rateLimitBudget?: string;\n scoreMetricsWindowSize?: Duration;\n scoreRefreshInterval?: Duration;\n /**\n * RoutingStrategy selects the upstream ordering algorithm.\n * \"score-based\" (default): penalty-based sticky routing.\n * \"round-robin\": time-rotating equal distribution across upstreams.\n * \"latency-aware\": lowest latency first (with sticky switching).\n * \"cost-aware\": prefers lower throttled/error pressure.\n * \"rendezvous\": deterministic hash-based ordering per method.\n */\n routingStrategy?: string;\n /**\n * ScoreGranularity controls whether penalties are computed per-upstream or per-method.\n * \"upstream\" (default): one penalty across all methods using aggregate metrics.\n * \"method\": separate penalty per (upstream, method) pair.\n */\n scoreGranularity?: string;\n /**\n * ScorePenaltyDecayRate is the fraction of previous penalty retained per refresh tick (0..1).\n * Lower = faster forgetting. At 0.85 with 30s ticks a penalty halves in ~2 minutes.\n * Use a negative value (e.g. -1) to disable EMA memory entirely (instant penalty = no decay).\n */\n scorePenaltyDecayRate?: number /* float64 */;\n /**\n * ScoreSwitchHysteresis prevents primary flip-flop: the challenger's penalty\n * must be at least this fraction lower than the current primary's penalty to\n * trigger a switch (0..1). For example 0.10 means 10% better. Negative disables stickiness.\n */\n scoreSwitchHysteresis?: number /* float64 */;\n /**\n * ScoreMinSwitchInterval is the cooldown between primary upstream switches.\n */\n scoreMinSwitchInterval?: Duration;\n /**\n * ScoreMetricsMode controls label cardinality for upstream score metrics for this project.\n * Allowed values:\n * - \"compact\": emit compact series by setting upstream and category labels to 'n/a'\n * - \"detailed\": emit full project/vendor/network/upstream/category series\n */\n scoreMetricsMode?: string;\n healthCheck?: DeprecatedProjectHealthCheckConfig;\n /**\n * Configure user agent tracking at the project level\n */\n userAgentMode?: UserAgentTrackingMode;\n forwardHeaders?: string[];\n ignoreMethods?: string[];\n allowMethods?: string[];\n}\n/**\n * UserAgentTrackingMode controls how user agents are recorded for metrics/labels\n */\nexport type UserAgentTrackingMode = string;\n/**\n * UserAgentTrackingModeSimplified lowers cardinality by bucketing common user agents\n */\nexport const UserAgentTrackingModeSimplified: UserAgentTrackingMode = \"simplified\";\n/**\n * UserAgentTrackingModeRaw records the user agent string as-is (high cardinality)\n */\nexport const UserAgentTrackingModeRaw: UserAgentTrackingMode = \"raw\";\nexport interface NetworkDefaults {\n rateLimitBudget?: string;\n failsafe?: (FailsafeConfig | undefined)[];\n selectionPolicy?: SelectionPolicyConfig;\n directiveDefaults?: DirectiveDefaultsConfig;\n evm?: TsEvmNetworkConfigForDefaults;\n multiplexing?: boolean;\n}\nexport interface CORSConfig {\n allowedOrigins: string[];\n allowedMethods: string[];\n allowedHeaders: string[];\n exposedHeaders: string[];\n allowCredentials?: boolean;\n maxAge: number /* int */;\n}\nexport type VendorSettings = { [key: string]: any};\nexport interface ProviderConfig {\n id?: string;\n vendor: string;\n settings?: VendorSettings;\n onlyNetworks?: string[];\n ignoreNetworks?: string[];\n upstreamIdTemplate?: string;\n overrides?: { [key: string]: UpstreamConfig | undefined};\n}\nexport interface UpstreamConfig {\n id?: string;\n type?: TsUpstreamType;\n group?: string;\n vendorName?: string;\n endpoint?: string;\n evm?: EvmUpstreamConfig;\n jsonRpc?: JsonRpcUpstreamConfig;\n ignoreMethods?: string[];\n allowMethods?: string[];\n autoIgnoreUnsupportedMethods?: boolean;\n failsafe?: (FailsafeConfig | undefined)[];\n rateLimitBudget?: string;\n rateLimitAutoTune?: RateLimitAutoTuneConfig;\n routing?: RoutingConfig;\n capabilities?: string[];\n shadow?: ShadowUpstreamConfig;\n}\nexport interface ShadowUpstreamConfig {\n enabled: boolean;\n sampleRate?: number /* float64 */;\n ignoreFields?: { [key: string]: string[]};\n}\nexport interface UpstreamIntegrityConfig {\n eth_getBlockReceipts?: UpstreamIntegrityEthGetBlockReceiptsConfig;\n}\nexport interface UpstreamIntegrityEthGetBlockReceiptsConfig {\n enabled?: boolean;\n checkLogIndexStrictIncrements?: boolean;\n checkLogsBloom?: boolean;\n}\nexport interface RoutingConfig {\n scoreMultipliers: (ScoreMultiplierConfig | undefined)[];\n scoreLatencyQuantile?: number /* float64 */;\n}\nexport interface ScoreMultiplierConfig {\n network?: string;\n method?: string;\n finality?: DataFinalityState[];\n overall?: number /* float64 */;\n errorRate?: number /* float64 */;\n respLatency?: number /* float64 */;\n totalRequests?: number /* float64 */;\n throttledRate?: number /* float64 */;\n blockHeadLag?: number /* float64 */;\n finalizationLag?: number /* float64 */;\n misbehaviors?: number /* float64 */;\n}\nexport type UJAlias = UpstreamConfig;\nexport type UYAlias = UpstreamConfig;\nexport interface RateLimitAutoTuneConfig {\n enabled?: boolean;\n adjustmentPeriod: Duration;\n errorRateThreshold: number /* float64 */;\n increaseFactor: number /* float64 */;\n decreaseFactor: number /* float64 */;\n minBudget: number /* int */;\n maxBudget: number /* int */;\n}\nexport interface JsonRpcUpstreamConfig {\n supportsBatch?: boolean;\n batchMaxSize?: number /* int */;\n batchMaxWait?: Duration;\n enableGzip?: boolean;\n headers?: { [key: string]: string};\n proxyPool?: string;\n}\nexport interface EvmUpstreamConfig {\n chainId: number /* int64 */;\n statePollerInterval?: Duration;\n /**\n * StatePollerDebounce overrides the debounce interval for the state poller.\n * When 0 (default), the interval is dynamically inferred from the chain's\n * observed block time, falling back to the network-level\n * FallbackStatePollerDebounce, then to a 1s floor.\n */\n statePollerDebounce?: Duration;\n blockAvailability?: EvmBlockAvailabilityConfig;\n getLogsAutoSplittingRangeThreshold?: number /* int64 */;\n /**\n * TraceFilterAutoSplittingRangeThreshold proactively splits trace_filter and\n * arbtrace_filter requests whose block range exceeds this value into contiguous\n * sub-requests executed concurrently and merged before returning. Zero disables\n * the feature.\n */\n traceFilterAutoSplittingRangeThreshold?: number /* int64 */;\n skipWhenSyncing?: boolean;\n integrity?: UpstreamIntegrityConfig;\n /**\n * @deprecated: use blockAvailability bounds instead; kept for config back-compat only\n */\n nodeType?: EvmNodeType;\n /**\n * @deprecated: should be removed in a future release\n */\n maxAvailableRecentBlocks?: number /* int64 */;\n queryShim?: EvmQueryShimConfig;\n}\nexport interface EvmQueryShimConfig {\n enabled?: boolean;\n allowedMethods?: string[];\n concurrency?: number /* int */;\n maxBlockRange?: number /* int64 */;\n maxLimit?: number /* int */;\n defaultLimit?: number /* int */;\n}\n/**\n * EvmBlockAvailability defines optional lower/upper block availability expressions for an upstream.\n * Presence of lower/upper implies the feature is active. When both are nil, it's effectively off\n */\nexport interface EvmBlockAvailabilityConfig {\n lower?: EvmAvailabilityBoundConfig;\n upper?: EvmAvailabilityBoundConfig;\n}\n/**\n * EvmBound represents a single bound definition.\n * Exactly one of ExactBlock, LatestMinus, EarliestPlus should be set.\n * UpdateRate only applies to earliestBlockPlus bounds: 0 means freeze at first evaluation; >0 means recompute on that cadence.\n * For latestBlockMinus, updateRate is ignored: bounds are computed on-demand using the continuously-updated latest block from evmStatePoller.\n */\nexport type EvmAvailabilityProbeType = string;\nexport const EvmProbeBlockHeader: EvmAvailabilityProbeType = \"blockHeader\";\nexport const EvmProbeEventLogs: EvmAvailabilityProbeType = \"eventLogs\";\nexport const EvmProbeCallState: EvmAvailabilityProbeType = \"callState\";\nexport const EvmProbeTraceData: EvmAvailabilityProbeType = \"traceData\";\nexport interface EvmAvailabilityBoundConfig {\n exactBlock?: number /* int64 */;\n latestBlockMinus?: number /* int64 */;\n earliestBlockPlus?: number /* int64 */;\n probe?: EvmAvailabilityProbeType;\n updateRate?: Duration;\n}\nexport interface FailsafeConfig {\n matchMethod?: string;\n matchFinality?: DataFinalityState[];\n matchUpstreamGroup?: string;\n retry?: RetryPolicyConfig;\n circuitBreaker?: CircuitBreakerPolicyConfig;\n timeout?: TimeoutPolicyConfig;\n hedge?: HedgePolicyConfig;\n consensus?: ConsensusPolicyConfig;\n}\nexport interface RetryPolicyConfig {\n maxAttempts: number /* int */;\n delay?: Duration;\n backoffMaxDelay?: Duration;\n backoffFactor?: number /* float32 */;\n jitter?: Duration;\n emptyResultConfidence?: AvailbilityConfidence;\n /**\n * EmptyResultAccept lists methods for which an empty/null result is considered valid\n * and should NOT be retried (e.g. eth_getLogs, eth_call where empty is a legitimate response).\n */\n emptyResultAccept?: string[];\n /**\n * @deprecated: use EmptyResultAccept instead.\n */\n emptyResultIgnore?: string[];\n /**\n * EmptyResultMaxAttempts limits total attempts when retries are triggered due to empty responses.\n */\n emptyResultMaxAttempts?: number /* int */;\n /**\n * EmptyResultDelay is the fixed delay between retry attempts triggered by empty results.\n * When set, empty result retries wait this long instead of using the normal error delay/backoff.\n */\n emptyResultDelay?: Duration;\n /**\n * BlockUnavailableDelay is the fixed delay before retrying when all upstreams failed because the\n * requested block is not yet available (ErrUpstreamBlockUnavailable). This gives upstream nodes\n * time to receive and index the block before the retry. Typical values: 500ms-2s for fast chains.\n */\n blockUnavailableDelay?: Duration;\n}\nexport interface CircuitBreakerPolicyConfig {\n failureThresholdCount: number /* uint */;\n failureThresholdCapacity: number /* uint */;\n halfOpenAfter?: Duration;\n successThresholdCount: number /* uint */;\n successThresholdCapacity: number /* uint */;\n}\nexport interface TimeoutPolicyConfig {\n duration?: Duration;\n quantile?: number /* float64 */;\n minDuration?: Duration;\n maxDuration?: Duration;\n}\nexport interface HedgePolicyConfig {\n delay?: Duration;\n maxCount: number /* int */;\n quantile?: number /* float64 */;\n minDelay?: Duration;\n maxDelay?: Duration;\n}\nexport type ConsensusLowParticipantsBehavior = string;\nexport const ConsensusLowParticipantsBehaviorReturnError: ConsensusLowParticipantsBehavior = \"returnError\";\nexport const ConsensusLowParticipantsBehaviorAcceptMostCommonValidResult: ConsensusLowParticipantsBehavior = \"acceptMostCommonValidResult\";\nexport const ConsensusLowParticipantsBehaviorPreferBlockHeadLeader: ConsensusLowParticipantsBehavior = \"preferBlockHeadLeader\";\nexport const ConsensusLowParticipantsBehaviorOnlyBlockHeadLeader: ConsensusLowParticipantsBehavior = \"onlyBlockHeadLeader\";\nexport type ConsensusDisputeBehavior = string;\nexport const ConsensusDisputeBehaviorReturnError: ConsensusDisputeBehavior = \"returnError\";\nexport const ConsensusDisputeBehaviorAcceptMostCommonValidResult: ConsensusDisputeBehavior = \"acceptMostCommonValidResult\";\nexport const ConsensusDisputeBehaviorPreferBlockHeadLeader: ConsensusDisputeBehavior = \"preferBlockHeadLeader\";\nexport const ConsensusDisputeBehaviorOnlyBlockHeadLeader: ConsensusDisputeBehavior = \"onlyBlockHeadLeader\";\nexport interface ConsensusPolicyConfig {\n maxParticipants: number /* int */;\n agreementThreshold?: number /* int */;\n disputeBehavior?: ConsensusDisputeBehavior;\n lowParticipantsBehavior?: ConsensusLowParticipantsBehavior;\n punishMisbehavior?: PunishMisbehaviorConfig;\n disputeLogLevel?: string; // \"trace\", \"debug\", \"info\", \"warn\", \"error\"\n ignoreFields?: { [key: string]: string[]};\n preferNonEmpty?: boolean;\n preferLargerResponses?: boolean;\n misbehaviorsDestination?: MisbehaviorsDestinationConfig;\n /**\n * PreferHighestValueFor specifies methods that should use highest-value comparison\n * instead of hash-based consensus. Map key is method name, value is array of field paths.\n * Field paths: \"result\" for direct result value (e.g., eth_getTransactionCount returns hex),\n * or field name for nested result objects (e.g., \"nonce\" for result.nonce).\n * When multiple fields are specified, they act as tie-breakers in order.\n */\n preferHighestValueFor?: { [key: string]: string[]};\n /**\n * FireAndForget when true, allows consensus to return a response to the client immediately\n * upon short-circuit, but does NOT cancel in-flight requests to other upstreams.\n * This is useful for write operations like eth_sendRawTransaction where you want to\n * broadcast the transaction to as many nodes as possible while still returning quickly.\n * Default is false (normal behavior - cancel remaining requests on short-circuit).\n */\n fireAndForget?: boolean;\n}\nexport type MisbehaviorsDestinationType = string;\nexport const MisbehaviorsDestinationTypeFile: MisbehaviorsDestinationType = \"file\";\nexport const MisbehaviorsDestinationTypeS3: MisbehaviorsDestinationType = \"s3\";\nexport interface MisbehaviorsDestinationConfig {\n /**\n * Type of destination: \"file\" or \"s3\"\n */\n type: 'file' | 's3';\n /**\n * Path for file destination, or S3 URI (s3://bucket/prefix/) for S3 destination\n */\n path: string;\n /**\n * Pattern for generating file names. Supports placeholders:\n * {dateByHour} - formatted as 2006-01-02-15\n * {dateByDay} - formatted as 2006-01-02\n * {method} - the RPC method name\n * {networkId} - the network ID with : replaced by _\n * {instanceId} - unique instance identifier\n */\n filePattern?: string;\n /**\n * S3-specific settings for bulk flushing\n */\n s3?: S3FlushConfig;\n}\nexport interface S3FlushConfig {\n /**\n * Maximum number of records to buffer before flushing (default: 100)\n */\n maxRecords?: number /* int */;\n /**\n * Maximum size in bytes to buffer before flushing (default: 1MB)\n */\n maxSize?: number /* int64 */;\n /**\n * Maximum time to wait before flushing buffered records (default: 60s)\n */\n flushInterval?: Duration;\n /**\n * AWS region for S3 bucket (defaults to AWS_REGION env var)\n */\n region?: string;\n /**\n * AWS credentials config (optional). If not specified, uses standard AWS credential chain:\n * 1. Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)\n * 2. IAM role (for EC2/ECS/EKS)\n * 3. Shared credentials file (~/.aws/credentials)\n * Supported modes: \"env\", \"file\", \"secret\"\n */\n credentials?: AwsAuthConfig;\n /**\n * Content type for uploaded files (default: \"application/jsonl\")\n */\n contentType?: string;\n}\nexport interface PunishMisbehaviorConfig {\n disputeThreshold: number /* uint */;\n disputeWindow?: Duration;\n sitOutPenalty?: Duration;\n}\nexport interface RateLimiterConfig {\n store?: RateLimitStoreConfig;\n budgets: RateLimitBudgetConfig[];\n}\nexport interface RateLimitBudgetConfig {\n id: string;\n rules: RateLimitRuleConfig[];\n}\nexport interface RateLimitRuleConfig {\n method: string;\n maxCount: number /* uint32 */;\n /**\n * Period is the canonical period selector. Supported: second, minute, hour, day, week, month, year\n */\n period: RateLimitPeriod;\n waitTime?: Duration;\n perIP?: boolean;\n perUser?: boolean;\n perNetwork?: boolean;\n}\n/**\n * RateLimitPeriod enumerates supported periods for rate limiting.\n * It is an int enum to enable strong typing in TypeScript generation, while\n * marshaling to JSON/YAML as human-readable strings like \"second\", \"minute\", etc.\n */\nexport type RateLimitPeriod = number /* int */;\nexport const RateLimitPeriodSecond: RateLimitPeriod = 0;\nexport const RateLimitPeriodMinute: RateLimitPeriod = 1;\nexport const RateLimitPeriodHour: RateLimitPeriod = 2;\nexport const RateLimitPeriodDay: RateLimitPeriod = 3;\nexport const RateLimitPeriodWeek: RateLimitPeriod = 4;\nexport const RateLimitPeriodMonth: RateLimitPeriod = 5;\nexport const RateLimitPeriodYear: RateLimitPeriod = 6;\nexport interface ProxyPoolConfig {\n id: string;\n urls: string[];\n}\nexport interface DeprecatedProjectHealthCheckConfig {\n scoreMetricsWindowSize: Duration;\n}\nexport interface MethodsConfig {\n preserveDefaultMethods?: boolean;\n profiles?: { [key: string]: MethodWorkloadProfileConfig | undefined};\n definitions?: { [key: string]: CacheMethodConfig | undefined};\n}\nexport interface MethodWorkloadProfileConfig {\n cache?: MethodCacheProfileConfig;\n failsafe?: (FailsafeConfig | undefined)[];\n routing?: MethodRoutingProfileConfig;\n multiplex?: MethodMultiplexProfileConfig;\n}\nexport interface MethodCacheProfileConfig {\n reqRefs?: any[][];\n respRefs?: any[][];\n finalized?: boolean;\n realtime?: boolean;\n stateful?: boolean;\n translateLatestTag?: boolean;\n translateFinalizedTag?: boolean;\n enforceBlockAvailability?: boolean;\n}\nexport interface MethodRoutingProfileConfig {\n requires?: string[];\n}\nexport interface MethodMultiplexProfileConfig {\n enabled?: boolean;\n}\nexport interface NetworkConfig {\n architecture: TsNetworkArchitecture;\n rateLimitBudget?: string;\n failsafe?: (FailsafeConfig | undefined)[];\n evm?: EvmNetworkConfig;\n selectionPolicy?: SelectionPolicyConfig;\n directiveDefaults?: DirectiveDefaultsConfig;\n alias?: string;\n methods?: MethodsConfig;\n multiplexing?: boolean;\n staticResponses?: (StaticResponseConfig | undefined)[];\n}\n/**\n * StaticResponseConfig declares a canned JSON-RPC response for a specific\n * (method, params) pair on a network.\n */\nexport interface StaticResponseConfig {\n method: string;\n params?: any[];\n response?: StaticResponseBodyConfig;\n}\n/**\n * StaticResponseBodyConfig holds the JSON-RPC payload to serve. Exactly one\n * of Result or Error must be set.\n */\nexport interface StaticResponseBodyConfig {\n result?: any;\n error?: StaticResponseErrorConfig;\n}\n/**\n * StaticResponseErrorConfig mirrors a JSON-RPC error object.\n */\nexport interface StaticResponseErrorConfig {\n code: number /* int */;\n message: string;\n data?: any;\n}\nexport interface DirectiveDefaultsConfig {\n retryEmpty?: boolean;\n retryPending?: boolean;\n skipCacheRead?: any;\n cacheMaxAgeSeconds?: number /* int64 */;\n useUpstream?: string;\n skipInterpolation?: boolean;\n /**\n * Validation: Block Integrity\n */\n enforceHighestBlock?: boolean;\n enforceGetLogsBlockRange?: boolean;\n enforceNonNullTaggedBlocks?: boolean;\n /**\n * ValidateTransactionsRoot: checks transactionsRoot vs transaction count consistency.\n * Defaults to true. Disable for non-standard chains that use unusual trie roots.\n */\n validateTransactionsRoot?: boolean;\n /**\n * Validation: Header Field Lengths\n */\n validateHeaderFieldLengths?: boolean;\n /**\n * Validation: Transactions (for eth_getBlockByNumber/Hash with full txs)\n */\n validateTransactionFields?: boolean;\n validateTransactionBlockInfo?: boolean;\n /**\n * Validation: Receipts & Logs\n */\n enforceLogIndexStrictIncrements?: boolean;\n validateTxHashUniqueness?: boolean;\n validateTransactionIndex?: boolean;\n validateLogFields?: boolean;\n /**\n * Validation: Bloom Filter (simplified to 2 checks)\n * ValidateLogsBloomEmptiness: if logs exist, bloom must not be zero; if bloom is non-zero, logs must exist\n */\n validateLogsBloomEmptiness?: boolean;\n /**\n * ValidateLogsBloomMatch: recalculate bloom from logs and verify it matches the provided bloom\n */\n validateLogsBloomMatch?: boolean;\n /**\n * Validation: Receipt-to-Transaction Cross-Validation (requires GroundTruthTransactions in library-mode)\n */\n validateReceiptTransactionMatch?: boolean;\n validateContractCreation?: boolean;\n /**\n * Validation: numeric checks\n */\n receiptsCountExact?: number /* int64 */;\n receiptsCountAtLeast?: number /* int64 */;\n /**\n * Validation: Expected Ground Truths\n */\n validationExpectedBlockHash?: string;\n validationExpectedBlockNumber?: number /* int64 */;\n}\nexport interface EvmNetworkConfig {\n chainId: number /* int64 */;\n fallbackFinalityDepth?: number /* int64 */;\n fallbackStatePollerDebounce?: Duration;\n integrity?: EvmIntegrityConfig;\n getLogsMaxAllowedRange?: number /* int64 */;\n getLogsMaxAllowedAddresses?: number /* int64 */;\n getLogsMaxAllowedTopics?: number /* int64 */;\n /**\n * GetLogsMaxResponseBytes caps the decompressed upstream response size for eth_getLogs.\n * When exceeded, the request is treated as \"too large\" and split/retried with smaller sub-requests.\n * Default is set in SetDefaults(). Set to 0 to disable (not recommended in production).\n */\n getLogsMaxResponseBytes?: number /* int64 */;\n /**\n * GetLogsMaxDataBytes caps the size of a single log's `data` payload in eth_getLogs responses.\n * Logs whose payload exceeds this size are dropped before merge/cache. Set to 0 to disable.\n */\n getLogsMaxDataBytes?: number /* int64 */;\n getLogsSplitOnError?: boolean;\n getLogsSplitConcurrency?: number /* int */;\n getLogsCacheChunkSize?: number /* int64 */;\n /**\n * GetLogsCacheChunkConcurrency controls the base concurrency for cache-chunked eth_getLogs sub-requests.\n * The effective concurrency is max(GetLogsCacheChunkConcurrency, GetLogsSplitConcurrency) to ensure\n * recursive splits within cache chunks are not throttled below the split concurrency.\n */\n getLogsCacheChunkConcurrency?: number /* int */;\n /**\n * TraceFilterSplitOnError controls reactive splitting for trace_filter and\n * arbtrace_filter requests when the upstream returns a range-too-large error.\n * Nil disables the feature.\n */\n traceFilterSplitOnError?: boolean;\n /**\n * TraceFilterSplitConcurrency caps in-flight sub-requests when a trace_filter\n * or arbtrace_filter request is split. Zero falls back to 10.\n */\n traceFilterSplitConcurrency?: number /* int */;\n /**\n * EnforceBlockAvailability controls whether the network should enforce per-upstream\n * block availability bounds (upper/lower) for methods by default. Method-level config may override.\n * When nil or true, enforcement is enabled.\n */\n enforceBlockAvailability?: boolean;\n /**\n * MaxRetryableBlockDistance controls the maximum block distance for which an upstream\n * block unavailability error is considered retryable. If the requested block is within\n * this distance from the upstream's latest block, the error is retryable (upstream may catch up).\n * If the distance is larger, the error is not retryable (upstream is too far behind).\n * Default: 128 blocks.\n */\n maxRetryableBlockDistance?: number /* int64 */;\n /**\n * MarkEmptyAsErrorMethods lists methods for which an empty/null result from an upstream\n * should be treated as a \"missing data\" error, triggering retry on other upstreams.\n * This is useful for point-lookups (blocks, transactions, receipts, traces) where an\n * empty result likely means the upstream hasn't indexed that data yet.\n * Default includes common point-lookup methods like eth_getBlockByNumber, eth_getTransactionByHash, etc.\n */\n markEmptyAsErrorMethods?: string[];\n /**\n * DynamicBlockTimeDebounceMultiplier scales the EMA-estimated block time to derive\n * the debounce interval for block polling. A value of 0.7 means debounce = 70% of\n * the estimated block time, preferring fresher data at the cost of slightly more\n * polling. Lower values reduce staleness risk; higher values reduce RPC calls.\n * Default: 0.7 (30% under the estimated block time).\n */\n dynamicBlockTimeDebounceMultiplier?: number /* float64 */;\n /**\n * BlockUnavailableDelayMultiplier scales the EMA-estimated block time to derive\n * the retry delay when all upstreams return ErrUpstreamBlockUnavailable. When the\n * dynamic block time is known, the delay is blockTime * this multiplier.\n * Falls back to the static RetryPolicyConfig.BlockUnavailableDelay when block time\n * is not yet available. Default: 0.8.\n */\n blockUnavailableDelayMultiplier?: number /* float64 */;\n /**\n * IdempotentTransactionBroadcast enables idempotency handling for eth_sendRawTransaction.\n * When enabled (default), \"already known\" and verified \"nonce too low\" errors are converted\n * to success responses with the transaction hash. This allows failsafe policies (retry/hedge)\n * to work safely with transaction broadcasting.\n * Set to false to disable this behavior and return raw upstream errors.\n */\n idempotentTransactionBroadcast?: boolean;\n /**\n * Multicall3Aggregation configures aggregating eth_call requests into Multicall3.\n * Accepts either a boolean (backward compat) or a full config object.\n * Default: disabled; must be explicitly enabled.\n */\n multicall3Aggregation?: Multicall3AggregationConfig;\n}\n/**\n * Multicall3AggregationConfig configures network-level batching of eth_call requests\n * into Multicall3 aggregate calls. This batches requests across all entrypoints\n * (HTTP single, HTTP batch, gRPC) rather than just JSON-RPC batch requests.\n */\nexport interface Multicall3AggregationConfig {\n /**\n * Enabled enables/disables Multicall3 aggregation. Default: false\n */\n enabled: boolean;\n /**\n * WindowMs is the maximum time (milliseconds) to wait for a batch to fill.\n * Default: 25ms\n */\n windowMs?: number /* int */;\n /**\n * MinWaitMs is the minimum time (milliseconds) to wait for additional requests\n * to join a batch. Default: 2ms\n */\n minWaitMs?: number /* int */;\n /**\n * SafetyMarginMs is subtracted from request deadlines when computing flush time.\n * Default: min(2, MinWaitMs)\n */\n safetyMarginMs?: number /* int */;\n /**\n * OnlyIfPending: if true, don't add latency unless a batch is already open.\n * Default: false\n */\n onlyIfPending?: boolean;\n /**\n * MaxCalls is the maximum number of calls per batch. Default: 20\n */\n maxCalls?: number /* int */;\n /**\n * MaxCalldataBytes is the maximum total calldata size per batch. Default: 64000\n */\n maxCalldataBytes?: number /* int */;\n /**\n * MaxQueueSize is the maximum total enqueued requests across all batches.\n * Default: 1000\n */\n maxQueueSize?: number /* int */;\n /**\n * MaxPendingBatches is the maximum number of distinct batch keys.\n * Default: 200\n */\n maxPendingBatches?: number /* int */;\n /**\n * CachePerCall enables per-call cache writes after successful Multicall3.\n * Default: true\n */\n cachePerCall?: boolean;\n /**\n * AllowCrossUserBatching: if true, requests from different users can share a batch.\n * Default: true\n */\n allowCrossUserBatching?: boolean;\n /**\n * AllowPendingTagBatching: if true, allow batching calls with \"pending\" block tag.\n * Default: false\n */\n allowPendingTagBatching?: boolean;\n /**\n * AutoDetectBypass: if true, automatically detect contracts that revert when called\n * via Multicall3 (e.g., contracts checking msg.sender code size). When a call reverts\n * in a batch but succeeds individually, the contract is added to a runtime bypass cache.\n * Default: false\n */\n autoDetectBypass?: boolean;\n /**\n * BypassContracts is a list of contract addresses that should NOT be batched via Multicall3.\n * Use this for contracts that check if msg.sender has code (e.g., Chronicle Oracle feeds)\n * and revert when called from a contract. Addresses are case-insensitive.\n * Example: [\"0x057f30e63A69175C69A4Af5656b8C9EE647De3D0\"]\n */\n bypassContracts?: string[];\n}\n/**\n * EvmIntegrityConfig is deprecated. Use DirectiveDefaultsConfig for validation settings.\n */\nexport interface EvmIntegrityConfig {\n /**\n * @deprecated: use DirectiveDefaults.EnforceHighestBlock\n */\n enforceHighestBlock?: boolean;\n /**\n * @deprecated: use DirectiveDefaults.EnforceGetLogsBlockRange\n */\n enforceGetLogsBlockRange?: boolean;\n /**\n * @deprecated: use DirectiveDefaults.EnforceNonNullTaggedBlocks\n */\n enforceNonNullTaggedBlocks?: boolean;\n}\nexport interface SelectionPolicyConfig {\n evalInterval?: Duration;\n evalFunction?: SelectionPolicyEvalFunction | undefined;\n rules?: (SelectionPolicyRuleConfig | undefined)[];\n evalPerMethod?: boolean;\n resampleExcluded?: boolean;\n resampleInterval?: Duration;\n resampleCount?: number /* int */;\n}\nexport type SelectionPolicyRuleAction = string;\nexport const SelectionPolicyRuleActionInclude: SelectionPolicyRuleAction = \"include\";\nexport const SelectionPolicyRuleActionExclude: SelectionPolicyRuleAction = \"exclude\";\nexport interface SelectionPolicyRuleConfig {\n name?: string;\n matchMethod?: string;\n matchUpstreamId?: string;\n matchUpstreamGroup?: string;\n maxErrorRate?: number /* float64 */;\n maxBlockHeadLag?: number /* float64 */;\n maxFinalizationLag?: number /* float64 */;\n maxP90ResponseSeconds?: number /* float64 */;\n maxP95ResponseSeconds?: number /* float64 */;\n maxP99ResponseSeconds?: number /* float64 */;\n maxThrottledRate?: number /* float64 */;\n action?: SelectionPolicyRuleAction;\n}\nexport type AuthType = string;\nexport const AuthTypeSecret: AuthType = \"secret\";\nexport const AuthTypeDatabase: AuthType = \"database\";\nexport const AuthTypeJwt: AuthType = \"jwt\";\nexport const AuthTypeSiwe: AuthType = \"siwe\";\nexport const AuthTypeNetwork: AuthType = \"network\";\nexport const AuthTypeX402: AuthType = \"x402\";\nexport interface AuthConfig {\n strategies: TsAuthStrategyConfig[];\n}\nexport interface AuthStrategyConfig {\n ignoreMethods?: string[];\n allowMethods?: string[];\n rateLimitBudget?: string;\n type: TsAuthType;\n network?: NetworkStrategyConfig;\n secret?: SecretStrategyConfig;\n database?: DatabaseStrategyConfig;\n jwt?: JwtStrategyConfig;\n siwe?: SiweStrategyConfig;\n x402?: X402StrategyConfig;\n}\nexport interface SecretStrategyConfig {\n id: string;\n value: string;\n /**\n * RateLimitBudget, if set, is applied to the authenticated user from this strategy\n */\n rateLimitBudget?: string;\n}\nexport interface DatabaseStrategyConfig {\n connector?: ConnectorConfig;\n cache?: DatabaseStrategyCacheConfig;\n retry?: DatabaseRetryConfig;\n failOpen?: DatabaseFailOpenConfig;\n maxWait?: Duration;\n}\nexport interface DatabaseStrategyCacheConfig {\n ttl?: number /* time in nanoseconds (time.Duration) */;\n maxSize?: number /* int64 */;\n maxCost?: number /* int64 */;\n numCounters?: number /* int64 */;\n}\nexport interface DatabaseRetryConfig {\n maxAttempts?: number /* int */;\n baseBackoff?: Duration;\n}\nexport interface DatabaseFailOpenConfig {\n enabled: boolean;\n userId?: string;\n rateLimitBudget?: string;\n}\nexport interface JwtStrategyConfig {\n allowedIssuers: string[];\n allowedAudiences: string[];\n allowedAlgorithms: string[];\n requiredClaims: string[];\n verificationKeys: { [key: string]: string};\n /**\n * RateLimitBudgetClaimName is the JWT claim name that, if present,\n * will be used to set the per-user RateLimitBudget override.\n * Defaults to \"rlm\".\n */\n rateLimitBudgetClaimName?: string;\n}\nexport interface SiweStrategyConfig {\n allowedDomains: string[];\n /**\n * RateLimitBudget, if set, is applied to the authenticated user\n */\n rateLimitBudget?: string;\n}\nexport interface NetworkStrategyConfig {\n allowedIPs: string[];\n allowedCIDRs: string[];\n allowLocalhost: boolean;\n trustedProxies: string[];\n /**\n * RateLimitBudget, if set, is applied to the authenticated user (client IP)\n */\n rateLimitBudget?: string;\n ipAsUser?: boolean;\n}\n/**\n * X402StrategyConfig enables x402 payment authentication (HTTP 402 Payment Required).\n */\nexport interface X402StrategyConfig {\n /**\n * FacilitatorURL is the x402 facilitator endpoint for verify/settle operations.\n */\n facilitatorUrl: string;\n /**\n * SellerAddress is the wallet address that receives payments.\n */\n sellerAddress: string;\n /**\n * PricePerRequest is the cost per request in atomic units.\n */\n pricePerRequest: string;\n /**\n * Network is the x402 network name for payment.\n */\n network: string;\n /**\n * Asset is the token contract address used for payment.\n */\n asset?: string;\n /**\n * Scheme is the x402 payment scheme.\n */\n scheme?: string;\n /**\n * Description is a human-readable description included in 402 responses.\n */\n description?: string;\n /**\n * MaxTimeoutSeconds is the payment authorization validity period.\n */\n maxTimeoutSeconds?: number /* int */;\n /**\n * RateLimitBudget, if set, is applied to the authenticated payer.\n */\n rateLimitBudget?: string;\n /**\n * VerifyOnly when true skips settlement.\n */\n verifyOnly?: boolean;\n /**\n * Extra contains additional fields merged into the payment requirement's extra object.\n */\n extra?: { [key: string]: any};\n}\nexport type LabelMode = string;\nexport const ErrorLabelModeVerbose: LabelMode = \"verbose\";\nexport const ErrorLabelModeCompact: LabelMode = \"compact\";\nexport interface MetricsConfig {\n enabled?: boolean;\n listenV4?: boolean;\n hostV4?: string;\n listenV6?: boolean;\n hostV6?: string;\n port?: number /* int */;\n errorLabelMode?: LabelMode;\n histogramBuckets?: string;\n /**\n * HistogramDropLabels removes these labels from every histogram. Counters\n * and gauges are unaffected. Useful to cap per-instance /metrics response\n * size when high-cardinality labels (e.g. \"user\") push a scrape past the\n * managed scraper's sample/body limits.\n */\n histogramDropLabels?: string[];\n /**\n * HistogramLabelOverrides re-adds labels for specific histograms even if\n * they appear in HistogramDropLabels. Key is the metric Name (without the\n * \"erpc_\" namespace prefix), e.g. \"network_request_duration_seconds\".\n * Value is the list of label names to keep for that metric.\n */\n histogramLabelOverrides?: { [key: string]: string[]};\n}\n/**\n * RateLimitStoreConfig defines where rate limit counters are stored\n */\nexport interface RateLimitStoreConfig {\n driver: string; // \"redis\" | \"memory\"\n redis?: RedisConnectorConfig;\n cacheKeyPrefix?: string;\n nearLimitRatio?: number /* float32 */;\n}\n\n//////////\n// source: data.go\n\nexport type DataFinalityState = number /* int */;\n/**\n * Finalized gets 0 intentionally so that when user has not specified finality,\n * it defaults to finalized, which is safest sane default for caching.\n * This attribute will be calculated based on extracted block number (from request and/or response)\n * and comparing to the upstream (one that returned the response) 'finalized' block (fetch via evm state poller).\n */\nexport const DataFinalityStateFinalized: DataFinalityState = 0;\n/**\n * When we CAN determine the block number, and it's after the upstream 'finalized' block, we consider the data unfinalized.\n */\nexport const DataFinalityStateUnfinalized: DataFinalityState = 1;\n/**\n * Certain methods points are meant to be realtime and updated with every new block (e.g. eth_gasPrice).\n * These can be cached with short TTLs to improve performance.\n */\nexport const DataFinalityStateRealtime: DataFinalityState = 2;\n/**\n * When we CANNOT determine the block number (e.g some trace by hash calls), we consider the data unknown.\n * Most often it is safe to cache this data for longer as they're access when block hash is provided directly.\n */\nexport const DataFinalityStateUnknown: DataFinalityState = 3;\nexport type CacheEmptyBehavior = number /* int */;\nexport const CacheEmptyBehaviorIgnore: CacheEmptyBehavior = 0;\nexport const CacheEmptyBehaviorAllow: CacheEmptyBehavior = 1;\nexport const CacheEmptyBehaviorOnly: CacheEmptyBehavior = 2;\n/**\n * CachePolicyAppliesTo controls whether a cache policy applies to get, set, or both operations.\n */\nexport type CachePolicyAppliesTo = string;\nexport const CachePolicyAppliesToBoth: CachePolicyAppliesTo = \"both\";\nexport const CachePolicyAppliesToGet: CachePolicyAppliesTo = \"get\";\nexport const CachePolicyAppliesToSet: CachePolicyAppliesTo = \"set\";\n\n//////////\n// source: error_extractor.go\n\n/**\n * JsonRpcErrorExtractor allows callers to inject architecture-specific\n * JSON-RPC error normalization logic into HTTP clients without creating\n * package import cycles.\n */\nexport type JsonRpcErrorExtractor = any;\n/**\n * JsonRpcErrorExtractorFunc is an adapter to allow normal functions to be used\n * as JsonRpcErrorExtractor implementations.\n * Similar to http.HandlerFunc style adapters.\n */\nexport type JsonRpcErrorExtractorFunc = any;\n\n//////////\n// source: network.go\n\nexport type NetworkArchitecture = string;\nexport const ArchitectureEvm: NetworkArchitecture = \"evm\";\nexport type Network = any;\nexport type QuantileTracker = any;\nexport type TrackedMetrics = any;\n\n//////////\n// source: upstream.go\n\nexport type Scope = string;\n/**\n * Policies must be created with a \"network\" in mind,\n * assuming there will be many upstreams e.g. Retry might endup using a different upstream\n */\nexport const ScopeNetwork: Scope = \"network\";\n/**\n * Policies must be created with one only \"upstream\" in mind\n * e.g. Retry with be towards the same upstream\n */\nexport const ScopeUpstream: Scope = \"upstream\";\nexport type UpstreamType = string;\n/**\n * HealthTracker is an interface for tracking upstream health metrics\n */\nexport type HealthTracker = any;\nexport type Upstream = any;\n\n//////////\n// source: user.go\n\nexport interface User {\n id: string;\n ratelimitbudget: string;\n}\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmBO,IAAM,kBAAgC;AAOtC,IAAM,qBAAkC;AACxC,IAAM,kBAA+B;AACrC,IAAM,qBAAkC;AAExC,IAAM,yBAA0C;AAChD,IAAM,yBAA0C;AAChD,IAAM,4BAA6C;AAqpBnD,IAAM,8CAAgF;AACtF,IAAM,8DAAgG;AACtG,IAAM,wDAA0F;AAChG,IAAM,sDAAwF;AAE9F,IAAM,sCAAgE;AACtE,IAAM,sDAAgF;AACtF,IAAM,gDAA0E;AAChF,IAAM,8CAAwE;AAoH9E,IAAM,wBAAyC;AAC/C,IAAM,wBAAyC;AAC/C,IAAM,sBAAuC;AAC7C,IAAM,qBAAsC;AAC5C,IAAM,sBAAuC;AAC7C,IAAM,uBAAwC;AAC9C,IAAM,sBAAuC;AAyV7C,IAAM,iBAA2B;AAEjC,IAAM,cAAwB;AAC9B,IAAM,eAAyB;AAC/B,IAAM,kBAA4B;AA8KlC,IAAM,6BAAgD;AAItD,IAAM,+BAAkD;AAKxD,IAAM,4BAA+C;AAKrD,IAAM,2BAA8C;AAEpD,IAAM,2BAA+C;AACrD,IAAM,0BAA8C;AACpD,IAAM,yBAA6C;AA6BnD,IAAM,kBAAuC;AAa7C,IAAM,eAAsB;AAK5B,IAAM,gBAAuB;;;ADnwC7B,IAAM,eAAe,CAC1B,QACW;AACX,SAAO;AACT;", "names": [] } diff --git a/typescript/config/package.json b/typescript/config/package.json index 7c4b301e3..0be594428 100644 --- a/typescript/config/package.json +++ b/typescript/config/package.json @@ -1,6 +1,6 @@ { "name": "@erpc-cloud/config", - "version": "0.0.78", + "version": "0.0.81", "description": "Library of types for IDE autocompletion of erpc config in Typescript", "repository": { "type": "git", diff --git a/typescript/config/src/generated.ts b/typescript/config/src/generated.ts index 0c1423b86..9c2a048ed 100644 --- a/typescript/config/src/generated.ts +++ b/typescript/config/src/generated.ts @@ -866,11 +866,37 @@ export interface NetworkConfig { alias?: string; methods?: MethodsConfig; multiplexing?: boolean; + staticResponses?: (StaticResponseConfig | undefined)[]; +} +/** + * StaticResponseConfig declares a canned JSON-RPC response for a specific + * (method, params) pair on a network. + */ +export interface StaticResponseConfig { + method: string; + params?: any[]; + response?: StaticResponseBodyConfig; +} +/** + * StaticResponseBodyConfig holds the JSON-RPC payload to serve. Exactly one + * of Result or Error must be set. + */ +export interface StaticResponseBodyConfig { + result?: any; + error?: StaticResponseErrorConfig; +} +/** + * StaticResponseErrorConfig mirrors a JSON-RPC error object. + */ +export interface StaticResponseErrorConfig { + code: number /* int */; + message: string; + data?: any; } export interface DirectiveDefaultsConfig { retryEmpty?: boolean; retryPending?: boolean; - skipCacheRead?: boolean; + skipCacheRead?: any; cacheMaxAgeSeconds?: number /* int64 */; useUpstream?: string; skipInterpolation?: boolean; @@ -1222,6 +1248,55 @@ export interface NetworkStrategyConfig { rateLimitBudget?: string; ipAsUser?: boolean; } +/** + * X402StrategyConfig enables x402 payment authentication (HTTP 402 Payment Required). + */ +export interface X402StrategyConfig { + /** + * FacilitatorURL is the x402 facilitator endpoint for verify/settle operations. + */ + facilitatorUrl: string; + /** + * SellerAddress is the wallet address that receives payments. + */ + sellerAddress: string; + /** + * PricePerRequest is the cost per request in atomic units. + */ + pricePerRequest: string; + /** + * Network is the x402 network name for payment. + */ + network: string; + /** + * Asset is the token contract address used for payment. + */ + asset?: string; + /** + * Scheme is the x402 payment scheme. + */ + scheme?: string; + /** + * Description is a human-readable description included in 402 responses. + */ + description?: string; + /** + * MaxTimeoutSeconds is the payment authorization validity period. + */ + maxTimeoutSeconds?: number /* int */; + /** + * RateLimitBudget, if set, is applied to the authenticated payer. + */ + rateLimitBudget?: string; + /** + * VerifyOnly when true skips settlement. + */ + verifyOnly?: boolean; + /** + * Extra contains additional fields merged into the payment requirement's extra object. + */ + extra?: { [key: string]: any}; +} export type LabelMode = string; export const ErrorLabelModeVerbose: LabelMode = "verbose"; export const ErrorLabelModeCompact: LabelMode = "compact";