How Different Transactions Flow Through an Ephemeral Rollup
Once deployed with delegation and undelgeation hooks, any instruction which is part of your program can be executed with ultra-low latency without changes.
The transaction will be processed by Base Layer (Solana) or Ephemeral Rollup (ER) validators depending on the account’s delegation status.
Before executing ultra-low latency transactions on ER, the state account must be delegated through the delegation hook of your program. This is what happens when delegating state account(s) from Base Layer to ER:
Base Layer: Account owner is locked and set to MagicBlock’s Delegation Program.
ER: No account is created during delegation on ER yet, but afterwards upon any transaction to ER.
Transaction fails if account is already delegated.
You can also sync the state from ER to Base Layer without changing delegation by committing the account state through a commit hook. This is what happens when committing states from ER to Base Layer:
ER: Commit for account(s) is scheduled.
Base Layer: CPI callback is called to get, finalize and update account from ER to Base Layer with Delegation Program as owner.
Transaction fails if account is already undelegated.