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

SIMD-0191: Relax Transaction Constraints - Loading Failures #191

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

apfitzge
Copy link
Contributor

@apfitzge apfitzge commented Nov 6, 2024

This proposal was split out of #82 in order to simplify the review process and have a more tightly coupled SIMD-feature activation relationship.

@apfitzge apfitzge force-pushed the enable_transaction_loading_failure_fees branch from 085412a to b9a67a7 Compare November 6, 2024 15:48
@apfitzge apfitzge changed the title Relax Transaction Constraints - Loading Failures SIMD-0191: Relax Transaction Constraints - Loading Failures Nov 6, 2024
@apfitzge apfitzge force-pushed the enable_transaction_loading_failure_fees branch from b9a67a7 to b2b0c4e Compare November 6, 2024 15:51
type: Core
status: Review
created: 2024-11-06
feature: PaymEPK2oqwT9TXAVfadjztH2H6KfLEB9Hhd5Q5frvP
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's link to the github issue instead: anza-xyz/agave#3244

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added link with feature key as well

Copy link

@topointon-jump topointon-jump left a comment

Choose a reason for hiding this comment

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

I support the general idea, could we just specify what the new runtime transaction checks will be; where they will be checked and what errors they will throw if they are violated? 🙏

- the owner account be owned by the native loader: `NativeLoader1111111111111111111111111111111`
- the owner account must be executable

This proposal moves these errors from protocol violations to runtime errors.

Choose a reason for hiding this comment

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

Could we specify if these checks are replicated in the runtime, and at what stage? Will the SVM throw these errors? Which errors will be thrown?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added: cc73e72

Copy link
Contributor

@godmodegalactus godmodegalactus left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 70 to 72
Constraints must be checked before committing transactions and voting.
It is reccomended that the constraints are checked before transaction
execution, in order to avoid unnecessary computation.
Copy link
Contributor

Choose a reason for hiding this comment

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

How about

Constraints SHOULD be checked for each transaction before execution to avoid unnecessary computation. If a constraint violating transaction is executed, the constraints MUST be checked BEFORE committing transaction changes.

I don't exactly get why you said "and voting".. is specifying before committing sufficient?

Comment on lines 88 to 92
- (`InvalidProgramForExecution`) Transaction-level instruction invokes an
account which is not owned by an account which is owned by the native
loader (only relevant after [SIMD-0162](https://github.com/solana-foundation/solana-improvement-documents/pull/162))
- (``ProgramAccountNotFound`) Transaction-level instruction invokes an
account whose owner does not exist (only relevant after [SIMD-0162](https://github.com/solana-foundation/solana-improvement-documents/pull/162))
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically these should be flipped around right? And we forgot about checking that the owner account is executable as well.

Comment on lines 82 to 83
- `ProgramAccountNotFound`, `InvalidProgramForExecution` - breaking constraint 2.
Currently checks are performed in this order:
Copy link
Contributor

Choose a reason for hiding this comment

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

Annoyingly, if we want errors to be exactly the same.. We need to prescribe that invoked program accounts are checked in tx instruction order as well. And after we check each invoked program, we need to check for MaxLoadedAccountDataSizeExceeded again after adding the owner account's data size 🤮

Copy link
Contributor Author

Choose a reason for hiding this comment

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

proposal to just wrap these all into a new variant TransactionError::LoadError and give up 😭

I will specify it should be in instruction order as well

@apfitzge
Copy link
Contributor Author

@topointon-jump I think I addressed your previous review. Could you re-review this?

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.

4 participants