Xahau / xahaud

Codebase for Xahaud - The consensus, RPC & blockchain app for the Xahau network.
https://xahau.network
ISC License
24 stars 11 forks source link

Reduce XPOP signature checks performed by counting for invalid sigs #107

Open wojake opened 1 year ago

wojake commented 1 year ago

Reduce the potential number of XPOP signature checks performed by counting invalid sigs instead of valid sigs.

https://github.com/Xahau/xahaud/blob/37d3d7dae7c5c404b3635d434b1ee2be0d27695e/src/ripple/app/tx/impl/Import.cpp#L675

Should be changed to 0.2 and named quorumToBail

https://github.com/Xahau/xahaud/blob/37d3d7dae7c5c404b3635d434b1ee2be0d27695e/src/ripple/app/tx/impl/Import.cpp#L769-L779


if (invalid sig) -> invalidValidationCount++

In every sig check loop, before we verify the sig:

if (invalidValidationCount >= quorumToBail) -> error

We could also keep validationCount but it'd be redundant as invalidValidationCount exist.

RichardAH commented 1 year ago

not mvp but interesting thought (for later)