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

Make MsgSubmitProposal a nondeterministic message #377

Merged
merged 8 commits into from
Feb 9, 2023

Conversation

wojtek-coreum
Copy link
Collaborator

@wojtek-coreum wojtek-coreum commented Feb 3, 2023

This change is Reviewable

Copy link
Contributor

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @dzmitryhil, @silverspase, and @ysv)

Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)


integration-tests/chain.go line 123 at r1 (raw file):

type BalancesOptions struct {
	Messages                    []sdk.Msg
	NondeterministicMessagesGas uint64

Why do we need it? What about the Amount it seems similar.

Code quote:

NondeterministicMessagesGas

integration-tests/gov.go line 20 at r1 (raw file):

)

const submitProposalGas = 200_000

Is it enough for any type? Maybe more ?

Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)

Copy link
Collaborator Author

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @silverspase, and @ysv)


integration-tests/chain.go line 123 at r1 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

Why do we need it? What about the Amount it seems similar.

Just to not mix the two, Amount is for what account wants to transfer, NondeterministicMessagesGas specifically defines the gas assigned to nondeterministic txs


integration-tests/gov.go line 20 at r1 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

Is it enough for any type? Maybe more ?

If we see that tests stop passing we will increase

Copy link
Contributor

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @silverspase, and @ysv)

Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)


integration-tests/chain.go line 123 at r1 (raw file):

Previously, wojtek-coreum (Wojtek) wrote…

Just to not mix the two, Amount is for what account wants to transfer, NondeterministicMessagesGas specifically defines the gas assigned to nondeterministic txs

But we already use the Amount for such cases, for example WASM.


integration-tests/gov.go line 20 at r1 (raw file):

Previously, wojtek-coreum (Wojtek) wrote…

If we see that tests stop passing we will increase

Maybe we can estimate before the submission and fund the account with the proper amount instead?

Copy link
Collaborator Author

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @silverspase, and @ysv)


integration-tests/chain.go line 123 at r1 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

But we already use the Amount for such cases, for example WASM.

Then it should be converted.


integration-tests/gov.go line 20 at r1 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

Maybe we can estimate before the submission and fund the account with the proper amount instead?

it's nondeterministic so it may change all the time.

Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)


integration-tests/chain.go line 123 at r1 (raw file):

Previously, wojtek-coreum (Wojtek) wrote…

Then it should be converted.

I still don't see a need for it, the value here is quite random, so just append to the amount.
I would agree if we somehow check that we spend just that amount, but we don't so no need to introduce additional amount.


integration-tests/gov.go line 20 at r1 (raw file):

Previously, wojtek-coreum (Wojtek) wrote…

it's nondeterministic so it may change all the time.

Estimate before the TX execution with gas multiplier = 1.3 and that is about 99% garanty for the znet.

Copy link
Collaborator Author

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @miladz68, @silverspase, and @ysv)


integration-tests/chain.go line 123 at r1 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

I still don't see a need for it, the value here is quite random, so just append to the amount.
I would agree if we somehow check that we spend just that amount, but we don't so no need to introduce additional amount.

IMO it's better to clearly separate them. @miladz68 @ysv

miladz68
miladz68 previously approved these changes Feb 8, 2023
Copy link
Contributor

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)


integration-tests/chain.go line 123 at r1 (raw file):

Previously, wojtek-coreum (Wojtek) wrote…

IMO it's better to clearly separate them. @miladz68 @ysv

I think treating it as non deterministic is a better approach. just let the default cosmos behavior take over and estimate the gas and then submit.

…deterministic-gas

# Conflicts:
#	x/deterministicgas/config_test.go
Copy link
Collaborator Author

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 of 14 files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @miladz68, @silverspase, and @ysv)


integration-tests/gov.go line 20 at r1 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

Estimate before the TX execution with gas multiplier = 1.3 and that is about 99% garanty for the znet.

Done.

Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 of 14 files reviewed, 1 unresolved discussion (waiting on @miladz68, @silverspase, @wojtek-coreum, and @ysv)


integration-tests/gov.go line 20 at r1 (raw file):

Previously, wojtek-coreum (Wojtek) wrote…

Done.

Let's use prev solution :-)

Copy link
Collaborator Author

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 14 files reviewed, 1 unresolved discussion (waiting on @dzmitryhil, @miladz68, @silverspase, and @ysv)


integration-tests/gov.go line 20 at r1 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

Let's use prev solution :-)

Done.

Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 14 files reviewed, all discussions resolved (waiting on @miladz68, @silverspase, and @ysv)

Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 12 files at r3, 3 of 6 files at r4, 9 of 9 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @silverspase and @ysv)

Copy link
Contributor

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 12 files at r3, 3 of 6 files at r4, 9 of 9 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @silverspase and @ysv)

@wojtek-coreum wojtek-coreum merged commit 8fba997 into master Feb 9, 2023
@wojtek-coreum wojtek-coreum deleted the wojtek/proposal-nondeterministic-gas branch February 9, 2023 11:06
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.

3 participants