solana-mobile / dapp-publishing

Apache License 2.0
54 stars 15 forks source link

Replace separate use of `getSlot` and `getBlock` with `getLatestBlockhashAndContext` #180

Closed sdlaver closed 1 year ago

sdlaver commented 1 year ago

This code has an issue: https://github.com/solana-mobile/dapp-publishing/blob/f76bc3b921a36b32657861b7f2e585a70e758fe0/packages/core/src/publish/attestation.ts#L21 If the slot is retrieved from server A, and then the block requested from server B, it's possible that this slot is not yet known (at the requested commitment level).

Should replace this with a single call to getLatestBlockhashAndContext.