add replay network 65534 as nid where txns from other networks can be replayed

This commit is contained in:
Richard Holland
2025-06-04 15:06:21 +10:00
parent 38e1332b10
commit 7d95316de4

View File

@@ -67,11 +67,16 @@ preflight0(PreflightContext const& ctx)
else else
{ {
// new networks both require the field to be present and require it // new networks both require the field to be present and require it
// to match // to match, except for some special networks
if (!txNID)
return telREQUIRES_NETWORK_ID;
if (*txNID != nodeNID) if (nodeNID == 65534 /* replay network */)
{
// on the replay network any other network's transactions can be
// replayed last ledger sequence is also ignored on this network
}
else if (!txNID)
return telREQUIRES_NETWORK_ID;
else if (*txNID != nodeNID)
return telWRONG_NETWORK; return telWRONG_NETWORK;
} }
} }
@@ -641,9 +646,18 @@ Transactor::checkPriorTxAndLastLedger(PreclaimContext const& ctx)
return tefWRONG_PRIOR; return tefWRONG_PRIOR;
} }
uint32_t nodeNID = ctx.app.config().NETWORK_ID;
if (ctx.tx.isFieldPresent(sfLastLedgerSequence) && if (ctx.tx.isFieldPresent(sfLastLedgerSequence) &&
(ctx.view.seq() > ctx.tx.getFieldU32(sfLastLedgerSequence))) (ctx.view.seq() > ctx.tx.getFieldU32(sfLastLedgerSequence)))
return tefMAX_LEDGER; {
if (ctx.app.config().NETWORK_ID == 65534)
{
// on the replay network lls is ignored to allow txns to be replayed
}
else
return tefMAX_LEDGER;
}
if (ctx.view.txExists(ctx.tx.getTransactionID())) if (ctx.view.txExists(ctx.tx.getTransactionID()))
return tefALREADY; return tefALREADY;