Skip to content

Fix 7702 signature bound checks#7641

Merged
macfarla merged 6 commits intobesu-eth:mainfrom
daniellehrner:fix/7702_signature_bound_checks
Sep 20, 2024
Merged

Fix 7702 signature bound checks#7641
macfarla merged 6 commits intobesu-eth:mainfrom
daniellehrner:fix/7702_signature_bound_checks

Conversation

@daniellehrner
Copy link
Copy Markdown
Contributor

PR description

7702 signatures have different bound checks than regular transaction signatures. This PR create a new signature class for them with their own checks.

…ferent bound checks

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

env:
GRADLE_OPTS: "-Xmx6g"
GRADLE_OPTS: "-Xmx7g"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want to reduce the failure rate of ATs, then increase the number of total runners, maybe you can move 2 from reference-tests, that are faster, here

checkNotNull(r);
checkNotNull(s);

if (r.compareTo(TWO_POW_256) >= 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could be a bit more precise here and check whether r and s are smaller than the prime of the curve, which is p = 2^256-2^32-977. But that still does not guarantee that (r, s) is a point on the curve.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the code this could be any curve that is being used here, so 2^256 might be better for an initial check?

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
@macfarla macfarla merged commit cb1e36a into besu-eth:main Sep 20, 2024
daniellehrner added a commit to daniellehrner/besu that referenced this pull request Sep 20, 2024
* create separate signature class for code delegations as they have different bound checks

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* test if increasing xmx let's failing acceptance test pass

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* javadoc

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Wolmin pushed a commit to lukso-network/network-besu that referenced this pull request Sep 27, 2024
* create separate signature class for code delegations as they have different bound checks

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* test if increasing xmx let's failing acceptance test pass

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* javadoc

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Wolmin <lamonos123@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants