Skip to content

Commit 94ce9fd

Browse files
bomanapsacolytec3
authored andcommitted
chore: change to mdx
1 parent fbfcec3 commit 94ce9fd

File tree

7 files changed

+98
-53
lines changed

7 files changed

+98
-53
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Ethereum clients as modules that can be swapped at will.
1111

1212
### Contributing
1313

14-
Please see the contributors guide in [`docs/making-changes.md`][making-changes]
14+
Please see the contributors guide in [`docs/contributors-guide.md`][contributors-guide]
1515
for general information about the process of standardizing new API methods and
1616
making changes to existing ones. Information on test generation can be found
1717
in [`tests/README.md`][test-gen]
@@ -112,7 +112,7 @@ This repository is licensed under [CC0](LICENSE).
112112
[validator]: https://open-rpc.github.io/schema-utils-js/functions/validateOpenRPCDocument.html
113113
[graphql-schema]: http://graphql-schema.ethdevops.io/?url=https://raw.githubusercontent.com/ethereum/execution-apis/main/graphql.json
114114
[eip-1767]: https://eips.ethereum.org/EIPS/eip-1767
115-
[making-changes]: docs/making-changes.md
115+
[contributors-guide]: docs/contributors-guide.md
116116
[json-schema]: https://json-schema.org
117117
[hive]: https://github.com/ethereum/hive
118118
[rpc-compat]: https://github.com/ethereum/hive/tree/master/simulators/ethereum/rpc-compat

