-
Notifications
You must be signed in to change notification settings - Fork 864
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update eth_call handling of account balance (#1834)
When calling `eth_call` by default account balances will be ignored when executing the call. If the user wants the gas balance to be a consideration in the call a new `strict` param in the call params can be set to true, which will enforce the balance rules. This is the same behavior as is observed in `eth_estimateGas`. Addresses #502 Signed-off-by: Danno Ferrin <[email protected]>
- Loading branch information
Showing
8 changed files
with
146 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 43 additions & 20 deletions
63
...urces/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_gasPriceTooHigh_block_8.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,47 @@ | ||
{ | ||
"request": { | ||
"id": 4, | ||
"jsonrpc": "2.0", | ||
"method": "eth_call", | ||
"params": [ | ||
{ | ||
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", | ||
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", | ||
"gasPrice": "0x10000000000000" | ||
}, | ||
"0x8" | ||
] | ||
}, | ||
"response": { | ||
"jsonrpc": "2.0", | ||
"id": 4, | ||
"error" : { | ||
"code" : -32004, | ||
"message" : "Upfront cost exceeds account balance" | ||
"request": [ | ||
{ | ||
"id": 3, | ||
"jsonrpc": "2.0", | ||
"method": "eth_call", | ||
"params": [ | ||
{ | ||
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", | ||
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", | ||
"gasPrice": "0x10000000000000" | ||
}, | ||
"0x8" | ||
] | ||
}, | ||
{ | ||
"id": 4, | ||
"jsonrpc": "2.0", | ||
"method": "eth_call", | ||
"params": [ | ||
{ | ||
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", | ||
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", | ||
"gasPrice": "0x10000000000000", | ||
"strict": true | ||
}, | ||
"0x8" | ||
] | ||
} | ||
}, | ||
], | ||
"response": [ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 3, | ||
"result": "0x" | ||
}, | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 4, | ||
"error": { | ||
"code": -32004, | ||
"message": "Upfront cost exceeds account balance" | ||
} | ||
} | ||
], | ||
"statusCode": 200 | ||
} |
63 changes: 43 additions & 20 deletions
63
...esources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_valueTooHigh_block_8.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,47 @@ | ||
{ | ||
"request": { | ||
"id": 4, | ||
"jsonrpc": "2.0", | ||
"method": "eth_call", | ||
"params": [ | ||
{ | ||
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", | ||
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", | ||
"value": "0x340ab63a021fc9aa" | ||
}, | ||
"0x8" | ||
] | ||
}, | ||
"response": { | ||
"jsonrpc": "2.0", | ||
"id": 4, | ||
"error" : { | ||
"code" : -32004, | ||
"message" : "Upfront cost exceeds account balance" | ||
"request": [ | ||
{ | ||
"id": 3, | ||
"jsonrpc": "2.0", | ||
"method": "eth_call", | ||
"params": [ | ||
{ | ||
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", | ||
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", | ||
"value": "0x340ab63a021fc9aa" | ||
}, | ||
"0x8" | ||
] | ||
}, | ||
{ | ||
"id": 4, | ||
"jsonrpc": "2.0", | ||
"method": "eth_call", | ||
"params": [ | ||
{ | ||
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", | ||
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", | ||
"value": "0x340ab63a021fc9aa", | ||
"strict": true | ||
}, | ||
"0x8" | ||
] | ||
} | ||
}, | ||
], | ||
"response": [ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 3, | ||
"result": "0x" | ||
}, | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 4, | ||
"error": { | ||
"code": -32004, | ||
"message": "Upfront cost exceeds account balance" | ||
} | ||
} | ||
], | ||
"statusCode": 200 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters