solana-labs / networkexplorer

Retired
13 stars 19 forks source link

RFC : feature design for fullnodeAPI <=> networkexplorerAPI <=> networkexplorerWeb #373

Open sunnygleason opened 4 years ago

sunnygleason commented 4 years ago

Problem:

Solution (proposed):

Additional thoughts:

mvines commented 4 years ago

fullnode already advertises a semver version so that's a start: https://github.com/solana-labs/solana/blob/master/book/src/jsonrpc-api.md#getversion

But I feel like we can just generally be more fluid and adaptive. If an API call to another component fails, you always do what you can to recover and provide your caller with your best effort results. Even if all versions line up, any given API call may fail temporarily and we don't want to just blow up. Handling temporary network failures and other glitches cleanly seems to naturally allow us to use that same approach for version mismatches. That is supporting multiple versions of components officially is too soon, so any mismatch could be generically considered a temporary failure and/or standard input validation logic.

sunnygleason commented 4 years ago

@mvines right on, I'm on board with taming the cross-version compatibility matrix over time as opportunity allows. Here's a rough sketch of my understanding of what we're up against:

VERSIONS/RELEASES:
fullnode: [A1, A2, A3]
network-explorer-API: [B1, B2, B3]
network-explorer-webapp: [C1, C2, C3]
INTEROP:
1. "edge" -> "edge" : [A3, B3, C3] : easy, version 3 everywhere
2. "edge" -> "beta" : [A2, B2, C3] : C3 needs component fallbacks to legacy API B2
3. "edge" -> "stable" : [A1, B1, C3] : C3 needs component fallbacks to legacy API B1
4. "stable" -> "edge" : [A3, B3, C1] : B3 needs to provide legacy API B1 for desired components

Even if we add the constraint that "older" stages can't connect to "newer" stages, that only removes case 4 above. I don't see how we could have the constraint that "newer" stages can't connect to "older" stages (removing cases 2+3), that seems to be the whole point of the stage pipeline.

IMO we can handle all 4 cases in a manageable way, we just need to encapsulate the data requirements for each view and document the semantics of releases a bit better. We should be able to tackle that in an incremental way so it's not too burdensome.

(It also obviously won't impact fullnode dev velocity).

mvines commented 4 years ago

"edge" -> "edge" : [A3, B3, C3] : easy, version 3 everywhere

Not always! Fullnode on the edge testnet doesn't always restart on every single new commit into master.

The fallbacks really just need to be best effort. If it fails recover up as best you can and keep going. Normal input validation and clean error handling ought to get us close enough?