Stubs for UDP socket options SO_BROADCAST, SO_REUSEADDR, SO_REUSEPORT#3434
Stubs for UDP socket options SO_BROADCAST, SO_REUSEADDR, SO_REUSEPORT#3434Nashatyrev wants to merge 1 commit intoshadow:mainfrom
Conversation
|
Thanks for the detailed notes on these issues! Yeah, we still don't have a good way of dealing with stubs. We experimented in #3332, #3369, and #3375 with adding experimental options to support stubs, but we weren't happy with any of those approaches. If you have alternative ideas, feel free to mention on #3280. But I think for now our plan is to not merge any additional stubs unless they're "correct". I think if you make a separate PR with just the "return 0 for |
I've managed to run Ethereum Java client Teku inside Shadow (specifically with Ethshadow).
However I had to add the following stubs to make it working finally:
SO_BROADCAST: Netty library (widely adopted jvm network lib) asks for this socket option prior to binding a UDP port. No workarounds on a client code side were found for this.SO_REUSEADDR&SO_REUSEPORT: the option is set in the Teku app itself to check if the specified port is not busy and fail fast if busy. Not sure if it's that necessary here, but it makes sense because this port is then promptly closed and reopened again (when actual port binding occurs). This may potentially fail due to socket close delay in OS (probably it may be the case just in some specific OS)To be honest I'm not quite sure if it's the right thing to merge these stubs as is (relates to #3280), so kindly asking for devs assistance.