rm payload transaction value calculation for Bellatrix engine API (#6173)
This commit is contained in:
parent
0b6f75b88b
commit
08d6dc347e
|
@ -8,22 +8,24 @@
|
|||
{.push raises: [].}
|
||||
|
||||
import
|
||||
std/[strformat, strutils, sequtils, typetraits, uri, json],
|
||||
std/[strformat, typetraits, json],
|
||||
# Nimble packages:
|
||||
chronos, metrics, chronicles/timings,
|
||||
json_rpc/[client, errors],
|
||||
web3, web3/[engine_api, primitives, conversions],
|
||||
eth/common/[eth_types, transaction],
|
||||
eth/common/eth_types,
|
||||
eth/async_utils, results,
|
||||
stew/[assign2, byteutils, objects],
|
||||
# Local modules:
|
||||
../spec/[eth2_merkleization, forks, helpers],
|
||||
../spec/[eth2_merkleization, forks],
|
||||
../networking/network_metadata,
|
||||
".."/[beacon_node_status, future_combinators],
|
||||
"."/[eth1_chain, el_conf]
|
||||
|
||||
from std/sequtils import anyIt, mapIt
|
||||
from std/times import getTime, inSeconds, initTime, `-`
|
||||
from ../spec/engine_authentication import getSignedIatToken
|
||||
from ../spec/helpers import bytes_to_uint64
|
||||
from ../spec/state_transition_block import kzg_commitment_to_versioned_hash
|
||||
|
||||
export
|
||||
|
@ -753,12 +755,6 @@ proc forkchoiceUpdated(rpcClient: RpcClient,
|
|||
else:
|
||||
static: doAssert false
|
||||
|
||||
func computeBlockValue(blk: ExecutionPayloadV1): UInt256 {.raises: [RlpError].} =
|
||||
for transactionBytes in blk.transactions:
|
||||
var rlp = rlpFromBytes distinctBase(transactionBytes)
|
||||
let transaction = rlp.read(eth_types.Transaction)
|
||||
result += distinctBase(effectiveGasTip(transaction, blk.baseFeePerGas)).u256
|
||||
|
||||
proc getPayloadFromSingleEL(
|
||||
connection: ELConnection,
|
||||
GetPayloadResponseType: type,
|
||||
|
@ -831,8 +827,7 @@ proc getPayloadFromSingleEL(
|
|||
let payload =
|
||||
await engine_api.getPayload(rpcClient, ExecutionPayloadV1, payloadId)
|
||||
return BellatrixExecutionPayloadWithValue(
|
||||
executionPayload: payload,
|
||||
blockValue: computeBlockValue payload)
|
||||
executionPayload: payload, blockValue: Wei.zero)
|
||||
elif GetPayloadResponseType is engine_api.GetPayloadV4Response:
|
||||
debugRaiseAssert "foo"
|
||||
return default(engine_api.GetPayloadV4Response)
|
||||
|
|
Loading…
Reference in New Issue