-
Notifications
You must be signed in to change notification settings - Fork 224
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
Create client side filtering spec #311
base: master
Are you sure you want to change the base?
Conversation
6a1a9f0
to
38a11b9
Compare
Is the resulting filter expected to be perfectly defined (i.e., every node gives same filter) ? If so then ExtractDataElements needs to be precisely defined taking into account that scripts may contain: weird push opcodes, non-push opcodes, or unparseable scripts that end mid-push (example). |
Yeah the expectation is every node calculates the filter the same because the lite clients will download both if they get two different ones from different nodes and ban the one that gave them the filter calculated differently from their code. |
Looks like that relies on what (Also, need to check parseScript to see just what it errors on -- pushes going past end of script, or other things too like using banned opcodes ...?) |
Yeah I'm looking at it. When I wrote the code I wasn't considering Do you see any need to add Also, the script parsing only fails if the pushdata opcodes have an invalid number of bytes in some way. And a parsing error causes the loop to continue without adding anything rather than adding the data elements that parsed correctly. |
Indeed, I don't see any value there for flagging their inclusion. (BTW fun fact: OP_RESERVED is standard to use after OP_RETURN ... since it falls between OP_1 and OP_1NEGATE)
That sounds good. Those are nonstandard anyway btw, so they deserve punishment. :-D |
This is the spec for client side filtering as implemented in bchd. I'm submitting the PR here so that anyone looking to implement the spec in another client has a spec to base it on. Also, this spec isn't necessarily final and if there is feedback we are open to including it in bchd.
Specifically, it's unclear if the OP_RETURN additions are useful enough to justify keeping as part of this spec or not. Especially considering that they increase the filter size a little.