Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions beacon_chain/libnimbus_lc/libnimbus_lc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1421,15 +1421,15 @@ type
storageKeys: seq[Eth2Digest]

ETHAuthorization = object
chainId: uint64
chainId: UInt256
address: ExecutionAddress
nonce: uint64
authority: ExecutionAddress
signature: seq[byte]

ETHTransaction = object
hash: Eth2Digest
chainId: uint64
chainId: UInt256
`from`: ExecutionAddress
nonce: uint64
maxPriorityFeePerGas: uint64
Expand Down Expand Up @@ -1539,8 +1539,8 @@ proc ETHTransactionsCreateFromJson(

# Construct transaction
static:
doAssert sizeof(uint64) == sizeof(ChainId)
doAssert sizeof(uint64) == sizeof(data.chainId.get)
doAssert sizeof(UInt256) == sizeof(ChainId)
doAssert sizeof(UInt256) == sizeof(data.chainId.get)
doAssert sizeof(uint64) == sizeof(data.gas)
doAssert sizeof(uint64) == sizeof(data.gasPrice)
doAssert sizeof(uint64) == sizeof(data.maxPriorityFeePerGas.get)
Expand All @@ -1556,13 +1556,13 @@ proc ETHTransactionsCreateFromJson(
return nil
if data.authorizationList.isSome:
for authorization in data.authorizationList.get:
static: doAssert sizeof(uint64) == sizeof(authorization.chainId)
static: doAssert sizeof(UInt256) == sizeof(authorization.chainId)
if authorization.v > uint8.high:
return nil
let
tx = eth_types.EthTransaction(
txType: txType,
chainId: data.chainId.get(0.Quantity).ChainId,
chainId: data.chainId.get(0.u256),
nonce: distinctBase(data.nonce),
gasPrice: data.gasPrice.GasInt,
maxPriorityFeePerGas:
Expand Down Expand Up @@ -1663,15 +1663,15 @@ proc ETHTransactionsCreateFromJson(
authority = recoverSignerAddress(sig, auth.rlpHashForSigning).valueOr:
return nil
authorizationList.add ETHAuthorization(
chainId: distinctBase(auth.chainId),
chainId: auth.chainId,
address: ExecutionAddress(data: auth.address.data),
nonce: auth.nonce,
authority: ExecutionAddress(data: authority),
signature: @sig)

txs.add ETHTransaction(
hash: keccak256(rlpBytes),
chainId: distinctBase(tx.chainId),
chainId: tx.chainId,
`from`: ExecutionAddress(data: fromAddress),
nonce: tx.nonce,
maxPriorityFeePerGas: tx.maxPriorityFeePerGas.uint64,
Expand Down Expand Up @@ -1755,7 +1755,7 @@ func ETHTransactionGetHash(
addr transaction[].hash

func ETHTransactionGetChainId(
transaction: ptr ETHTransaction): ptr uint64 {.exported.} =
transaction: ptr ETHTransaction): ptr UInt256 {.exported.} =
## Obtains the chain ID of a transaction.
##
## * The returned value is allocated in the given transaction.
Expand Down Expand Up @@ -2115,7 +2115,7 @@ func ETHAuthorizationListGet(
addr authorizationList[][authorizationIndex.int]

func ETHAuthorizationGetChainId(
authorization: ptr ETHAuthorization): ptr uint64 {.exported.} =
authorization: ptr ETHAuthorization): ptr UInt256 {.exported.} =
## Obtains the chain ID of an authorization tuple.
##
## * The returned value is allocated in the given authorization tuple.
Expand Down
11 changes: 1 addition & 10 deletions research/fakeee.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# beacon_chain
# Copyright (c) 2022-2024 Status Research & Development GmbH
# Copyright (c) 2022-2025 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
Expand Down Expand Up @@ -45,15 +45,6 @@ proc setupEngineAPI*(server: RpcServer) =
msg: "Unknown payload"
)

# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/paris.md#engine_exchangetransitionconfigurationv1
server.rpc("engine_exchangeTransitionConfigurationV1") do(conf: TransitionConfigurationV1) -> TransitionConfigurationV1:
info "engine_exchangeTransitionConfigurationV1",
ttd = conf.terminalTotalDifficulty,
number = uint64(conf.terminalBlockNumber),
blockHash = conf.terminalBlockHash

return conf

# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/paris.md#engine_forkchoiceupdatedv1
server.rpc("engine_forkchoiceUpdatedV1") do(
update: ForkchoiceStateV1,
Expand Down