You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many threads need to share state between instructions. Programs are forced to save this state into an account and add the account as an input to all downstream instructions which need to read/write to it. Adding an extra account to programs can be tricky, deriving its PDA is error-prone, and mutating its data is restricted only to the program that owns it. Can we do better?
We know the thread account will be a signer on every executed instruction. Knowing this, thread accounts could provide a convenient location to save information that needs to be shared to downstream instructions. Any instruction would be able to write to a thread's cache simply by returning a KV map of data in the ThreadResponse. Downstream instructions would be able to access this data from the cache and update it.
Open questions:
Should programs be forced to sign the data they write to the cache? This would help programs verify data authorship.
Do programs need to care about data authorship? Or do threads provide a "trusted" computing environment?
Should a thread's cache be deleted between each kickoff? It doesn't need to be.
The text was updated successfully, but these errors were encountered:
nickgarfield
changed the title
Add a key-value cache to threads, allowing programs to pass data to downstream instructions
Add a key-value cache to threads
Dec 3, 2022
nickgarfield
changed the title
Add a key-value cache to threads
Key-value caching
Dec 3, 2022
Many threads need to share state between instructions. Programs are forced to save this state into an account and add the account as an input to all downstream instructions which need to read/write to it. Adding an extra account to programs can be tricky, deriving its PDA is error-prone, and mutating its data is restricted only to the program that owns it. Can we do better?
We know the thread account will be a signer on every executed instruction. Knowing this, thread accounts could provide a convenient location to save information that needs to be shared to downstream instructions. Any instruction would be able to write to a thread's
cache
simply by returning a KV map of data in theThreadResponse
. Downstream instructions would be able to access this data from the cache and update it.Open questions:
The text was updated successfully, but these errors were encountered: