Replies: 7 comments 14 replies
-
We had similar use-cases where a given property had to be changed to @steven-sheehy what is your take on this? |
Beta Was this translation helpful? Give feedback.
-
Can you confirm that the stated above means: If |
Beta Was this translation helpful? Give feedback.
-
I think that we should explicitly state that if |
Beta Was this translation helpful? Give feedback.
-
My understanding is an |
Beta Was this translation helpful? Give feedback.
-
Is |
Beta Was this translation helpful? Give feedback.
-
Heads up that, in Ethereum, a tx to the null address is different to a tx to the zero address: the former is a contract create, but the latter is just a transfer to the zero address. If the goal of the HIP is to simplify compatibility with Ethereum, it may be best to follow its behaviour - even if it's not the most intuitive one. |
Beta Was this translation helpful? Give feedback.
-
Does this mean that if a client submits a tx with nonce 11 when the expected one was 10, the tx will be accepted by the node but will be failed on execution? If so, this means that it is risky for a client to submit a tx without having confirmation that the previous one has been processed. As an example, if the txs with nonces 10 and 11 were sent one right after the other, but nonce 11 ends up ordered before 10, then both txs would fail execution. |
Beta Was this translation helpful? Give feedback.
-
Entire hip will be at hips.hedera.com. Here is the initial specification section
Specification
Protobuf changes
Ethereum Transaction
A new transaction body
EthereumTransaction
will be introduced that hold theethereum transaction data.
The ethereum transaction data will be converted into a
ByteString
. If thetransaction is small enough it will be the entire unadjusted transaction.
To support larger transactions that won’t fit in the Hedera transaction size
limitations (such as contract create transactions) we will allow the
data
section of the transaction (also referred to as callData or inputData) to be
stored as a Hedera file. In these instances the transaction body contains an
edited version of the Transaction, replacing a zero length string for the
data
field in the RLP set in the
ethereumData
message field and storing the calldata in a Hedera File ?? as a hex string ?? as a binary blob ??. When the
transaction is executed and before the signatures are extracted
To support this transaction there will also need to be some changes in other
messages that would be customary for a new transaction body.
ContractCreateTransaction
In cases where the created contract is small it may fit in a Hedera Transaction.
Ordinarily contract creates always require the creation of a Hedera file. To
simplify this case a new field
initcodeBytes
is added tothe
ContractCreateTransactionBody
as an alternative tofileID
.Value of gas price and value fields
For Ethereum Transactions we introduce the concept of “WeiBars”, which are 1 to
10^18th the value of a hBar. This is to maximize compatibility with third party
tools that expect ether units to be operated on in fractions of 10^18, also
known as a Wei. Thus, 1 tinyBar is 10^10 weiBars or 10 gWei. When calculating
gas prices and transferred value the fractional parts below a tiny bar are
dropped when converted to tinyBars.
Ethereum Requirements
The replay protection specified in EIP-155 will be required for Legacy
transactions. The Type 1 / EIP-2930 and Type 2 / EIP-1559 transactions also
require a chainId field. Non-restricted chainIDs (where chainID is less than or
equal to zero) are not supported.
For all transaction types the chainID specified must match the chainID of the
network as specified in HIP-26 (0x127 for mainnet, 0x128 for testnet, 0x129 for
devnet, and 0x12a for local networks). Future evolution in the Ledger ID may
impact this.
Transaction Signing Requirements
The sender of an ethereum transaction body will be the account with an account
alias that is an ECDSA(secp256K1) public key. To identify the account the public
key will be recovered from the ethereum transaction, and converted to an
ethereum address. The transaction sender will then be set to the account whose
ethereum address of the alias key has the same ethereum address.
For the purposes of authentication signing the ethereum transaction will provide
the same authorization as though the key signed the entire Hedera transaction.
Paying for the Transaction
In addition to the account signing the Ethereum transaction (the sender account)
each Hedera transaction containing the Ethereum transaction will also need to be
signed by a hedera account (the relayer account). These may be the same account
or different accounts.
If the relayer and sender account are the same account there are no limitations
on hbar transfers.
When the relayer and sender account is different the following restrictions
apply to hbar transfers.
contract create transaction) or the gas that a system contract would charge
for the operation
gasPrice
field for legacy and type 1 (EIP-2930)transactions or the
max_fee_per_gas
field for type 2 (EIP1339 transactions).This value is expressed in weibars.
the effective gas cost (the sender portion).
the excess or the sender portion should be reduced. If the sender portion is
less than the total fees the sender will pay the difference.
max_priority_fee_per_gas
specified then the relayers accountcannot receive more than the effective gas cost times
the
max_priority_fee_per_gas
(in weibars). The sender portion should bereduced until the transfers balance out. The relayer may still spend any
amount needed to balance out the transfers.
Finally, if an ethereum transaction reaches consensus and is invalid and cannot
be processed (for critical failures such as a bad ECDSA signature, an account
not matching the sender, an invalid ethereum transaction, an incorrect nonce, or
any other such error) the relayer is responsible for all fees relating to
bringing the transaction to consensus.
Account Nonce
Ethereum transactions have a different deconfliction and transaction enablement
mechanism than Hedera, but it is an inseparable part of ethereum toolchains. To
that end we will support transaction sequence numbers as an additional
transaction validity check.
Each Hedera account will track a new value
ethereumNonce
, defaulting to zero.When an
EthereumTransaction
is validated at consensus time the transactionwill fail if the account's
ethereumNonce
is not equal to the nonce in theethereum transaction bytes.
If the transaction passes all validations and EVM execution (or equivalent
processing) starts then the
ethereumNonce
in the user account is incrementedby one. If the transaction fails for any reason prior to EVM execution the nonce
is not incremented.
Executing the Transaction
Ethereum transactions can have a number of possible handling routes. All of them
are driven by the
to
field in the ethereum transaction.If the
to
field is empty, zero length, or all zeros it will be converted intoa
ContractCreate
transaction. If the transaction has acallData
value in thetransaction it will be places din the
ContractCreate
sfileID
field,otherwise the data goes in the
initcodeBytes
field.For non-zero non-empty
to
fields the address will first be decoded as astandard solidity mapping (bytes 1-4 are shard, bytes 5-12 are realm, bytes
13-20 are id, big endian encoded). If this does not map to an exiting entity
then the
to
address will be processed as an alias, which currently can map toCrypto Accounts and Smart Contract Accounts.
If the
to
field still does not map to an entity the transaction fails with ahedera error. Intrinsic gas will be charged to the sender account.
If the
to
address points to a Contract account the body of the ethereumtransaction will be converted into a
ContractCall
and executed.If the
to
address corresponds to a Token ID the call will initially be handledas an EVM, and converted into a
ContractCall
. In future updates it will behandled directly via the HTS Precompile code skipping the EVM step.
If the
to
address points to a Topic ID or File ID the call will be handled asan EVM, and converted into a
ContractCall
. If precompile support for theconsensus and file service is developed then there may be similar handling as
token calls.
Beta Was this translation helpful? Give feedback.
All reactions