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-0177: Program Runtime ABI v2 #177

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Lichtso
Copy link
Contributor

@Lichtso Lichtso commented Oct 1, 2024

No description provided.

- Readonly instruction accounts get no growth padding.
- For writable instruction accounts additional capacity is allocated and mapped
for potential account growth. The maximum capacity is the length of the account
payload at the beginning of the transaction plus 10 KiB. CPI can not grow

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are independent. SIMD-0163 is about the program being called, that is not affected in this SIMD.

Copy link
Contributor

@buffalojoec buffalojoec Oct 10, 2024

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could increase the account realloc / resize limit if there are no interactions of ABI v0/v1 and ABI v2 programs in the CPI call tree of a top level instruction. See the discussion with Sean below.

each starting at a 4 GiB boundary in virtual address space:

- Writable header:
- Magic: `u32`: `0x41424976`
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For programs to differentiate it from ABI v0 and v1. See "Backwards Compatibility".

Comment on lines +50 to +53
SDKs will have to support both ABI v1 and v2 for a transition period. The
program runtime must only use ABI v2 if all programs in a transaction support
it. Programs signal their support through their SBPF version field (TBD) while

Choose a reason for hiding this comment

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

| The program runtime must only use ABI v2 if all programs in a transaction support it.

Why this restriction? It's possible to execute some programs with direct mapping and others without in the same transaction.

Copy link
Contributor Author

@Lichtso Lichtso Oct 4, 2024

Choose a reason for hiding this comment

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

Yes, technically the restriction could be relaxed to be within the CPI tree of one top-level instruction to prevent caller and callee from having different ABI versions. However, unlike all programs in a transaction, we don't know what is going to be called in CPI beforehand.

Copy link

@seanyoung seanyoung Oct 8, 2024

Choose a reason for hiding this comment

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

My point is: why prevent caller and callee from having different ABI versions.

I meant to say that it is possible to execute some programs with direct mapping and some without, within the same instruction/CPI tree.

Sure that needs some refactoring in agave, but it might be worth it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Our implementation of direct mapping is explicitly built on the assumption that caller and callee both use or not use direct mapping. Mixing them would lead to trouble e.g. in account payload reallocation.

@Lichtso Lichtso force-pushed the program-runtime-abiv2 branch 3 times, most recently from afd244e to caa91dd Compare October 16, 2024 08:25
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.

6 participants