Skip to content

Commit f314666

Browse files
committed
debug and get 6493 end to end client spec working
1 parent 449a9e2 commit f314666

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

packages/client/src/rpc/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const toJSONRPCTx = (
4444
merkleBranch: Uint8Array[]
4545
transactionsRoot: Uint8Array
4646
transactionRoot: Uint8Array
47-
}
47+
},
4848
): JSONRPCTx => {
4949
const txJSON = tx.toJSON()
5050
return {

packages/client/src/rpc/modules/engine/validators.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const transaction = validators.hexOrObject(
1010
validators.object({
1111
regular: validators.nullOptional(validators.uint256),
1212
blob: validators.nullOptional(validators.uint256),
13-
})
13+
}),
1414
),
1515
gas: validators.nullOptional(validators.uint64),
1616
to: validators.nullOptional(validators.address),
@@ -21,22 +21,22 @@ const transaction = validators.hexOrObject(
2121
validators.object({
2222
address: validators.address,
2323
storageKeys: validators.array(validators.bytes32),
24-
})
25-
)
24+
}),
25+
),
2626
),
2727
maxPriorityFeesPerGas: validators.nullOptional(
2828
validators.object({
2929
regular: validators.nullOptional(validators.uint256),
3030
blob: validators.nullOptional(validators.uint256),
31-
})
31+
}),
3232
),
3333
blobVersionedHashes: validators.nullOptional(validators.array(validators.bytes32)),
3434
}),
3535
signature: validators.object({
3636
from: validators.nullOptional(validators.address),
3737
ecdsaSignature: validators.nullOptional(validators.hex),
3838
}),
39-
})
39+
}),
4040
)
4141

4242
export const executionPayloadV1FieldValidators = {

packages/client/src/rpc/modules/eth.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ export class Eth {
825825
transactionsRoot: block.header.transactionsTrie,
826826
...ssz.computeTransactionInclusionProof(
827827
block.transactions.map((tx) => tx.sszRaw()),
828-
txIndex
828+
txIndex,
829829
),
830830
}
831831
}
@@ -861,7 +861,7 @@ export class Eth {
861861
transactionsRoot: block.header.transactionsTrie,
862862
...ssz.computeTransactionInclusionProof(
863863
block.transactions.map((tx) => tx.sszRaw()),
864-
txIndex
864+
txIndex,
865865
),
866866
}
867867
}
@@ -895,7 +895,7 @@ export class Eth {
895895
transactionsRoot: block.header.transactionsTrie,
896896
...ssz.computeTransactionInclusionProof(
897897
block.transactions.map((tx) => tx.sszRaw()),
898-
txIndex
898+
txIndex,
899899
),
900900
}
901901
}

packages/client/test/rpc/engine/newPayloadEip6493.spec.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { TransactionFactory } from '@ethereumjs/tx'
1+
import { createTx } from '@ethereumjs/tx'
22
import { bigIntToHex, hexToBytes } from '@ethereumjs/util'
33
import { assert, describe, it } from 'vitest'
44

5-
import blocks from '../../testdata/blocks/beacon.json'
6-
import genesisJSON from '../../testdata/geth-genesis/post-merge.json'
7-
import { getRpcClient, setupChain } from '../helpers.js'
5+
import { beaconData } from '../../testdata/blocks/beacon.js'
6+
import { postMergeData } from '../../testdata/geth-genesis/post-merge.js'
7+
import { getRPCClient, setupChain } from '../helpers.js'
88

99
const method = 'engine_newPayloadV4'
10-
const [blockData] = blocks
10+
const [blockData] = beaconData
1111

1212
const parentBeaconBlockRoot = '0x42942949c4ed512cd85c2cb54ca88591338cbb0564d3a2bea7961a639ef29d64'
1313
const validForkChoiceState = {
@@ -48,9 +48,9 @@ describe(`${method}: call with executionPayloadV4`, () => {
4848
it('valid data', async () => {
4949
// get the genesis json with late enougt date with respect to block data in batchBlocks
5050

51-
const { pragueJson, pragueTime } = readyEip6493Genesis(genesisJSON)
51+
const { pragueJson, pragueTime } = readyEip6493Genesis(postMergeData)
5252
const { service, server, common } = await setupChain(pragueJson, 'post-merge', { engine: true })
53-
const rpc = getRpcClient(server)
53+
const rpc = getRPCClient(server)
5454
const validBlock = {
5555
...blockData,
5656
timestamp: bigIntToHex(BigInt(pragueTime)),
@@ -78,7 +78,7 @@ describe(`${method}: call with executionPayloadV4`, () => {
7878

7979
// address 0x610adc49ecd66cbf176a8247ebd59096c031bd9f has been sufficiently funded in genesis
8080
const pk = hexToBytes('0x9c9996335451aab4fc4eac58e31a8c300e095cdbcee532d53d09280e83360355')
81-
const depositTx = TransactionFactory.fromTxData(
81+
const depositTx = createTx(
8282
{
8383
data: '0x22895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001208cd4e5a69709cf8ee5b1b73d6efbf3f33bcac92fb7e4ce62b2467542fb50a72d0000000000000000000000000000000000000000000000000000000000000030ac842878bb70009552a4cfcad801d6e659c50bd50d7d03306790cb455ce7363c5b6972f0159d170f625a99b2064dbefc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020010000000000000000000000818ccb1c4eda80270b04d6df822b1e72dd83c3030000000000000000000000000000000000000000000000000000000000000060a747f75c72d0cf0d2b52504c7385b516f0523e2f0842416399f42b4aee5c6384a5674f6426b1cc3d0827886fa9b909e616f5c9f61f986013ed2b9bf37071cbae951136265b549f44e3c8e26233c0433e9124b7fd0dc86e82f9fedfc0a179d769',
8484
value: 32000000000000000000n,
@@ -87,11 +87,11 @@ describe(`${method}: call with executionPayloadV4`, () => {
8787
type: 2,
8888
to: '0x00000000219ab540356cBB839Cbe05303d7705Fa',
8989
},
90-
{ common }
90+
{ common },
9191
).sign(pk)
9292
await service.txPool.add(depositTx, true)
9393

94-
const normalLegacyTx = TransactionFactory.fromTxData(
94+
const normalLegacyTx = createTx(
9595
{
9696
data: '0x',
9797
value: 32000000000000000000n,
@@ -101,7 +101,7 @@ describe(`${method}: call with executionPayloadV4`, () => {
101101
to: '0x10000000219ab540356cBB839Cbe05303d7705Fa',
102102
nonce: 1,
103103
},
104-
{ common }
104+
{ common },
105105
).sign(pk)
106106
await service.txPool.add(normalLegacyTx, true)
107107

@@ -115,11 +115,11 @@ describe(`${method}: call with executionPayloadV4`, () => {
115115
assert.ok(executionPayload.transactions.length === 2, 'two transactions should have been added')
116116
assert.ok(
117117
executionPayload.depositRequests?.length === 1,
118-
'depositRequests should have 1 deposit request'
118+
'depositRequests should have 1 deposit request',
119119
)
120120
assert.ok(
121121
executionPayload.withdrawalRequests !== undefined,
122-
'depositRequests field should be received'
122+
'depositRequests field should be received',
123123
)
124124

125125
res = await rpc.request(method, [executionPayload, [], parentBeaconBlockRoot])

0 commit comments

Comments
 (0)