From c5daf31929d04a33907f901b743cbaa415e554b5 Mon Sep 17 00:00:00 2001 From: bomanaps Date: Wed, 2 Jul 2025 06:05:40 +0100 Subject: [PATCH] chore: change to mdx --- README.md | 4 +- docs/config/gatsby-config.js | 4 +- ...aking-changes.md => contributors-guide.md} | 0 ...atev1-notes.md => ethsimulatev1-notes.mdx} | 107 +++++++++++------- docs/reference/intro.md | 6 +- src/components/StyledTable.js | 6 + src/components/table.css | 24 ++++ 7 files changed, 98 insertions(+), 53 deletions(-) rename docs/reference/{making-changes.md => contributors-guide.md} (100%) rename docs/reference/{ethsimulatev1-notes.md => ethsimulatev1-notes.mdx} (71%) create mode 100644 src/components/StyledTable.js create mode 100644 src/components/table.css diff --git a/README.md b/README.md index 6b5049794..746f97556 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Ethereum clients as modules that can be swapped at will. ### Contributing -Please see the contributors guide in [`docs/making-changes.md`][making-changes] +Please see the contributors guide in [`docs/contributors-guide.md`][contributors-guide] for general information about the process of standardizing new API methods and making changes to existing ones. Information on test generation can be found in [`tests/README.md`][test-gen] @@ -112,7 +112,7 @@ This repository is licensed under [CC0](LICENSE). [validator]: https://open-rpc.github.io/schema-utils-js/functions/validateOpenRPCDocument.html [graphql-schema]: http://graphql-schema.ethdevops.io/?url=https://raw.githubusercontent.com/ethereum/execution-apis/main/graphql.json [eip-1767]: https://eips.ethereum.org/EIPS/eip-1767 -[making-changes]: docs/making-changes.md +[contributors-guide]: docs/contributors-guide.md [json-schema]: https://json-schema.org [hive]: https://github.com/ethereum/hive [rpc-compat]: https://github.com/ethereum/hive/tree/master/simulators/ethereum/rpc-compat diff --git a/docs/config/gatsby-config.js b/docs/config/gatsby-config.js index 175c6fbd1..021f5500c 100644 --- a/docs/config/gatsby-config.js +++ b/docs/config/gatsby-config.js @@ -11,12 +11,12 @@ module.exports = { secondaryColor: '#f50057', //material-ui secondary color author: '', menuLinks: [ - { name: 'Intro', link: '/intro' }, + { name: 'Introduction', link: '/introduction' }, { name: 'API Documentation', link: '/api-documentation' }, - { name: 'Making changes', link: '/making-changes' }, + { name: 'Contributors Guide', link: '/contributors-guide' }, { name: 'Ethsimulatev1 notes', link: '/ethsimulatev1-notes' }, ], footerLinks: [ diff --git a/docs/reference/making-changes.md b/docs/reference/contributors-guide.md similarity index 100% rename from docs/reference/making-changes.md rename to docs/reference/contributors-guide.md diff --git a/docs/reference/ethsimulatev1-notes.md b/docs/reference/ethsimulatev1-notes.mdx similarity index 71% rename from docs/reference/ethsimulatev1-notes.md rename to docs/reference/ethsimulatev1-notes.mdx index a4972b5e2..7faf6506a 100644 --- a/docs/reference/ethsimulatev1-notes.md +++ b/docs/reference/ethsimulatev1-notes.mdx @@ -1,56 +1,75 @@ +import StyledTable from '../../src/components/StyledTable' + # eth_simulate This document contains some extra information that couldn't be fit to the specification document directly. ## Default block values 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: -| parameter name | default value | ------------------|----------------------- -| prevRandao | `0x0000000000000000000000000000000000000000000000000000000000000000` | -| feeRecipient | `0x0000000000000000000000000000000000000000` | -| mixHash | `0x0000000000000000000000000000000000000000000000000000000000000000` | -| nonce | `0x0` | -| extraData | `0x0000000000000000000000000000000000000000000000000000000000000000` | -| difficulty | The same as the base block defined as the second parameter in the call | -| gasLimit | The same as the base block defined as the second parameter in the call | -| hash | Calculated normally | -| parentHash | Previous blocks hash | -| timestamp | The timestamp of previous block + `network block time` (12s on Ethereum Mainnet) | -| 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 | -| sha3Uncles | Empty trie root | -| withdrawals | Empty array | -| uncles | Empty array | -| 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 | -| number | Previous block number + 1 | -| logsBloom | Calculated normally. ETH logs are not part of the calculation | -| receiptsRoot | Calculated normally | -| transactionsRoot | Calculated normally | -| size | Calculated normally | -| withdrawalsRoot | Calculated normally | -| gasUsed | Calculated normally | -| stateRoot | Calculated normally | + + + + parameter name + default value + + + + prevRandao0x0000000000000000000000000000000000000000000000000000000000000000 + feeRecipient0x0000000000000000000000000000000000000000 + mixHash0x0000000000000000000000000000000000000000000000000000000000000000 + nonce0x0 + extraData0x0000000000000000000000000000000000000000000000000000000000000000 + difficultyThe same as the base block defined as the second parameter in the call + gasLimitThe same as the base block defined as the second parameter in the call + hashCalculated normally + parentHashPrevious blocks hash + timestampThe timestamp of previous block + network block time (12s on Ethereum Mainnet) + baseFeePerGasWhen 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 + sha3UnclesEmpty trie root + withdrawalsEmpty array + unclesEmpty array + blobBaseFeeWhen 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 + numberPrevious block number + 1 + logsBloomCalculated normally. ETH logs are not part of the calculation + receiptsRootCalculated normally + transactionsRootCalculated normally + sizeCalculated normally + withdrawalsRootCalculated normally + gasUsedCalculated normally + stateRootCalculated normally + + ## Default values for transactions 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: -| parameter name | description | ------------------|----------------------- -| type | `0x2` | -| nonce | Take the correct nonce for the account prior eth_simulate and increment by one for each transaction by the account | -| to | `null` | -| from | `0x0000000000000000000000000000000000000000` | -| gasLimit | blockGasLimit - soFarUsedGasInBlock | -| value | `0x0` | -| input | no data | -| gasPrice | `0x0` | -| maxPriorityFeePerGas | `0x0` | -| maxFeePerGas | `0x0` | -| accessList | empty array | -| blobVersionedHashes | empty array | -| chainId | The chain id of the current chain | -| r | `0x0` | -| s | `0x0` | -| yParity | even | -| v | `0x0` | + + + + + parameter name + description + + + + type0x2 + nonceTake the correct nonce for the account prior eth_simulate and increment by one for each transaction by the account + tonull + from0x0000000000000000000000000000000000000000 + gasLimitblockGasLimit - soFarUsedGasInBlock + value0x0 + inputno data + gasPrice0x0 + maxPriorityFeePerGas0x0 + maxFeePerGas0x0 + accessListempty array + blobVersionedHashesempty array + chainIdThe chain id of the current chain + r0x0 + s0x0 + yParityeven + v0x0 + + ## Overriding default values 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`: diff --git a/docs/reference/intro.md b/docs/reference/intro.md index 4c0ce0810..47d70e58f 100644 --- a/docs/reference/intro.md +++ b/docs/reference/intro.md @@ -1,7 +1,3 @@ ---- -slug: / -sidebar_position: 1 ---- # Introduction @@ -40,4 +36,4 @@ Each category serves specific purposes and provides different functionalities fo ## Contributing -We welcome contributions to improve this documentation. Please see our [Making Changes](/reference/making-changes) guide for more information on how to contribute. \ No newline at end of file +We welcome contributions to improve this documentation. Please see our [Contributors Guide](/reference/contributors-guide) guide for more information on how to contribute. \ No newline at end of file diff --git a/src/components/StyledTable.js b/src/components/StyledTable.js new file mode 100644 index 000000000..01c79360d --- /dev/null +++ b/src/components/StyledTable.js @@ -0,0 +1,6 @@ +import React from "react"; +import "./table.css"; + +export default function StyledTable({ children }) { + return
{children}
; +} diff --git a/src/components/table.css b/src/components/table.css new file mode 100644 index 000000000..934b41510 --- /dev/null +++ b/src/components/table.css @@ -0,0 +1,24 @@ +.table-container { + margin: 2em 0; + overflow-x: auto; + background: #fff; + border-radius: 8px; + box-shadow: 0 2px 8px rgba(0,0,0,0.04); + padding: 1em; +} + +.table-container table { + width: 100%; + border-collapse: collapse; +} + +.table-container th, .table-container td { + border: 1px solid #e0e0e0; + padding: 0.75em 1em; + text-align: left; +} + +.table-container th { + background: #f5f5f5; + font-weight: 600; +} \ No newline at end of file