docs/config/gatsby-config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ module.exports = {
1111
secondaryColor: '#f50057', //material-ui secondary color
1212
author: '',
1313
menuLinks: [
14-
{ name: 'Intro', link: '/intro' },
14+
{ name: 'Introduction', link: '/introduction' },
1515
{
1616
name: 'API Documentation',
1717
link: '/api-documentation'
1818
},
19-
{ name: 'Making changes', link: '/making-changes' },
19+
{ name: 'Contributors Guide', link: '/contributors-guide' },
2020
{ name: 'Ethsimulatev1 notes', link: '/ethsimulatev1-notes' },
2121
],
2222
footerLinks: [
File renamed without changes.

docs/reference/ethsimulatev1-notes.md renamed to docs/reference/ethsimulatev1-notes.mdx

Lines changed: 63 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,75 @@
1+
import StyledTable from '../../src/components/StyledTable'
2+
13
# eth_simulate
24
This document contains some extra information that couldn't be fit to the specification document directly.
35

46
## Default block values
57
Unlike `eth_call`, `eth_simulateV1`'s calls are conducted inside blocks. We don't require user to define all the fields of the blocks so here are the defaults that are assumed for blocks parameters:
68

7-
| parameter name | default value |
8-
-----------------|-----------------------
9-
| prevRandao | `0x0000000000000000000000000000000000000000000000000000000000000000` |
10-
| feeRecipient | `0x0000000000000000000000000000000000000000` |
11-
| mixHash | `0x0000000000000000000000000000000000000000000000000000000000000000` |
12-
| nonce | `0x0` |
13-
| extraData | `0x0000000000000000000000000000000000000000000000000000000000000000` |
14-
| difficulty | The same as the base block defined as the second parameter in the call |
15-
| gasLimit | The same as the base block defined as the second parameter in the call |
16-
| hash | Calculated normally |
17-
| parentHash | Previous blocks hash |
18-
| timestamp | The timestamp of previous block + `network block time` (12s on Ethereum Mainnet) |
19-
| baseFeePerGas | When validation mode is true, baseFeePerGas is calculated on what it should be according to Ethereum's spec. When validation mode is false, the baseFeePerGas is set to zero |
20-
| sha3Uncles | Empty trie root |
21-
| withdrawals | Empty array |
22-
| uncles | Empty array |
23-
| blobBaseFee | When validation mode is true, blobBaseFee is calculated on what it should be according to EIP-4844 spec. When validation mode is false, the blobBaseFee is set to zero |
24-
| number | Previous block number + 1 |
25-
| logsBloom | Calculated normally. ETH logs are not part of the calculation |
26-
| receiptsRoot | Calculated normally |
27-
| transactionsRoot | Calculated normally |
28-
| size | Calculated normally |
29-
| withdrawalsRoot | Calculated normally |
30-
| gasUsed | Calculated normally |
31-
| stateRoot | Calculated normally |
9+
<StyledTable>
10+
<thead>
11+
<tr>
12+
<th>parameter name</th>
13+
<th>default value</th>
14+
</tr>
15+
</thead>
16+
<tbody>
17+
<tr><td>prevRandao</td><td><code>0x0000000000000000000000000000000000000000000000000000000000000000</code></td></tr>
18+
<tr><td>feeRecipient</td><td><code>0x0000000000000000000000000000000000000000</code></td></tr>
19+
<tr><td>mixHash</td><td><code>0x0000000000000000000000000000000000000000000000000000000000000000</code></td></tr>
20+
<tr><td>nonce</td><td><code>0x0</code></td></tr>
21+
<tr><td>extraData</td><td><code>0x0000000000000000000000000000000000000000000000000000000000000000</code></td></tr>
22+
<tr><td>difficulty</td><td>The same as the base block defined as the second parameter in the call</td></tr>
23+
<tr><td>gasLimit</td><td>The same as the base block defined as the second parameter in the call</td></tr>
24+
<tr><td>hash</td><td>Calculated normally</td></tr>
25+
<tr><td>parentHash</td><td>Previous blocks hash</td></tr>
26+
<tr><td>timestamp</td><td>The timestamp of previous block + <code>network block time</code> (12s on Ethereum Mainnet)</td></tr>
27+
<tr><td>baseFeePerGas</td><td>When validation mode is true, baseFeePerGas is calculated on what it should be according to Ethereum's spec. When validation mode is false, the baseFeePerGas is set to zero</td></tr>
28+
<tr><td>sha3Uncles</td><td>Empty trie root</td></tr>
29+
<tr><td>withdrawals</td><td>Empty array</td></tr>
30+
<tr><td>uncles</td><td>Empty array</td></tr>
31+
<tr><td>blobBaseFee</td><td>When validation mode is true, blobBaseFee is calculated on what it should be according to EIP-4844 spec. When validation mode is false, the blobBaseFee is set to zero</td></tr>
32+
<tr><td>number</td><td>Previous block number + 1</td></tr>
33+
<tr><td>logsBloom</td><td>Calculated normally. ETH logs are not part of the calculation</td></tr>
34+
<tr><td>receiptsRoot</td><td>Calculated normally</td></tr>
35+
<tr><td>transactionsRoot</td><td>Calculated normally</td></tr>
36+
<tr><td>size</td><td>Calculated normally</td></tr>
37+
<tr><td>withdrawalsRoot</td><td>Calculated normally</td></tr>
38+
<tr><td>gasUsed</td><td>Calculated normally</td></tr>
39+
<tr><td>stateRoot</td><td>Calculated normally</td></tr>
40+
</tbody>
41+
</StyledTable>
3242

3343
## Default values for transactions
3444
As eth_simulate is an extension to `eth_call` we want to enable the nice user experience that the user does not need to provide all required values for a transaction. We are assuming following defaults if the variable is not provided by the user:
35-
| parameter name | description |
36-
-----------------|-----------------------
37-
| type | `0x2` |
38-
| nonce | Take the correct nonce for the account prior eth_simulate and increment by one for each transaction by the account |
39-
| to | `null` |
40-
| from | `0x0000000000000000000000000000000000000000` |
41-
| gasLimit | blockGasLimit - soFarUsedGasInBlock |
42-
| value | `0x0` |
43-
| input | no data |
44-
| gasPrice | `0x0` |
45-
| maxPriorityFeePerGas | `0x0` |
46-
| maxFeePerGas | `0x0` |
47-
| accessList | empty array |
48-
| blobVersionedHashes | empty array |
49-
| chainId | The chain id of the current chain |
50-
| r | `0x0` |
51-
| s | `0x0` |
52-
| yParity | even |
53-
| v | `0x0` |
45+
46+
<StyledTable>
47+
<thead>
48+
<tr>
49+
<th>parameter name</th>
50+
<th>description</th>
51+
</tr>
52+
</thead>
53+
<tbody>
54+
<tr><td>type</td><td><code>0x2</code></td></tr>
55+
<tr><td>nonce</td><td>Take the correct nonce for the account prior eth_simulate and increment by one for each transaction by the account</td></tr>
56+
<tr><td>to</td><td><code>null</code></td></tr>
57+
<tr><td>from</td><td><code>0x0000000000000000000000000000000000000000</code></td></tr>
58+
<tr><td>gasLimit</td><td>blockGasLimit - soFarUsedGasInBlock</td></tr>
59+
<tr><td>value</td><td><code>0x0</code></td></tr>
60+
<tr><td>input</td><td>no data</td></tr>
61+
<tr><td>gasPrice</td><td><code>0x0</code></td></tr>
62+
<tr><td>maxPriorityFeePerGas</td><td><code>0x0</code></td></tr>
63+
<tr><td>maxFeePerGas</td><td><code>0x0</code></td></tr>
64+
<tr><td>accessList</td><td>empty array</td></tr>
65+
<tr><td>blobVersionedHashes</td><td>empty array</td></tr>
66+
<tr><td>chainId</td><td>The chain id of the current chain</td></tr>
67+
<tr><td>r</td><td><code>0x0</code></td></tr>
68+
<tr><td>s</td><td><code>0x0</code></td></tr>
69+
<tr><td>yParity</td><td>even</td></tr>
70+
<tr><td>v</td><td><code>0x0</code></td></tr>
71+
</tbody>
72+
</StyledTable>
5473

5574
## Overriding default values
5675
The default values of blocks and transactions can be overriden. For Transactions we allow overriding of variables `type`, `nonce`, `to`, `from`, `gas limit`, `value`, `input`, `gasPrice`, `maxPriorityFeePerGas`, `maxFeePerGas`, `accessList`, and for blocks we allow modifications of `number`, `time`, `gasLimit`, `feeRecipient`, `prevRandao`, `baseFeePerGas` and `blobBaseFee`:

docs/reference/intro.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
---
2-
slug: /
3-
sidebar_position: 1
4-
---
51

62
# Introduction
73

@@ -40,4 +36,4 @@ Each category serves specific purposes and provides different functionalities fo
4036

4137
## Contributing
4238

43-
We welcome contributions to improve this documentation. Please see our [Making Changes](/reference/making-changes) guide for more information on how to contribute.
39+
We welcome contributions to improve this documentation. Please see our [Contributors Guide](/reference/contributors-guide) guide for more information on how to contribute.

src/components/StyledTable.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import React from "react";
2+
import "./table.css";
3+
4+
export default function StyledTable({ children }) {
5+
return <div className="table-container"><table>{children}</table></div>;
6+
}

src/components/table.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.table-container {
2+
margin: 2em 0;
3+
overflow-x: auto;
4+
background: #fff;
5+
border-radius: 8px;
6+
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
7+
padding: 1em;
8+
}
9+
10+
.table-container table {
11+
width: 100%;
12+
border-collapse: collapse;
13+
}
14+
15+
.table-container th, .table-container td {
16+
border: 1px solid #e0e0e0;
17+
padding: 0.75em 1em;
18+
text-align: left;
19+
}
20+
21+
.table-container th {
22+
background: #f5f5f5;
23+
font-weight: 600;
24+
}

0 commit comments

Comments
 (0)