Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/config/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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 |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed originally that this was just a typo that caused the table to not render properly. Is there a bug, that causes the markdown to not render?

I only ask to know if the intent is to have a better looking table or if the intent is to avoid a rendering bug. Better looking table, which is all good as well, just wanted to confirm the md table render works, which might be easier to maintain or work as a guide for people committing to the repo in the future.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that and I was unable to make it render properly if there is a way you can please give it a shot

-----------------|-----------------------
| 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 |
<StyledTable>
<thead>
<tr>
<th>parameter name</th>
<th>default value</th>
</tr>
</thead>
<tbody>
<tr><td>prevRandao</td><td><code>0x0000000000000000000000000000000000000000000000000000000000000000</code></td></tr>
<tr><td>feeRecipient</td><td><code>0x0000000000000000000000000000000000000000</code></td></tr>
<tr><td>mixHash</td><td><code>0x0000000000000000000000000000000000000000000000000000000000000000</code></td></tr>
<tr><td>nonce</td><td><code>0x0</code></td></tr>
<tr><td>extraData</td><td><code>0x0000000000000000000000000000000000000000000000000000000000000000</code></td></tr>
<tr><td>difficulty</td><td>The same as the base block defined as the second parameter in the call</td></tr>
<tr><td>gasLimit</td><td>The same as the base block defined as the second parameter in the call</td></tr>
<tr><td>hash</td><td>Calculated normally</td></tr>
<tr><td>parentHash</td><td>Previous blocks hash</td></tr>
<tr><td>timestamp</td><td>The timestamp of previous block + <code>network block time</code> (12s on Ethereum Mainnet)</td></tr>
<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>
<tr><td>sha3Uncles</td><td>Empty trie root</td></tr>
<tr><td>withdrawals</td><td>Empty array</td></tr>
<tr><td>uncles</td><td>Empty array</td></tr>
<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>
<tr><td>number</td><td>Previous block number + 1</td></tr>
<tr><td>logsBloom</td><td>Calculated normally. ETH logs are not part of the calculation</td></tr>
<tr><td>receiptsRoot</td><td>Calculated normally</td></tr>
<tr><td>transactionsRoot</td><td>Calculated normally</td></tr>
<tr><td>size</td><td>Calculated normally</td></tr>
<tr><td>withdrawalsRoot</td><td>Calculated normally</td></tr>
<tr><td>gasUsed</td><td>Calculated normally</td></tr>
<tr><td>stateRoot</td><td>Calculated normally</td></tr>
</tbody>
</StyledTable>

## 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` |

<StyledTable>
<thead>
<tr>
<th>parameter name</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr><td>type</td><td><code>0x2</code></td></tr>
<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>
<tr><td>to</td><td><code>null</code></td></tr>
<tr><td>from</td><td><code>0x0000000000000000000000000000000000000000</code></td></tr>
<tr><td>gasLimit</td><td>blockGasLimit - soFarUsedGasInBlock</td></tr>
<tr><td>value</td><td><code>0x0</code></td></tr>
<tr><td>input</td><td>no data</td></tr>
<tr><td>gasPrice</td><td><code>0x0</code></td></tr>
<tr><td>maxPriorityFeePerGas</td><td><code>0x0</code></td></tr>
<tr><td>maxFeePerGas</td><td><code>0x0</code></td></tr>
<tr><td>accessList</td><td>empty array</td></tr>
<tr><td>blobVersionedHashes</td><td>empty array</td></tr>
<tr><td>chainId</td><td>The chain id of the current chain</td></tr>
<tr><td>r</td><td><code>0x0</code></td></tr>
<tr><td>s</td><td><code>0x0</code></td></tr>
<tr><td>yParity</td><td>even</td></tr>
<tr><td>v</td><td><code>0x0</code></td></tr>
</tbody>
</StyledTable>

## 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`:
Expand Down
6 changes: 1 addition & 5 deletions docs/reference/intro.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
slug: /
sidebar_position: 1
---

# Introduction

Expand Down Expand Up @@ -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.
We welcome contributions to improve this documentation. Please see our [Contributors Guide](/reference/contributors-guide) guide for more information on how to contribute.
6 changes: 6 additions & 0 deletions src/components/StyledTable.js
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would maybe move this into docs /reference under the hood the references will be copied to /docs inside of source which I believe should allow the components to be resolved. This will keep the source code clean where things that relate to docs are logically grouped together.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/reference/components/**.*

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from "react";
import "./table.css";

export default function StyledTable({ children }) {
return <div className="table-container"><table>{children}</table></div>;
}
24 changes: 24 additions & 0 deletions src/components/table.css
Original file line number Diff line number Diff line change
@@ -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;
}
Loading