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

Why does ApplicationEngine.Run default to test mode? #1851

Closed
devhawk opened this issue Aug 18, 2020 · 6 comments
Closed

Why does ApplicationEngine.Run default to test mode? #1851

devhawk opened this issue Aug 18, 2020 · 6 comments
Labels
Question Used in questions

Comments

@devhawk
Copy link
Contributor

devhawk commented Aug 18, 2020

Prior to #1819, ApplicationEngine.Run testMode parameter defaulted to false. Now, the gas parameter defaults to TestModeGas.

Wouldn't it make more sense to default gas parameter to zero? Or remove the default entirely?

@devhawk devhawk added the Question Used in questions label Aug 18, 2020
@Tommo-L
Copy link
Contributor

Tommo-L commented Aug 19, 2020

Or remove the default entirely?

Agree.

@shargon
Copy link
Member

shargon commented Aug 19, 2020

Yes, I think that we can remove the default value.

@Tommo-L
Copy link
Contributor

Tommo-L commented Aug 19, 2020

As this method, how about renaming TestModeGas to DefaultGas or setting it zero?

public static ApplicationEngine Run(byte[] script, StoreView snapshot = null, IVerifiable container = null, Block persistingBlock = null, int offset = 0, long gas = TestModeGas)

@erikzhang
Copy link
Member

Because in most cases we use test mode.

@Qiao-Jin
Copy link
Contributor

Qiao-Jin commented Aug 19, 2020

I think we should use wallet balance instead of testmodegas, as in common sense the one who tests executing script locally will send corresponding transaction. Furthermore, a 20 gas testmodegas might not be enough for some cases.

@superboyiii
Copy link
Member

superboyiii commented Sep 2, 2020

I think we should use wallet balance instead of testmodegas, as in common sense the one who tests executing script locally will send corresponding transaction. Furthermore, a 20 gas testmodegas might not be enough for some cases.

But this means you'll always return fault if you don't open your wallet when execution. It doesn't make sense. Virtual resource cost should not be the same value of actual wallet balance. If like that, you always need open wallet and have enough gas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Used in questions
Projects
None yet
Development

No branches or pull requests

6 participants