Solana’s planned memory checks could make some app transactions fail even when the rest of the app keeps working. Developers have already seen one example in replayed mainnet transactions. Older code built with the Anchor framework could try to save an account’s data after handing control of that account to another program.
Anza, which develops Solana’s Agave validator software, resumed general mainnet feature activations on November 19. Its November 20 feature tracker lists the memory checks and a separate change called account data direct mapping as pending, with no mainnet activation epoch or slot for either. Direct mapping is designed to spare validators the work of repeatedly copying program data. (Related: University launches $5m smart system that checks who is...)
Anza’s November 20 tracker listed both switches as pending on Solana mainnet, with no activation slot for either.
The checks can reject a write to an account the program no longer owns, even while validators still use copied data. (Related: Industry News: “Determined” woman completes 7 marathons...)
The paths show conditional runtime behavior. Their lengths carry no timing or performance measurement.
Conceptual diagram from SIMD-0460, the original runtime proposal and Agave’s implementation split. The same check branches to a rejected access or to two possible routes for an allowed access.
Sources indicate that the paths show conditional runtime behavior. Their lengths carry no timing or performance measurement.
The memory checks can reject a read that runs past the end of an account or a write to an account the program cannot modify. They also change the stack layout older programs use to hold temporary data. Code that relied on that layout can behave differently after the change. One documented failure involves how Solana programs hand accounts to one another within a transaction.
It has been revealed that in the case described in an Anchor patch, one program calls another and transfers ownership of an account during the call. When the first program finishes, older Anchor code tries to write the account data back even when the bytes have stayed the same. The old runtime let that attempt pass. Under Solana’s newly introduced rules, the attempt fails because the first program has already given up the right to write to that account.
It has been revealed that the patch author says programs that delegated accounts this way hit the error in production replay. A transaction that takes the affected path can fail while an app’s other transactions continue to go through.
Anza engineer Alexander Meißner wrote in the original runtime proposal that the team replayed mainnet traffic. The proposal says most developers whose apps would have failed in that exercise were contacted and had made fixes. Replay checks the instruction paths that appeared in the sample. A rarely used path can escape that check if the transactions Anza replayed never took it.
In a recent development, meißner’s January 30 memory rules proposal says developers of the Agave and Firedancer validator clients split the original plan so earlier work could ship even if a later part needed more time. In Agave’s implementation discussion, Meißner described a separate testing problem. Combining the upcoming rules and the copy change made it hard to tell intended changes in execution from mistakes. Giving the two changes separate switches let developers test the new rules with the old copying path still in place.
According to recent reports, in the old execution path, the validator copies account data into a program’s virtual machine and takes it back when the program finishes. A call to another program adds another round trip. Meißner’s proposal describes up to four copies for an instruction with a single cross-program call. With direct mapping enabled, the virtual machine can access those account bytes where they already reside.
Anza’s tracker lists the memory checks and the mapping switch one epoch apart on both testnet and devnet. On mainnet, the date to watch for affected apps is the activation of the memory checks. Validators get the copy savings when the mapping switch goes live.
Also known as "Akiba," Liam Wright is a reporter, podcast producer, and Editor-in-Chief at CryptoSlate. He believes that decentralized technology has the potential to make….
