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

Unlimited account update support #1919

Merged
merged 7 commits into from
Nov 27, 2024
Merged

Unlimited account update support #1919

merged 7 commits into from
Nov 27, 2024

Conversation

youtpout
Copy link
Contributor

Some blockchain like zeko are not limited by account update, to enable transaction creation for these blockchains, I've added a new parameter to the network property enforceTransactionLimits as for local blockchain.

Resolve #1910

Copy link
Contributor

@45930 45930 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

I will do a more thorough review before approving, but I think this looks good. The one consideration is that it doesn't allow for a dev to set their own custom transaction limits. It's only an on/off. Does zeko not have transaction limits at all?

@@ -158,6 +161,11 @@ function Network(
lightnetAccountManagerEndpoint = options.lightnetAccountManager;
Fetch.setLightnetAccountManagerEndpoint(lightnetAccountManagerEndpoint);
}

if (options.enforceTransactionLimits !== undefined &&
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be cleaner to name the option bypassTransactionLimits. That way undefined and false both resolve to the default behavior. Then I think this could be

enforceTransactionLimits = options.bypassTransactionLimits ? false : true;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to reuse the same name than LocalBlockchain :
async function LocalBlockchain({ proofsEnabled = true, enforceTransactionLimits = true, } = {}) {

enforceTransactionLimits = true,

Comment on lines 165 to 168
if (options.enforceTransactionLimits !== undefined &&
typeof options.enforceTransactionLimits === 'boolean') {
enforceTransactionLimits = options.enforceTransactionLimits;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (options.enforceTransactionLimits !== undefined &&
typeof options.enforceTransactionLimits === 'boolean') {
enforceTransactionLimits = options.enforceTransactionLimits;
}
const byPassTransactionLimits = options.enforceTransactionLimits === false;
enforceTransactionLimits = !byPassTransactionLimits;

I still think this would be more understandable, while respecting the argument agreement with the other function

src/lib/mina/transaction.test.ts Outdated Show resolved Hide resolved
@shimkiv
Copy link
Member

shimkiv commented Nov 27, 2024

Hey @youtpout, can you please merge the main branch changes into your branch.

@youtpout
Copy link
Contributor Author

Hey @youtpout, can you please merge the main branch changes into your branch.

Done

@45930
Copy link
Contributor

45930 commented Nov 27, 2024

@shimkiv, do you know what's wrong with the benchmark o1js job? It looks like it build o1js then immediately fails.

@shimkiv
Copy link
Member

shimkiv commented Nov 27, 2024

@45930 it is related to self-hosted runners, repo CI config and external contributors. Back then we decided that it is not a big issue and didn't provide a fix (if it exists).

@shimkiv
Copy link
Member

shimkiv commented Nov 27, 2024

@45930 for example, this particular job relies on repo secrets that external contributors simply don't have, hence the job is failing.

@45930 45930 merged commit 50306ef into o1-labs:main Nov 27, 2024
26 of 28 checks passed
@45930
Copy link
Contributor

45930 commented Nov 27, 2024

Thanks for explaining @shimkiv

@youtpout thanks again for the contribution!

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.

Remove account update limit for zeko
3 participants