lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

Support LightClientFinalityUpdate and LightClientOptimisticUpdate rpcs

Open GeemoCandama opened this issue 2 years ago • 9 comments

Issue Addressed

#3651 partially addresses

Proposed Changes

Support LightClientFinalityUpdate https://github.com/ethereum/consensus-specs/blob/dev/specs/altair/light-client/p2p-interface.md#getlightclientfinalityupdate

Support LightClientOptimisticUpdate https://github.com/ethereum/consensus-specs/blob/dev/specs/altair/light-client/p2p-interface.md#getlightclientoptimisticupdate

Additional Info

I didn't name it GetLightClientFinalityUpdate to follow the LightClientBootstrap PR that has been merged already #3711. I'll make another PR to support LightClientUpdatesByRange as it's a bit more involved.

GeemoCandama avatar Jan 04 '23 19:01 GeemoCandama

I discussed this with @pawanjay176 and we might want to split the protocol modeling for asymmetric protocols before including these, FYI. Pawan is looking into this. If he doesn't have the bandwidth I might get to this at some point

divagant-martian avatar Feb 14 '23 21:02 divagant-martian

Should be good now. I was trying to keep the branch up to date with the changes and I didn't realize that the changes broke it. Also I added a full match to the context_bytes function so it will give more compile time feedback, since I didn't realize that I needed to make those changes until after a bit of hunting.

GeemoCandama avatar Apr 02 '23 19:04 GeemoCandama

there are some conflicts. Would you mind looking into those and then I'll trigger ci for you

divagant-martian avatar Apr 03 '23 20:04 divagant-martian

conflicts are fixed now. EDIT: Clippy was the only that failed and I think I appeased clippy now, but when I ran clippy locally last time I didnt get any errors either so I am not certain.

GeemoCandama avatar Apr 05 '23 16:04 GeemoCandama

Hi @GeemoCandama , I had a look at this over the weekend. It's looking good. I'm gonna spend some time this week to see if the MockRpcHandler can be simplified. Sorry for the delay.

pawanjay176 avatar Apr 17 '23 22:04 pawanjay176

Thanks @GeemoCandama for your work on this! I'm going to pick this one up and try to push it over the finishing line!

jimmygchen avatar Nov 03 '23 05:11 jimmygchen

The network wiring of this PR is correct, but half of the diff is a mock to test the light-client network server. ..

Yep agree with the above, also mentioned your suggestion to @michaelsproul last week - we think it's a good idea. The current mock-light-client pretty much need a re-write because of the rust-libp2p upgrade - I've made an unsuccessful attempt a few weeks ago, and that got me into asking myself the same question on whether we should come up with an alternative - I then started building a light client consumer prototype for this, but haven't got it to a usable state.

jimmygchen avatar Nov 15 '23 22:11 jimmygchen

Blocked by #4926

jimmygchen avatar Nov 22 '23 04:11 jimmygchen

I've made some updates to this branch and I think it's in a good state for review. I'd probably wait until we get #4946 merged in first, though.

We should also add some tests for this (#4940), I'll get to it when I have some time.

jimmygchen avatar Feb 02 '24 03:02 jimmygchen

I've merged in latest unstable. I haven't been able to test this in a real network as we still haven't implemented the LightClientUpdates req/resp interface. I think we can merge this as it is after review, as it doesn't touch the default code path (requires light-client-server flag).

jimmygchen avatar Apr 08 '24 04:04 jimmygchen

@mergify queue

jimmygchen avatar Apr 09 '24 07:04 jimmygchen

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 32be063f0f8cc9b1dfc46da1e583ec99f232253f

mergify[bot] avatar Apr 09 '24 07:04 mergify[bot]