aptos-core
aptos-core copied to clipboard
[Feature Request] Write up a guide discussing read-what-you-wrote behavior
🚀 Feature Request
While developing my dapps, I noticed that I was not always reading what I wrote when interacting with fullnode.devnet.aptoslabs.com if I wrote and then read immediately afterwards. I suspect this is due to one of two reasons:
- The above domain resolves to 3 separate IPs (https://gist.github.com/banool/9f1f86f6f3233b402f79b7229809b143), so each request hit a different IP.
- Fullnodes don't offer read what you wrote in the first place because they're just proxying to VFNs which then proxy them to VNs.
Regardless of the reason, we should have something that describes the semantics here and provide some suggestions about how to deal with this them, such as ensuring that the FN you're talking to has reached the version that your transaction progressed the blockchain to. Or possibly suggest that devs design their apps to not rely on this behavior, that's another option.
Potentially we can also provide such helpers via the SDK if there is enough demand / a sensible way to implement them.
It's also possible I'm wrong about how this works. If so, a guide would be a great way to set me straight 😛
Yes, this is a quite common problem.
Alchemy solved this by (I'm guessing) always route request to the same node. But they have api keys to distinguish clients.
As for Aptos, the API responses all have version and timestamp in their headers, it can be used to make sure you are not reading an older state.
This is an implementation issue with whatever API provider you're using.
Routing requests isn't the easiest to do, you have some sort of session stickiness, but it's never bulletproof since load balancers will eventually stop keeping the stickiness
Nonetheless this is not well-understood, I think we should mention it somewhere as a heads up, e.g. in the system integrator's guide.
Adding a low priority given the staleness of this issue.
This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.
@banool and @gregnazario , I am attempting to address this in: https://github.com/aptos-labs/aptos-core/pull/6800