-
Notifications
You must be signed in to change notification settings - Fork 988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First working implementation of Solana #3210
Conversation
chain/solana/src/chain.rs
Outdated
_logger: &Logger, | ||
_number: BlockNumber, | ||
) -> Result<BlockPtr, IngestorError> { | ||
// FIXME (Solana): Hmmm, what to do with this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In PR #3174, this can now be implemented using a new method on FirehoseEndpoint
, seehttps://github.com//pull/3174/files#diff-c88091fff98f12117879940db97c9ccdf74b60ed6afa5079b89e62cb4af089c0L160 (once we rebase this PR on top).
@@ -240,6 +240,21 @@ pub enum IndexForAscTypeId { | |||
NearChunkHeader = 84, | |||
NearBlock = 85, | |||
NearReceiptWithOutcome = 86, | |||
SolanaBlock = 87, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to be aligned with graph-ts
code base. I think we should start to have dedicated "range" per chain. Solana could be 200 - 399, Tendermint 400 - 699 (etc.) to ease future addition. Maybe there is restrictions of doing that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree we should use ranges
pub account_keys: AscPtr<AscHashArray>, | ||
pub data: AscPtr<AscHash>, | ||
pub balance_changes: AscPtr<AscBalanceChangeArray>, | ||
pub account_changes: AscPtr<AscAccountChangeArray>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not push that out at the moment. Let's figure if we can add the logs
in here.
Next steps around this PR and Solana integration in general:
Risk: Instructions Tree SerializationWe think having contextual information about other instructions in the tree of instructions rooted at the matched instruction is a requirement. Indeed, we expect that the transaction matched by manifest will actually perform other important child instructions that dapps developers will require access to. For example, performing an NFT mint on Solana generates a bunch of child instructions that is important to have access to, like the SPL token created. We think that serializing the whole tree to the WASM handler will give a good DX to dapp developer. However, it's a risk because the instruction tree could be quite big in term of AssemblyScript serialized bytes and the time it could take to do it. We should explore this question as soon as possible to understand the consequences of fully serializing the full instructions tree always. Other possibilities:
|
Thanks @maoueh (& @jubeless) for this update.
How complex is this proposal, and what would the Developer Experience look like (would this require changes to upload the IDL as part of the manifest?)
Is this initial subgraph definition quite well understood & is any further research required here?
Is the primary concern here feasibility (i.e. will it be too big in terms of AssemblyScript serialized bytes) or performance (regardless, the serialisation will be too slow)? Seems like there are still a few outstanding pieces on both the Firehose & Graph Node side here? |
It should have expanded further saying indeed this is a risk factor if we decide to have right now. So good question, we checked the JSON output format, seems rather "easy" to work it. Now the question is how easy "reading" the data is. For the actual account input, I think it will be quite easy actually to do something. After that, it's a matter to have low level decoding of each Anchor base types. We are not sure which encoding Anchor uses, it's own, Borsh or default Rust C encoding that was used before, would need to check that. I don't think it's utterly complex to have a working version, need the man power to dedicate at least a week to that specific task. I envision generate the struct types from the IDL and also the decoding code directly, would be all in AssemblyScript.
Would be good to sync on that to be sure we are on the same page, Julien told me you discussed with him maybe SPL Token Holders, if it's the case, we already thought about how to have the right "matching" to get the correct one. I will try to sit with Julien and together we will write the manifest and "pseudo-code" for this subgraph.
Both in fact, I think it's really something that needs to be checked first, how long does it take mainly and also how many bytes it consumes, will give indication of how many subgraph we would be able to run on N GB of RAM (worst case/average case something around that).
Yep there is work on both side, right now we are spinning up the whole Firehose infrastructure and ensuring it works with how big the blocks are (even with account data removed). For filtering, I don't think it will take much time, we have everything to easily create filter(s) and indexes, we should need to decide about the filters we need to support, so the review of the filters available in the manifest is a prior task to have them in Firehose. |
Hi, while looking for a way to use subgraph with Solana, I have pumped to this PR. How is the PR going on? I saw there is no update since Feb, and the last comment is at April. Will this PR still work or stale? I also saw from |
So this branch is stalled I'm not 100% sure how it will behave. This was before With |
@maoueh thank you. I just pump into this and wonder about the status of it. If |
Since the focus is currently on substreams support for Solana, I'm closing this for now. |
No description provided.