mirror of
https://github.com/status-im/EIPs.git
synced 2025-02-23 04:08:09 +00:00
Automatically merged updates to draft EIP(s) 2733 (#3038)
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:
parent
ec36396a28
commit
d56af987bc
@ -126,13 +126,17 @@ fn is_valid(config: &Config, state: &State, tx: TransactionPackage) bool {
|
||||
if config.chain_id() != tx.chain_id {
|
||||
false
|
||||
}
|
||||
|
||||
if tx.children.len() == 0 {
|
||||
false
|
||||
}
|
||||
|
||||
if state.nonce(tx.from()) + 1 != tx.nonce {
|
||||
false
|
||||
}
|
||||
|
||||
let cum_limit = tx.children.map(|x| x.gas_limit).sum();
|
||||
if state.balance(tx.from()) < cum_limit * tx.gas_price {
|
||||
if state.balance(tx.from()) < cum_limit * tx.gas_price + intrinsic_gas(tx) {
|
||||
false
|
||||
}
|
||||
|
||||
@ -184,6 +188,16 @@ struct Result {
|
||||
}
|
||||
```
|
||||
|
||||
### Intrinsic Cost
|
||||
Let the intrinsic cost of the transaction package be defined as follows:
|
||||
|
||||
```
|
||||
fn intrinsic_gas(tx: TransactionPackage) u256 {
|
||||
let data_cost = tx.children.map(|c| data_cost(&c.data)).sum();
|
||||
17000 + 8000 * tx.children.len() + data_cost
|
||||
}
|
||||
```
|
||||
|
||||
### Execution
|
||||
Transaction packages should be executed as follows:
|
||||
1. Deduct the cumulative cost from the outer signer's balance.
|
||||
|
Loading…
x
Reference in New Issue
Block a user