@@ -18,9 +18,8 @@ const splTokenAmountOffset = 64
1818// ExecuteRead implements common.ChainReader for Solana chains.
1919//
2020// Solana cannot query state at an exact past slot, so reads run at finalized
21- // commitment with minContextSlot as a staleness floor. ObservedBlockHeight (the
22- // context slot) may differ across validators; core's ballot key covers the
23- // result value only, never the observed slot.
21+ // commitment with minContextSlot as a staleness floor. The observed slot is not
22+ // carried on the result or the ballot; the vote covers the result value only.
2423func (c * Client ) ExecuteRead (ctx context.Context , req * ucallbacktypes.ReadRequest ) (* ucallbacktypes.ReadResult , error ) {
2524 env , err := decodeSolanaQueryEnvelope (req .Query )
2625 if err != nil {
@@ -48,13 +47,12 @@ func (c *Client) ExecuteRead(ctx context.Context, req *ucallbacktypes.ReadReques
4847 return common .NewReadErrorResult (ucallbacktypes .ReadErrorCode_READ_ERROR_INVALID_RESULT ), nil
4948 }
5049 return & ucallbacktypes.ReadResult {
51- Status : ucallbacktypes .ReadStatus_READ_STATUS_SUCCESS ,
52- ResultData : resultData ,
53- ObservedBlockHeight : slot ,
50+ Status : ucallbacktypes .ReadStatus_READ_STATUS_SUCCESS ,
51+ ResultData : resultData ,
5452 }, nil
5553
5654 case solanaQuerySPLTokenAccount :
57- data , owner , found , slot , rpcErr := c .rpcClient .GetAccountInfoWithSlot (ctx , account , minSlot )
55+ data , owner , found , _ , rpcErr := c .rpcClient .GetAccountInfoWithSlot (ctx , account , minSlot )
5856 if rpcErr != nil {
5957 return nil , rpcErr
6058 }
@@ -73,23 +71,21 @@ func (c *Client) ExecuteRead(ctx context.Context, req *ucallbacktypes.ReadReques
7371 return common .NewReadErrorResult (ucallbacktypes .ReadErrorCode_READ_ERROR_INVALID_RESULT ), nil
7472 }
7573 return & ucallbacktypes.ReadResult {
76- Status : ucallbacktypes .ReadStatus_READ_STATUS_SUCCESS ,
77- ResultData : resultData ,
78- ObservedBlockHeight : slot ,
74+ Status : ucallbacktypes .ReadStatus_READ_STATUS_SUCCESS ,
75+ ResultData : resultData ,
7976 }, nil
8077
8178 case solanaQueryRawAccountData :
82- data , _ , found , slot , rpcErr := c .rpcClient .GetAccountInfoWithSlot (ctx , account , minSlot )
79+ data , _ , found , _ , rpcErr := c .rpcClient .GetAccountInfoWithSlot (ctx , account , minSlot )
8380 if rpcErr != nil {
8481 return nil , rpcErr
8582 }
8683 if ! found {
8784 return common .NewReadErrorResult (ucallbacktypes .ReadErrorCode_READ_ERROR_NOT_FOUND ), nil
8885 }
8986 return & ucallbacktypes.ReadResult {
90- Status : ucallbacktypes .ReadStatus_READ_STATUS_SUCCESS ,
91- ResultData : data ,
92- ObservedBlockHeight : slot ,
87+ Status : ucallbacktypes .ReadStatus_READ_STATUS_SUCCESS ,
88+ ResultData : data ,
9389 }, nil
9490
9591 default :
0 commit comments