diff --git a/clients/prysm-bn/prysm_bn.sh b/clients/prysm-bn/prysm_bn.sh index 88fa21de3a..edbd3a6548 100755 --- a/clients/prysm-bn/prysm_bn.sh +++ b/clients/prysm-bn/prysm_bn.sh @@ -73,6 +73,7 @@ echo Starting Prysm Beacon Node --jwt-secret=/jwtsecret \ --min-sync-peers=1 \ --subscribe-all-subnets=true \ + --enable-debug-rpc-endpoints=true \ $metrics_option \ --deposit-contract="${HIVE_ETH2_CONFIG_DEPOSIT_CONTRACT_ADDRESS:-0x1111111111111111111111111111111111111111}" \ --contract-deployment-block="${HIVE_ETH2_DEPOSIT_DEPLOY_BLOCK_NUMBER:-0}" \ diff --git a/simulators/ethereum/engine/helper/helper.go b/simulators/ethereum/engine/helper/helper.go index 9d7a83817e..84271e03cf 100644 --- a/simulators/ethereum/engine/helper/helper.go +++ b/simulators/ethereum/engine/helper/helper.go @@ -2,6 +2,7 @@ package helper import ( "context" + "strings" "sync" "time" @@ -371,6 +372,13 @@ func MakeTransaction(nonce uint64, recipient *common.Address, gasLimit uint64, a return signedTx, nil } +// Determines if the error we got from sending the raw tx is because the client +// already knew the tx (might happen if we produced a re-org where the tx was +// unwind back into the txpool) +func SentTxAlreadyKnown(err error) bool { + return strings.Contains(err.Error(), "already known") +} + func SendNextTransaction(testCtx context.Context, node client.EngineClient, recipient common.Address, amount *big.Int, payload []byte, txType TestTransactionType) (*types.Transaction, error) { nonce, err := node.GetNextAccountNonce(testCtx, globals.VaultAccountAddress) if err != nil { @@ -383,6 +391,8 @@ func SendNextTransaction(testCtx context.Context, node client.EngineClient, reci err := node.SendTransaction(ctx, tx) if err == nil { return tx, nil + } else if SentTxAlreadyKnown(err) { + return tx, nil } select { case <-time.After(time.Second): diff --git a/simulators/ethereum/engine/suites/transition/tests.go b/simulators/ethereum/engine/suites/transition/tests.go index dd836fc86b..dfe231c779 100644 --- a/simulators/ethereum/engine/suites/transition/tests.go +++ b/simulators/ethereum/engine/suites/transition/tests.go @@ -65,6 +65,9 @@ type MergeTestSpec struct { // Chain file to initialize the main client. MainChainFile string + // Transaction type to use throughout the test + TestTransactionType helper.TestTransactionType + // Introduce PREVRANDAO transactions on the PoS blocks, including transition, // which could overwrite an existing transaction in the PoW chain (if re-org // occurred to a lower-height chain) @@ -213,6 +216,8 @@ var mergeTestSpecs = []MergeTestSpec{ MainChainFile: "blocks_2_td_393120.rlp", KeepCheckingUntilTimeout: true, PrevRandaoTransactions: true, + // Tx included in the proof-of-work chain is legacy + TestTransactionType: helper.LegacyTxOnly, SecondaryClientSpecs: []SecondaryClientSpec{ { ClientStarter: hive_rpc.HiveRPCEngineStarter{ @@ -1152,6 +1157,7 @@ func GenerateMergeTestSpec(mergeTestSpec MergeTestSpec) test.Spec { GenesisFile: mergeTestSpec.GenesisFile, DisableMining: mergeTestSpec.DisableMining, ChainFile: mergeTestSpec.MainChainFile, + TestTransactionType: mergeTestSpec.TestTransactionType, SafeSlotsToImportOptimistically: mergeTestSpec.SafeSlotsToImportOptimistically, } }