Skip to content

Commit 6b63da5

Browse files
Add credit cost information (#2081)
* Add automated CC tables and pricing content. Signed-off-by: bgravenorst <[email protected]> * Add initial component, Signed-off-by: bgravenorst <[email protected]> * Add EVM method info. Signed-off-by: bgravenorst <[email protected]> * Add initial method. Signed-off-by: bgravenorst <[email protected]> * Add debug methods. Signed-off-by: bgravenorst <[email protected]> * Add debug methods. Signed-off-by: bgravenorst <[email protected]> * Fix links. Signed-off-by: bgravenorst <[email protected]> * Add Gas API. Signed-off-by: bgravenorst <[email protected]> * Update services/get-started/pricing/credit-cost.mdx Co-authored-by: Alexandra Carrillo <[email protected]> * Update src/components/CreditCost/CreditCostPrice.js Co-authored-by: Alexandra Carrillo <[email protected]> * Update wording. Signed-off-by: bgravenorst <[email protected]> --------- Signed-off-by: bgravenorst <[email protected]> Co-authored-by: Alexandra Carrillo <[email protected]>
1 parent 48f8111 commit 6b63da5

File tree

147 files changed

+1704
-1340
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+1704
-1340
lines changed

services/get-started/pricing/credit-cost.md

Lines changed: 0 additions & 214 deletions
This file was deleted.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
description: API method credit cost.
3+
---
4+
5+
import React from 'react';
6+
import CreditCostTable from '@site/src/components/CreditCost/CreditCostTable.js';
7+
8+
# Credit costs
9+
10+
The following tables outline the credit costs associated with various RPC methods across different
11+
networks. The credit calculation logic is designed to ensure accurate and fair pricing based on the
12+
specific network and method being used.
13+
14+
:::caution important
15+
16+
Requests for [archive data](../../concepts/archive-data.md) (older than 128 blocks)
17+
currently cost the same as non-archive data, but this might change in the near future.
18+
:::
19+
20+
The process used to determine the credit cost for each request is as follows:
21+
22+
1. **Initial check for a specific credit value** - When you make a request, the system first checks if there is a specific credit value assigned for the network and method used.
23+
This ensures that any unique resource requirements or costs associated with a particular network are accurately reflected.
24+
25+
1. **Fallback to the Ethereum method's credit value** - If no specific credit value is found for the network, the system applies the Ethereum method's credit value.
26+
Ethereum serves as the baseline for pricing core RPC methods.
27+
28+
1. **Fallback to the default credit value** - If the method is not found in the Ethereum table either, the system applies a default credit value.
29+
Initially set to 80 credits, this default value ensures all requests are accounted for, even if specific pricing information is not available.
30+
31+
## Error code costs
32+
33+
When making requests that return status code errors, some errors count towards your credit usage.
34+
35+
- **`429` errors**: These are not charged and can occur if you've exceeded your allowed throughput limit (requests per second).
36+
- **`402` errors**: These are not charged and can occur if you've exceeded your allowed daily credit usage.
37+
- **`4xx` errors**: These are errors caused by human input, and consume 5 credits.
38+
- **`5xx` errors**: These are server errors, and do not consume any credit charges.
39+
40+
## Ethereum
41+
42+
The Ethereum methods serve as a baseline for pricing RPC methods. If a credit cost is not available for
43+
a specific network, then use the default Ethereum method's credit cost.
44+
45+
### Standard Ethereum-compliant methods
46+
47+
<CreditCostTable methods="evm" />
48+
49+
50+
### Trace methods
51+
52+
<CreditCostTable methods="evm_trace" />
53+
54+
55+
### Filter methods
56+
57+
<CreditCostTable methods="evm_filter" />
58+
59+
### Debug methods
60+
61+
62+
<CreditCostTable methods="evm_debug" />
63+
64+
65+
### Subscription events
66+
67+
You can subscribe and unsubscribe to events using [`eth_subscribe`](../../reference/ethereum/json-rpc-methods/subscription-methods/eth_subscribe.mdx) and [`eth_unsubscribe`](../../reference/ethereum/json-rpc-methods/subscription-methods/eth_unsubscribe.mdx).
68+
69+
The credit costs for the `logs` and `newHeads` events are charged per block, whereas `newPendingTransaction` events
70+
are charged at approximately one second intervals.
71+
72+
<CreditCostTable methods="evm_subscription" />
73+
74+
## Linea
75+
76+
<CreditCostTable methods="linea" />
77+
78+
79+
## Polygon
80+
81+
<CreditCostTable methods="polygon" />
82+
83+
## Starknet
84+
85+
<CreditCostTable methods="starknet" />
86+
87+
88+
89+
## ZKsync Era
90+
91+
<CreditCostTable methods="zksync" />
92+
93+
## Gas API
94+
95+
<CreditCostTable methods="gasApi" />
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
Returns a list of addresses owned by the client.
1+
import CreditCost from '@site/src/components/CreditCost/CreditCostPrice.js';
2+
3+
Returns a list of addresses owned by the client. <CreditCost network="evm" method="eth_accounts" />
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
Returns the expected base fee for blobs in the next block.
1+
import CreditCost from '@site/src/components/CreditCost/CreditCostPrice.js';
2+
3+
Returns the expected base fee for blobs in the next block. <CreditCost network="evm" method="eth_blobbasefee" />
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
Returns the current latest block number.
1+
import CreditCost from '@site/src/components/CreditCost/CreditCostPrice.js';
2+
3+
Returns the current latest block number. <CreditCost network="evm" method="eth_blockNumber" />

services/reference/_partials/_eth_call-description.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
Executes a new message call immediately without creating a transaction on the blockchain.
1+
import CreditCost from '@site/src/components/CreditCost/CreditCostPrice.js';
2+
3+
Executes a new message call immediately without creating a transaction on the blockchain. <CreditCost network="evm" method="eth_call" />
24

35
:::warning Gas parameter is capped
46

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
Returns the currently configured chain ID, a value used in replay-protected transaction signing as introduced by [EIP-155](https://eips.ethereum.org/EIPS/eip-155).
1+
import CreditCost from '@site/src/components/CreditCost/CreditCostPrice.js';
2+
3+
Returns the currently configured chain ID, a value used in replay-protected transaction signing as introduced
4+
by [EIP-155](https://eips.ethereum.org/EIPS/eip-155). <CreditCost network="evm" method="eth_chainId" />

services/reference/_partials/_eth_createaccesslist-description.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
Creates an [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) access list that you can include in a [transaction](../../concepts/transaction-types.md).
1+
import CreditCost from '@site/src/components/CreditCost/CreditCostPrice.js';
22

3-
Use this method to optimize your smart contract interactions. Access lists are a part of Ethereum's EIP-2930, which aims to improve the network's scalability and reduce gas costs by specifying an explicit list of addresses and storage keys that a transaction intends to access.
3+
Creates an [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) access list that you can include in a
4+
[transaction](../../concepts/transaction-types.md). <CreditCost network="evm" method="eth_createAccessList" />
5+
6+
Use this method to optimize your smart contract interactions. Access lists are a part of Ethereum's
7+
EIP-2930, which aims to improve the network's scalability and reduce gas costs by specifying an explicit
8+
list of addresses and storage keys that a transaction intends to access.
49

510
:::tip Optimizing Ethereum Transactions
611

services/reference/_partials/_eth_estimategas-description.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance.
1+
import CreditCost from '@site/src/components/CreditCost/CreditCostPrice.js';
2+
3+
Generates and returns an estimate of how much gas is necessary to allow the transaction to complete.
4+
The transaction will not be added to the blockchain. Note that the estimate may be significantly more
5+
than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics
6+
and node performance. <CreditCost network="evm" method="eth_estimateGas" />
27

38
:::warning Gas parameter is capped
49

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
Returns historical gas information, allowing you to track trends over time.
1+
import CreditCost from '@site/src/components/CreditCost/CreditCostPrice.js';
2+
3+
Returns historical gas information, allowing you to track trends over time. <CreditCost network="evm" method="eth_feeHistory" />

0 commit comments

Comments
 (0)