Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eth call variants #3824

Closed
wants to merge 13 commits into from
Closed

Eth call variants #3824

wants to merge 13 commits into from

Conversation

kjazgar
Copy link
Contributor

@kjazgar kjazgar commented Feb 15, 2022

Fixes | Closes | Resolves #4948

Changes:

Support various eth_call invocations post-1559. More information can be found here: ethereum/go-ethereum#23027.

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

In case you checked yes, did you write tests??

  • Yes
  • No

# Conflicts:
#	src/Nethermind/Nethermind.JsonRpc/Modules/Eth/EthModule.TransactionExecutor.cs
Comment on lines +40 to +43
[ConfigItem(
Description = "Defines whether the eth_call should be executed without taking base fee into consideration (in case when maxPriorityFeePerGas and maxFeePerGas are equal to zero).",
DefaultValue = "false")]
bool NoBaseFee { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't it be true by default?

new CallTxExecutor(_blockchainBridge, _blockFinder, _rpcConfig)
public ResultWrapper<string> eth_call(TransactionForRpc transactionCall, BlockParameter? blockParameter = null)
{
_rpcConfig.NoBaseFee = true;
Copy link
Member

Choose a reason for hiding this comment

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

we are changing the config?

Comment on lines 159 to 167
else
{
return transaction.GasPrice.IsZero;
}
}
else
{
return transaction.GasPrice.IsZero;
}
Copy link
Member

Choose a reason for hiding this comment

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

simplify a bit

UInt256 value = transaction.Value;

if (!noBaseFee || transaction.MaxFeePerGas > 0 || transaction.MaxPriorityFeePerGas > 0)
Copy link
Member

Choose a reason for hiding this comment

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

meaningful labels for bool checks

UInt256 senderBalance = _stateProvider.GetBalance(caller);
if (!noValidation && ((ulong)intrinsicGas * effectiveGasPrice + value > senderBalance ||
senderReservedGasPayment + value > senderBalance))
if (!noBaseFee || !skipGasPricing)
Copy link
Member

Choose a reason for hiding this comment

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

meaningful labels for bool checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Post-1559 eth_call invocations
2 participants