solana-labs / solana

Web-Scale Blockchain for fast, secure, scalable, decentralized apps and marketplaces.
https://solanalabs.com
Apache License 2.0
13.19k stars 4.3k forks source link

Difference between Pubsub and Geyser for Slot update on processed level #32958

Open fanatid opened 1 year ago

fanatid commented 1 year ago

Problem

As I understand Geyser is correct and Pubsub should be fixed?

pubsub: https://github.com/solana-labs/solana/blob/d90e1582869d8ef8d386a1c156eda987404c43be/rpc/src/rpc_subscriptions.rs#L730-L737 geyser: https://github.com/solana-labs/solana/blob/d90e1582869d8ef8d386a1c156eda987404c43be/rpc/src/optimistically_confirmed_bank_tracker.rs#L320-L334

Proposed Solution

Change Pubsub message trigger from CreatedBank to Frozen?

fanatid commented 8 months ago

I created the tool that allows to see the difference: https://github.com/rpcpool/yellowstone-whirligig-client/pull/4 example output:

251126282: pubsub +0ns, whirligig +31.974927ms, grpc +19.797746ms
251126283: pubsub +0ns, whirligig +15.008825ms, grpc +39.600677ms
251126284: pubsub +0ns, whirligig +433.768063ms, grpc +425.956658ms
251126285: pubsub +0ns, whirligig +317.083586ms, grpc +305.4413ms
251126286: pubsub +0ns, whirligig +504.957387ms, grpc +497.525325ms
251126287: pubsub +0ns, whirligig +65.747626ms, grpc +61.601354ms
251126288: pubsub +0ns, whirligig +265.528119ms, grpc +265.625734ms
251126289: pubsub +0ns, whirligig +313.040505ms, grpc +324.209449ms
251126290: pubsub +0ns, whirligig +31.276439ms, grpc +31.179749ms
251126291: pubsub +0ns, whirligig +63.168443ms, grpc +58.956834ms
251126292: pubsub +0ns, whirligig +293.489261ms, grpc +284.931629ms
251126293: pubsub +0ns, whirligig +193.688779ms, grpc +194.279531ms
251126294: pubsub +0ns, whirligig +544.215454ms, grpc +544.243569ms
251126295: pubsub +0ns, whirligig +54.454107ms, grpc +55.681706ms
251126296: pubsub +0ns, whirligig +322.057975ms, grpc +314.031081ms
251126297: pubsub +0ns, whirligig +116.324797ms, grpc +123.816471ms
251126298: pubsub +0ns, whirligig +105.542639ms, grpc +98.626028ms
251126299: pubsub +0ns, whirligig +103.090418ms, grpc +100.710078ms
251126300: pubsub +0ns, whirligig +123.780715ms, grpc +116.807639ms
251126301: pubsub +0ns, whirligig +128.658007ms, grpc +153.794561ms
251126302: pubsub +0ns, whirligig +49.44277ms, grpc +50.378555ms
251126303: pubsub +0ns, whirligig +360.656856ms, grpc +355.544306ms
251126304: pubsub +0ns, whirligig +467.695352ms, grpc +453.289899ms
251126305: pubsub +0ns, whirligig +34.883645ms, grpc +28.336245ms
251126306: pubsub +0ns, whirligig +389.828327ms, grpc +390.605315ms
251126307: pubsub +0ns, whirligig +323.772592ms, grpc +319.299433ms
251126308: pubsub +0ns, whirligig +570.882185ms, grpc +565.349832ms
251126309: pubsub +282.449659ms, whirligig +6.974607ms, grpc +0ns
251126310: pubsub +0ns, whirligig +148.47681ms, grpc +188.325993ms