make account starting seq the parent close time to prevent replay attacks in reset networks (#131)

* make account starting seq the parent close time to prevent replay attacks in reset networks

* add tests for activation

---------

Co-authored-by: Denis Angell <dangell@transia.co>
This commit is contained in:
RichardAH
2023-10-09 14:18:23 +02:00
committed by GitHub
parent 428009c8ca
commit b4022c35b3
7 changed files with 135 additions and 87 deletions

View File

@@ -595,6 +595,8 @@ ValidNewAccountRoot::finalize(
if ((tt == ttPAYMENT || tt == ttIMPORT || tt == ttGENESIS_MINT) && result == tesSUCCESS)
{
std::uint32_t const startingSeq{
view.rules().enabled(featureXahauGenesis)
? view.info().parentCloseTime.time_since_epoch().count() :
view.rules().enabled(featureDeletableAccounts)
? view.seq()
: 1};