Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

light client: subscribe over websockets doesnt send new events #8560

Closed
jacobrosenthal opened this issue May 7, 2018 · 10 comments · Fixed by #9331
Closed

light client: subscribe over websockets doesnt send new events #8560

jacobrosenthal opened this issue May 7, 2018 · 10 comments · Fixed by #9331
Labels
F2-bug 🐞 The client fails to follow expected behavior. M4-core ⛓ Core client code / Rust. P5-sometimesoon 🌲 Issue is worth doing soon.
Milestone

Comments

@jacobrosenthal
Copy link

Not sure if its related to the light client or websocket. If I use a recent from block I get some events, if I use latest I get nothing, and either way I never get any new events (as I can open a second script attached to infura's websocket)

target/release/parity -d /Volumes/vms --light
2018-05-07 11:43:18  Starting Parity/v1.12.0-unstable-f0c6d17ad-20180504/x86_64-macos/rustc1.25.0
2018-05-07 11:43:18  Keys path /Volumes/vms/keys/Foundation
2018-05-07 11:43:18  DB path /Volumes/vms/chains/ethereum/db/906a34e69aec8c0d
2018-05-07 11:43:18  Path to dapps /Volumes/vms/dapps
2018-05-07 11:43:18  Running in experimental Light Client mode.
2018-05-07 11:43:20  Imported #5572784 0x5aa1…b1ba (7.98 Mgas) + another 1 header(s)
2018-05-07 11:43:23  Public node URL: enode://c6622236c33a3ae026da0622472c37d77ee6f8194908d73adb3d00505fb63d29521b49d5588d3f8e202a9acd5fbcc65646a1e1c30d9bdeee3af5740857065db4@192.168.0.35:30303
2018-05-07 11:43:31  Imported #5572785 0x2cb3…143c (0.40 Mgas)
2018-05-07 11:43:40  Imported #5572787 0xf283…03ec (7.99 Mgas)
2018-05-07 11:43:48    14/50 peers   4 KiB cache 0 bytes queue  RPC:  0 conn,  0 req/s,   0 µs
contract.events.allEvents(
{fromBlock: 5572785} //gets recent past events, but no new updates
//{} //nothing
//{fromBlock:'latest'} //nothing
, function(error, events){
console.log(error, events)
})
null { address: '0x06012c8cf97BEaD5deAe237070F9587f8E7A266d',
  blockHash: null,
  blockNumber: null,
  logIndex: null,
  transactionHash: null,
  transactionIndex: null,
  transactionLogIndex: null,
  type: 'pending',
  id: null,
  returnValues: 
   Result {
     '0': '0x5B49c5072750Ec45E63E1F300cc4A3a6C8CB7599',
     '1': '740439',
     '2': '740367',
     '3': '739104',
     '4': '511181029587041829902179471452593439812944709427753037147557425946068364',
     owner: '0x5B49c5072750Ec45E63E1F300cc4A3a6C8CB7599',
     kittyId: '740439',
     matronId: '740367',
     sireId: '739104',
     genes: '511181029587041829902179471452593439812944709427753037147557425946068364' },
  event: 'Birth',
  signature: '0x0a5311bd2a6608f08a180df2ee7c5946819a649b204b554bb8e39825b2c50ad5',
  raw: 
   { data: '0x0000000000000000000000005b49c5072750ec45e63e1f300cc4a3a6c8cb759900000000000000000000000000000000000000000000000000000000000b4c5700000000000000000000000000000000000000000000000000000000000b4c0f00000000000000000000000000000000000000000000000000000000000b472000004a10c218c74b8295c5ee180670c0c6210c40808734591394e52b8e90858c',
     topics: [ '0x0a5311bd2a6608f08a180df2ee7c5946819a649b204b554bb8e39825b2c50ad5' ] } }

Before filing a new issue, please provide the following information.

I'm running:

  • Which Parity version?: 0.0.0
    a7a46f4
    and "web3": "^1.0.0-beta.34"
  • Which operating system?: Windows / MacOS / Linux
    macosx
  • How installed?: via installer / homebrew / binaries / from source
    source
  • Are you fully synchronized?: no / yes
    yes, light client
  • Which network are you connected to?: ethereum / ropsten / kovan / ...
    mainnet
  • Did you try to restart the node?: no / yes
    yes
@Tbaut
Copy link
Contributor

Tbaut commented May 7, 2018

Could you reproduce with a full node (you can try quickly syncing on kovan)?

@Tbaut Tbaut added F2-bug 🐞 The client fails to follow expected behavior. P5-sometimesoon 🌲 Issue is worth doing soon. M4-core ⛓ Core client code / Rust. labels May 7, 2018
@Tbaut Tbaut added this to the 1.12 milestone May 7, 2018
@jacobrosenthal
Copy link
Author

jacobrosenthal commented May 7, 2018

Im traveling atm so Ill try to get kovan going but it might not happen, any recommendations on a chatty contract to watch?

@jacobrosenthal
Copy link
Author

OK got synced and found a random contract on etherscan. New events are coming through fine on kovan full node with any filter options, so maybe the light client code?

@Tbaut
Copy link
Contributor

Tbaut commented May 8, 2018

Thanks for narrowing down the scope. Can you edit your first post and title to reflect the fact that it's in the light client?

@jacobrosenthal jacobrosenthal changed the title Subscribe over websocket only works for fromBlock past events light client: subscribe over websockets doesnt send new events May 8, 2018
@jacobrosenthal
Copy link
Author

I think this is worthy of inclusion on the light client dashboard? cc @tomaka

@tomaka
Copy link
Contributor

tomaka commented May 10, 2018

My knowledge of events and the API around it is still limited, but I think this issue is here by design and not actually a bug.

cc @rphmeier

@rphmeier
Copy link
Contributor

rphmeier commented May 10, 2018

it should be sending new events. we should investigate if the LightChainNotify trait is ever firing and whether that leads to a filter update/push. @jacobrosenthal can you see if poll-based filters work? this will help us narrow down whether the filter logic itself is broken or just the subscription update.

@rphmeier
Copy link
Contributor

I'm not sure how well this will work unless synced in general though unless we pause syncing while we check every block for log updates.

@jacobrosenthal
Copy link
Author

@rphmeier Happy to test, though not sure what. Can you link or provide a snippet?

@jacobrosenthal
Copy link
Author

Also would like to learn how to gdb cargo builds but havent figured that out yet if anyone has a workflow for parity that would be ideal.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F2-bug 🐞 The client fails to follow expected behavior. M4-core ⛓ Core client code / Rust. P5-sometimesoon 🌲 Issue is worth doing soon.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants