Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove more dead code
  • Loading branch information
tac0turtle
tac0turtle committed Jul 1, 2025
commit f7ae532966ff3dd1ecf48fd569526438e0087a98
65 changes: 0 additions & 65 deletions test/e2e/evm_test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/golang-jwt/jwt/v5"
"github.com/stretchr/testify/require"

"github.com/rollkit/rollkit/execution/evm"
Expand Down Expand Up @@ -111,21 +110,6 @@ func decodeSecret(jwtSecret string) ([]byte, error) {
return secret, nil
}

// getAuthToken creates a JWT token signed with the provided secret, valid for 1 hour.
func getAuthToken(jwtSecret []byte) (string, error) {
token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
"exp": time.Now().Add(time.Hour * 1).Unix(), // Expires in 1 hour
"iat": time.Now().Unix(),
})

// Sign the token with the decoded secret
authToken, err := token.SignedString(jwtSecret)
if err != nil {
return "", fmt.Errorf("failed to sign JWT token: %w", err)
}
return authToken, nil
}

// getNodeP2PAddress uses the net-info command to get the P2P address of a node.
// This is more reliable than parsing logs as it directly queries the node's state.
//
Expand Down Expand Up @@ -366,26 +350,6 @@ func setupCommonEVMTest(t *testing.T, sut *SystemUnderTest, needsFullNode bool)
return jwtSecret, fullNodeJwtSecret, genesisHash
}

// checkTxIncludedAt checks if a transaction was included in a block at the specified EVM endpoint.
// This utility function connects to the provided EVM endpoint and queries for the
// transaction receipt to determine if the transaction was successfully included.
//
// Parameters:
// - txHash: Hash of the transaction to check
// - ethURL: EVM endpoint URL to query (e.g., http://localhost:8545)
//
// Returns: true if transaction is included with success status, false otherwise
func checkTxIncludedAt(t *testing.T, txHash common.Hash, ethURL string) bool {
t.Helper()
rpcClient, err := ethclient.Dial(ethURL)
if err != nil {
return false
}
defer rpcClient.Close()
receipt, err := rpcClient.TransactionReceipt(context.Background(), txHash)
return err == nil && receipt != nil && receipt.Status == 1
}

// checkBlockInfoAt retrieves block information at a specific height including state root.
// This function connects to the specified EVM endpoint and queries for the block header
// to get the block hash, state root, transaction count, and other block metadata.
Expand Down Expand Up @@ -548,35 +512,6 @@ func restartDAAndSequencerLazy(t *testing.T, sut *SystemUnderTest, sequencerHome
sut.AwaitNodeUp(t, RollkitRPCAddress, NodeStartupTimeout)
}

// restartSequencerNode starts an existing sequencer node without initialization.
// This is used for restart scenarios where the node has already been initialized.
//
// Parameters:
// - sut: SystemUnderTest instance for managing test processes
// - sequencerHome: Directory path for sequencer node data
// - jwtSecret: JWT secret for sequencer's EVM engine authentication
// - genesisHash: Hash of the genesis block for chain validation
func restartSequencerNode(t *testing.T, sut *SystemUnderTest, sequencerHome, jwtSecret, genesisHash string) {
t.Helper()

// Start sequencer node (without init - node already exists)
sut.ExecCmd(evmSingleBinaryPath,
"start",
"--evm.jwt-secret", jwtSecret,
"--evm.genesis-hash", genesisHash,
"--rollkit.node.block_time", DefaultBlockTime,
"--rollkit.node.aggregator=true",
"--rollkit.signer.passphrase", TestPassphrase,
"--home", sequencerHome,
"--rollkit.da.address", DAAddress,
"--rollkit.da.block_time", DefaultDABlockTime,
)

time.Sleep(SlowPollingInterval)

sut.AwaitNodeUp(t, RollkitRPCAddress, NodeStartupTimeout)
}

// verifyNoBlockProduction verifies that no new blocks are being produced over a specified duration.
// This is used to test lazy mode behavior where blocks should only be produced when
// transactions are submitted.
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.24.2

require (
github.com/ethereum/go-ethereum v1.15.0
github.com/golang-jwt/jwt/v5 v5.2.2
github.com/libp2p/go-libp2p v0.41.1
github.com/rollkit/rollkit v0.0.0-00010101000000-000000000000
github.com/rollkit/rollkit/execution/evm v0.0.0-20250602130019-2a732cf903a5
Expand Down Expand Up @@ -96,6 +95,7 @@ require (
github.com/go-viper/mapstructure/v2 v2.3.0 // indirect
github.com/gofrs/flock v0.12.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v5 v5.2.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/gnostic-models v0.6.8 // indirect
Expand Down