State synchronization strategy between Solana L1 and HyperGrid

Design Philosophy:
We adhere to a non-intrusive development philosophy, positioning HyperGrid as an underlying infrastructure focused on enhancing efficiency without heavily involving itself in developers’ specific business tasks.

Read-Only Access Requests:
When HyperGrid receives a read-only access request, it first checks if the relevant account exists in the local server cache. If it is not present, HyperGrid triggers a pull of this account from the Solana L1 into the local server cache, and then responds to the request.

Handling of Cached Accounts:
It is important to note that accounts pulled into the local server cache from the Solana L1 are maintained only in the cache and cannot be written into HyperGrid’s local blocks. These accounts are cleared when the HyperGrid server restarts. To prevent any modifications to these accounts in HyperGrid that could lead to inconsistencies with the Solana L1, all accounts fetched into the local server cache from the Solana L1 are marked as read-only and cannot be modified within HyperGrid’s local cache.

Modification Access Requests:
If HyperGrid receives a request to modify data, it first checks if the corresponding account in non-read-only state exists in the local server cache. If not, HyperGrid sends a Lock operation to the account on the Solana L1 to change it to read-only status, then modifies the account data, and finally releases the read-only status. After the modification, HyperGrid pulls the updated account back into its local cache.

Synchronize NFTs from the Base Layer to Hypergrid

We will attempt to mint a token using an NFT program already deployed on the Solana Devnet, then switch networks to Hypergrid. This will enable the functionality to sync the NFT program from the Solana Devnet to Hypergrid and verify the sync status.

1

Step 1:

Visit https://mint.hypergrid.dev. Click on the “Select Wallet” link and choose “Backpack Wallet”. Switch the RPC to: https://api.devnet.solana.com.

2

Step 2:

Click on “Faucet” to go to https://faucet.solana.com. Enter your Backpack Wallet address to receive Solana Devnet tokens.

3

Step 3:

Follow the video tutorial to experience synchronizing NFTs from the base layer to Hypergrid.

Hypergrid RPC : https://rpc.hypergrid.dev
Devnet RPC : https://api.devnet.solana.com
Test Program ID : HdBvhzMrhmdPyrbwL9ZR2ZFqhqVSKcDra7ggdWqCcwps

Modifying NFTs on the base layer through Hypergrid

We will attempt to mint a token using an NFT program that has been deployed on the Solana Devnet, then switch to the Hypergrid network to modify the token directly on Hypergrid, and verify the modification results.

1

Step 1:

Visit https://mint.hypergrid.dev. Click on the “Select Wallet” link and choose “Backpack Wallet”. Switch the RPC to: https://api.devnet.solana.com.

2

Step 2:

Click on “Faucet” to go to https://faucet.solana.com. Enter your Backpack Wallet address to receive Solana Devnet tokens.

3

Step 3:

Follow the video tutorial to experience synchronizing NFTs from the base layer to Hypergrid.

Hypergrid RPC : https://rpc.hypergrid.dev
Devnet RPC : https://api.devnet.solana.com
Test Program ID : 4WTUyXNcf6QCEj76b3aRDLPewkPGkXFZkkyf3A3vua1z