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

Update LimitSimulationGasDecorator with custom Gas Meter Setter #45

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

Kbhat1
Copy link
Contributor

@Kbhat1 Kbhat1 commented Apr 15, 2024

Corresponding sei-chain PR: sei-protocol/sei-chain#1546

TESTING

  • Tested and verified on node
  • NOTE: Still verifying unit test gas change

@Kbhat1 Kbhat1 requested a review from codchen April 15, 2024 23:10
@Kbhat1 Kbhat1 changed the title Update LimitSimulationGasDecorator Update LimitSimulationGasDecorator with custom Gas Meter Setter Apr 15, 2024
@@ -91,15 +91,15 @@ func TestGasCostOnQuery(t *testing.T) {
Depth: 1,
Work: 50,
},
expectedGas: 2*GasWork50 + GasReturnHashed,
expectedGas: 2*GasWork50 + GasReturnHashed + 1,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Verifying this update

Copy link
Contributor

Choose a reason for hiding this comment

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

do you mind shedding light as to why we expect 1 extra gas here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fyi @philipsu522 @udpatil this feels like it may be unrelated to this PR and possible rounding issues. Check this comment from before: https://github.com/sei-protocol/sei-wasmd/blob/UpdateLimitSimulationGasDecorator/x/wasm/keeper/recurse_test.go#L248

},
"recursion 4, some work": {
gasLimit: 400_000,
msg: Recurse{
Depth: 4,
Work: 50,
},
expectedGas: 5*GasWork50 + 4*GasReturnHashed,
expectedGas: 5*GasWork50 + 4*GasReturnHashed + 1,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Verifying this update

@Kbhat1 Kbhat1 requested a review from philipsu522 April 15, 2024 23:12
@@ -91,15 +91,15 @@ func TestGasCostOnQuery(t *testing.T) {
Depth: 1,
Work: 50,
},
expectedGas: 2*GasWork50 + GasReturnHashed,
expectedGas: 2*GasWork50 + GasReturnHashed + 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

do you mind shedding light as to why we expect 1 extra gas here?

x/wasm/keeper/ante.go Show resolved Hide resolved
@Kbhat1 Kbhat1 merged commit 413f974 into main Apr 19, 2024
2 checks passed
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.

5 participants