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

propagate OOG from pov and MBIP5 #225

Merged
merged 4 commits into from
Sep 16, 2024

Conversation

librelois
Copy link

No description provided.

ExitReason::Error(ExitError::OutOfGas),
Default::default(),
used_gas,
U256([gas_limit, 0, 0, 0]),
Copy link

Choose a reason for hiding this comment

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

U256 implements From<u64>

Suggested change
U256([gas_limit, 0, 0, 0]),
U256::from(gas_limit),

}
})
// This should always return `Some`, but let's play it safe.
.expect("STORAGE_OOG not defined")
Copy link

Choose a reason for hiding this comment

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

Instead of panic here, even if never expected, we should change the return type to Result and let the caller handle the unexpected behaviour. It is a better design to return the Result instead since this will be used in the runtime.

Copy link

@RomarQ RomarQ left a comment

Choose a reason for hiding this comment

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

Added a few remarks, but the functionality looks good to me.

@librelois librelois merged commit 42a7a8e into moonbeam-polkadot-v1.11.0 Sep 16, 2024
@librelois librelois deleted the elois-storage-oog branch September 16, 2024 13:31
gonzamontiel pushed a commit that referenced this pull request Sep 19, 2024
TarekkMA pushed a commit that referenced this pull request Oct 24, 2024
TarekkMA pushed a commit that referenced this pull request Oct 25, 2024
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