Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subjective limit for mod_exp #361

Closed
arhag opened this issue Jun 9, 2022 · 1 comment · Fixed by #739 or #742
Closed

Add subjective limit for mod_exp #361

arhag opened this issue Jun 9, 2022 · 1 comment · Fixed by #739 or #742
Assignees

Comments

@arhag
Copy link
Member

arhag commented Jun 9, 2022

#182 adds a host function mod_exp for modular exponentiation. There are currently no limits on that. It may be necessary to enforce some limits to prevent the actual termination of a transaction from being delayed too much beyond the intended deadline timeout.

Benchmarking should be done to determine what are appropriate permissive limits that prevent a contract from creating too much of a delay (less than a millisecond?) within the process of aborting the transaction. Those limits should then be enforced in the mod_exp host function as a subjective exception (meaning it would be enforced at the BPs and not actually part of the protocol).

@arhag arhag moved this to Todo in ENF Engineering Jun 10, 2022
@arhag arhag self-assigned this Jun 21, 2022
@arhag arhag self-assigned this Jun 21, 2022
@arhag arhag added this to the Mandel 3.1.0 milestone Jun 30, 2022
@arhag arhag removed the 3.1 RC3 label Jun 30, 2022
@arhag arhag moved this from Todo to In Progress in ENF Engineering Jul 14, 2022
@stephenpdeos
Copy link
Member

This is partially dependent on gmp #362. Until this is done, we won't be 100% on hardcoded values

arhag added a commit to eosnetworkfoundation/mandel-fc that referenced this issue Aug 3, 2022
This is part of the effort to add subjective limits to the
mod_exp host function (see eosnetworkfoundation/mandel#361).

Adds a few additional test vectors to existing modexp test case.

Adds a modexp_benchmarking test case which is not actually a test
but rather a way to get measurements on the time it takes to do
modular exponentiation with varying bit sizes to figure out what the
appropriate limit should be for the mod_exp host function.
@arhag arhag linked a pull request Aug 3, 2022 that will close this issue
arhag added a commit to eosnetworkfoundation/mandel-fc that referenced this issue Aug 3, 2022
This is part of the effort to add subjective limits to the
mod_exp host function (see eosnetworkfoundation/mandel#361).

Adds a few additional test vectors to existing modexp test case.

Adds a modexp_benchmarking test case which is not actually a test
but rather a way to get measurements on the time it takes to do
modular exponentiation with varying bit sizes to figure out what the
appropriate limit should be for the mod_exp host function.
arhag added a commit that referenced this issue Aug 3, 2022
@arhag arhag moved this from In Progress to Awaiting Review in ENF Engineering Aug 3, 2022
arhag added a commit that referenced this issue Aug 3, 2022
…p-limits-for-3.1

[3.1] Add subjective limit to mod_exp host function
@arhag arhag moved this from Awaiting Review to Reviewer Approved in ENF Engineering Aug 3, 2022
@arhag arhag closed this as completed in #742 Aug 3, 2022
arhag added a commit that referenced this issue Aug 3, 2022
…p-limits-for-main

[3.1 -> main] Add subjective limit to mod_exp host function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment