Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fa4eee2
add full node test
Manav-Aggarwal Jun 25, 2025
bd71544
Refactor EVM full node test
Manav-Aggarwal Jun 25, 2025
eed64f6
Add Multiple Transaction Inclusion Test
Manav-Aggarwal Jun 25, 2025
065b7ef
Separate sequencer and full node e2e tests
Manav-Aggarwal Jun 25, 2025
ca15034
Add full node state root verification
Manav-Aggarwal Jun 25, 2025
5091f89
add Double-Spend/Nonce Handling Test
Manav-Aggarwal Jun 25, 2025
c350346
Add Invalid Transaction Rejection Test
Manav-Aggarwal Jun 25, 2025
9ed2542
Add TestEvmFullNodeBlockPropagationE2E
Manav-Aggarwal Jun 25, 2025
9d20daf
Refactor more
Manav-Aggarwal Jun 25, 2025
303c580
Update file headers
Manav-Aggarwal Jun 25, 2025
c4bca3f
Refactor more
Manav-Aggarwal Jun 25, 2025
81afb2d
Add E2Etest for lazy sequencing + full node
Manav-Aggarwal Jun 25, 2025
f9855c8
test: Add sequencer restart/recovery test and revert ExecuteTxs to us…
Manav-Aggarwal Jun 26, 2025
7b7be7e
Update README
Manav-Aggarwal Jun 26, 2025
9ee6b46
Speed up tests
Manav-Aggarwal Jun 26, 2025
3b2827c
Make restart test CI friendly
Manav-Aggarwal Jun 26, 2025
fd7ab38
Extend testSequencerRecoveryTest with lazy mode
Manav-Aggarwal Jun 26, 2025
c674f5f
Extend to different combinations of lazy and normal mode
Manav-Aggarwal Jun 26, 2025
e15477d
fix timestamp validation
Manav-Aggarwal Jun 27, 2025
bea5d7e
Update timestamp to be in seconds
Manav-Aggarwal Jun 27, 2025
86f9f69
Update e2e tests to use 100ms block time
Manav-Aggarwal Jun 27, 2025
23ee053
address nit comment
Manav-Aggarwal Jun 30, 2025
1df4ebc
update volume
Manav-Aggarwal Jun 30, 2025
2e76463
Update test/e2e/evm_full_node_e2e_test.go
Manav-Aggarwal Jun 30, 2025
5171bed
update makefile logs
Manav-Aggarwal Jul 1, 2025
0c8d343
Revert "feat: execution verification (#2377)"
Manav-Aggarwal Jul 1, 2025
d6aee4b
Revert "fix: getPeers size check (#2408)"
Manav-Aggarwal Jul 1, 2025
badfe37
Revert "feat: migrate logging to ipfs/go-log/v2 (#2411)"
Manav-Aggarwal Jul 1, 2025
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
4 changes: 2 additions & 2 deletions apps/evm/single/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Note: Replace `<path_to>` with the actual path to the rollkit repository. If you

The sequencer can be configured using various command-line flags. The most important ones are:

- `--rollkit.node.aggregator`: Set to true to run in aggregator mode
- `--rollkit.node.aggregator`: Set to true to run in sequencer mode
- `--rollkit.signer.passphrase`: Passphrase for the signer
- `--evm.jwt-secret`: JWT secret for EVM communication
- `--evm.genesis-hash`: Genesis hash of the EVM chain
Expand Down Expand Up @@ -85,7 +85,7 @@ The sequencer can be configured using various command-line flags. The most impor
```bash
./evm-single start \
--home ~/.evm-single-full-node \
--evm.jwt-secret $(cat ../../../execution/evm/docker/jwttoken/jwt.hex) \
--evm.jwt-secret $(cat <path_to>/execution/evm/docker/jwttoken/jwt.hex) \
--evm.genesis-hash 0x2b8bbb1ea1e04f9c9809b4b278a8687806edc061a356c7dbc491930d8e922503 \
--rollkit.rpc.address=127.0.0.1:46657 \
--rollkit.p2p.listen_address=/ip4/127.0.0.1/tcp/7677 \
Expand Down
4 changes: 2 additions & 2 deletions apps/evm/single/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ services:
- rollkit-network

rollkit-evm-single:
image: ghcr.io/rollkit/rollkit-evm-single:v0.1.6
image: ghcr.io/rollkit/rollkit-evm-single:pr-2394
depends_on:
rollkit-reth:
condition: service_started
local-da:
condition: service_started
volumes:
- evm-single-data:/data
- evm-single-data:/root/.evm-single/
entrypoint: /usr/bin/entrypoint.sh
environment:
- EVM_ENGINE_URL=http://rollkit-reth:8551
Expand Down
15 changes: 10 additions & 5 deletions execution/evm/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,21 @@ func (c *EngineClient) ExecuteTxs(ctx context.Context, txs [][]byte, blockHeight
txsPayload[i] = "0x" + hex.EncodeToString(tx)
}

_, _, prevGasLimit, _, err := c.getBlockInfo(ctx, blockHeight-1)
prevBlockHash, _, prevGasLimit, prevTimestamp, err := c.getBlockInfo(ctx, blockHeight-1)
if err != nil {
return nil, 0, fmt.Errorf("failed to get block info: %w", err)
}

ts := uint64(timestamp.Unix())
if ts <= prevTimestamp {
ts = prevTimestamp + 1 // Subsequent blocks must have a higher timestamp.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems entirely arbitrary, taking the old time stamp add adding one could mean that the execution timestamp could skew over time.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes this is also a reversion to what was changed already in https://github.com/rollkit/rollkit/pull/2373/files#r2178117196

Note that all indexers etc use timestamp in seconds, and what's that Unix() time here does. Without this change, running a chain with a block time in milliseconds breaks since reth rejects building two blocks with the same timestamp, so this was a workaround for the time being. We should have a different way as a followup

}

c.mu.Lock()
args := engine.ForkchoiceStateV1{
HeadBlockHash: c.currentHeadBlockHash,
SafeBlockHash: c.currentSafeBlockHash,
FinalizedBlockHash: c.currentFinalizedBlockHash,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

were these empty or why remove them?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is actually how the our execution evm implementation used to work before this PR: https://github.com/rollkit/rollkit/pull/2373/files#r2178116028

we already have a follow up issue for this: #2402

if we do not have this change, restarts for the evm do not work well since on startup the all the current hashes are set to the genesisHash, and it'll try to make a forkChoiceUpdatedV3 call with the genesis hash again on restart. Made this change back to make restarts work well when XO markets pointed out that restarts used to work fine but didn't work after this PR: #2373

HeadBlockHash: prevBlockHash,
SafeBlockHash: prevBlockHash,
FinalizedBlockHash: prevBlockHash,
}
c.mu.Unlock()

Expand All @@ -200,7 +205,7 @@ func (c *EngineClient) ExecuteTxs(ctx context.Context, txs [][]byte, blockHeight
// Create rollkit-compatible payload attributes with flattened structure
rollkitPayloadAttrs := map[string]interface{}{
// Standard Ethereum payload attributes (flattened) - using camelCase as expected by JSON
"timestamp": uint64(timestamp.Unix()),
"timestamp": ts,
"prevRandao": c.derivePrevRandao(blockHeight),
"suggestedFeeRecipient": c.feeRecipient,
"withdrawals": []*types.Withdrawal{},
Expand Down
40 changes: 40 additions & 0 deletions execution/evm/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,43 @@ func GetGenesisHash(t *testing.T) string {
require.NotEmpty(t, result.Result.Hash)
return result.Result.Hash
}

// SetupTestRethEngineFullNode sets up a Reth full node test environment using Docker Compose with the full node configuration.
// This function is specifically for setting up full nodes that connect to ports 8555/8561.
func SetupTestRethEngineFullNode(t *testing.T, dockerPath, jwtFilename string) string {
t.Helper()
dockerAbsPath, err := filepath.Abs(dockerPath)
require.NoError(t, err)
jwtPath := filepath.Join(dockerAbsPath, "jwttoken")
err = os.MkdirAll(jwtPath, 0750)
require.NoError(t, err)
jwtSecret, err := generateJWTSecret()
require.NoError(t, err)
jwtFile := filepath.Join(jwtPath, jwtFilename)
err = os.WriteFile(jwtFile, []byte(jwtSecret), 0600)
require.NoError(t, err)
t.Cleanup(func() { _ = os.Remove(jwtFile) })

// Use the full node compose file
composeFilePath := filepath.Join(dockerAbsPath, "docker-compose-full-node.yml")
identifier := tc.StackIdentifier(strings.ToLower(t.Name()) + "_fullnode")
identifier = tc.StackIdentifier(strings.ReplaceAll(string(identifier), "/", "_"))
identifier = tc.StackIdentifier(strings.ReplaceAll(string(identifier), " ", "_"))
compose, err := tc.NewDockerComposeWith(tc.WithStackFiles(composeFilePath), identifier)
require.NoError(t, err, "Failed to create docker compose for full node")
t.Cleanup(func() {
ctx := context.Background()
err := compose.Down(ctx, tc.RemoveOrphans(true), tc.RemoveVolumes(true))
if err != nil {
t.Logf("Warning: Failed to tear down docker-compose environment: %v", err)
}
})
ctx := context.Background()
err = compose.Up(ctx, tc.Wait(true))
require.NoError(t, err, "Failed to start docker compose for full node")

// Wait for full node Reth container (ports 8555, 8561)
err = waitForRethContainer(t, jwtSecret, "http://localhost:8555", "http://localhost:8561")
require.NoError(t, err)
return jwtSecret
}
Comment thread
Manav-Aggarwal marked this conversation as resolved.
Resolved
85 changes: 0 additions & 85 deletions test/e2e/evm_aggregator_e2e_test.go

This file was deleted.

Loading