Automatically merged updates to draft EIP(s) 1474 (#2155)

Hi, I'm a bot! This change was automatically merged because:

 - It only modifies existing Draft or Last Call EIP(s)
 - The PR was approved or written by at least one author of each modified EIP
 - The build is passing
This commit is contained in:
Charles Cooper 2019-06-28 09:38:11 -07:00 committed by EIP Automerge Bot
parent b33f811d78
commit 35cd3bdd1c
1 changed files with 24 additions and 5 deletions

View File

@ -82,6 +82,25 @@ Examples `Quantity` values:
|0x0400|`invalid`|leading zeroes not allowed| |0x0400|`invalid`|leading zeroes not allowed|
|ff|`invalid`|values must be prefixed| |ff|`invalid`|values must be prefixed|
##### `Block Identifier`
The RPC methods below take a default block identifier as a parameter.
- `eth_getBalance`
- `eth_getStorageAt`
- `eth_getTransactionCount`
- `eth_getCode`
- `eth_call`
- `eth_getProof`
Since there is no way to clearly distinguish between a `Data` parameter and a `Quantity` parameter, [EIP-1898](eip-1898.md) provides a format to specify a block either using the block hash or block number. The block identifier is a JSON `object` with the following fields:
|Property|Type|Description|
|-|-|-|
|`[blockNumber]`|{[`Quantity`](#quantity)}|The block in the canonical chain with this number|
|OR `[blockHash]`|{[`Data`](#data)}|The block uniquely identified by this hash. The `blockNumber` and `blockHash` properties are mutually exclusive; exactly one of them must be set.|
|`requireCanonical`|{`boolean`}|(optional) Whether or not to throw an error if the block is not in the canonical chain as described below. Only allowed in conjunction with the `blockHash` tag. Defaults to `false`.|
If the block is not found, the callee SHOULD raise a JSON-RPC error (the recommended error code is `-32001: Resource not found`. If the tag is `blockHash` and `requireCanonical` is `true`, the callee SHOULD additionally raise a JSON-RPC error if the block is not in the canonical chain (the recommended error code is `-32000: Invalid input` and in any case should be different than the error code for the block not found case so that the caller can distinguish the cases). The block-not-found check SHOULD take precedence over the block-is-canonical check, so that if the block is not found the callee raises block-not-found rather than block-not-canonical.
##### `Data` ##### `Data`
@ -381,7 +400,7 @@ Executes a new message call immediately without submitting a transaction to the
|#|Type|Description| |#|Type|Description|
|-|-|-| |-|-|-|
|1|{`object`}|@property {[`Data`](#data)} `[from]` - transaction sender<br/>@property {[`Data`](#data)} `to` - transaction recipient or `null` if deploying a contract<br/>@property {[`Quantity`](#quantity)} `[gas]` - gas provided for transaction execution<br/>@property {[`Quantity`](#quantity)} `[gasPrice]` - price in wei of each gas used<br/>@property {[`Quantity`](#quantity)} `[value]` - value in wei sent with this transaction<br/>@property {[`Data`](#data)} `[data]` - contract code or a hashed method call with encoded args| |1|{`object`}|@property {[`Data`](#data)} `[from]` - transaction sender<br/>@property {[`Data`](#data)} `to` - transaction recipient or `null` if deploying a contract<br/>@property {[`Quantity`](#quantity)} `[gas]` - gas provided for transaction execution<br/>@property {[`Quantity`](#quantity)} `[gasPrice]` - price in wei of each gas used<br/>@property {[`Quantity`](#quantity)} `[value]` - value in wei sent with this transaction<br/>@property {[`Data`](#data)} `[data]` - contract code or a hashed method call with encoded args|
|2|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`| |2|{[`Quantity`](#quantity)\|`string`\|[`Block Identifier`](#block-identifier)}|block number, or one of `"latest"`, `"earliest"` or `"pending"`, or a block identifier as described in [`Block Identifier`](#block-identifier)|
#### Returns #### Returns
@ -547,7 +566,7 @@ Returns the balance of an address in wei
|#|Type|Description| |#|Type|Description|
|-|-|-| |-|-|-|
|1|{[`Data`](#data)}|address to query for balance| |1|{[`Data`](#data)}|address to query for balance|
|2|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`| |2|{[`Quantity`](#quantity)\|`string`\|[`Block Identifier`](#block-identifier)}|block number, or one of `"latest"`, `"earliest"` or `"pending"`, or a block identifier as described in [`Block Identifier`](#block-identifier)|
#### Returns #### Returns
@ -818,7 +837,7 @@ Returns the contract code stored at a given address
|#|Type|Description| |#|Type|Description|
|-|-|-| |-|-|-|
|1|{[`Data`](#data)}|address to query for code| |1|{[`Data`](#data)}|address to query for code|
|2|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`| |2|{[`Quantity`](#quantity)\|`string`\|[`Block Identifier`](#block-identifier)}|block number, or one of `"latest"`, `"earliest"` or `"pending"`, or a block identifier as described in [`Block Identifier`](#block-identifier)|
#### Returns #### Returns
@ -1039,7 +1058,7 @@ Returns the value from a storage position at an address
|-|-|-| |-|-|-|
|1|{[`Data`](#data)}|address of stored data| |1|{[`Data`](#data)}|address of stored data|
|2|{[`Quantity`](#quantity)}|index into stored data| |2|{[`Quantity`](#quantity)}|index into stored data|
|3|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`| |3|{[`Quantity`](#quantity)\|`string`\|[`Block Identifier`](#block-identifier)}|block number, or one of `"latest"`, `"earliest"` or `"pending"`, or a block identifier as described in [`Block Identifier`](#block-identifier)|
#### Returns #### Returns
@ -1284,7 +1303,7 @@ Returns the number of transactions sent from an address
|#|Type|Description| |#|Type|Description|
|-|-|-| |-|-|-|
|1|{[`Data`](#data)}|address to query for sent transactions| |1|{[`Data`](#data)}|address to query for sent transactions|
|2|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`| |2|{[`Quantity`](#quantity)\|`string`\|[`Block Identifier`](#block-identifier)}|block number, or one of `"latest"`, `"earliest"` or `"pending"`, or a block identifier as described in [`Block Identifier`](#block-identifier)|
#### Returns #### Returns