Skip to content
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

Forward write_version with on program account change notification #4683

Open
maa105 opened this issue Jan 29, 2025 · 0 comments
Open

Forward write_version with on program account change notification #4683

maa105 opened this issue Jan 29, 2025 · 0 comments

Comments

@maa105
Copy link

maa105 commented Jan 29, 2025

Problem

When listening to program account changes sometimes due to network conditions you might get an update x + 1 before you get update x. Now if both updates happens in different slot thats fine you can deduce the order from the slot number. But if the changes are in the same slot you cant tell which happened first. Im not an expert at this repo but I looked a bit and saw that the notifications that are sent on account change does have a variable called write_version specifically for that purpose (check bellow image) However unfortunately this variable is not sent with the notification on the rpc subscription.

~line 106 in geyser-plugin-interface/src/geyser_plugin_interface.rs:
Image

what I get from the RPC call:

{
    "jsonrpc": "2.0",
    "method": "programNotification",
    "params": {
        "result": {
            "context": {
                "slot": 317118392
            },
            "value": {
                "pubkey": "2DJh81MqEuhGBHMAFZSfkMM9DUuCTB58KVaMpkPaEM2x",
                "account": {
                    "lamports": 2039280,
                    "data": [
                        "...",
                        "base64"
                    ],
                    "owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
                    "executable": false,
                    "rentEpoch": 18446744073709551615,
                    "space": 165
                }
            }
        },
        "subscription": 2667
    }
}

NOTE: no write_version

Proposed Solution

Send write_version with the notification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
@maa105 and others