Skip to content
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

Refactor filter #4460

Merged
merged 15 commits into from
Sep 1, 2020
Merged

Refactor filter #4460

merged 15 commits into from
Sep 1, 2020

Conversation

chimp1984
Copy link
Contributor

@chimp1984 chimp1984 commented Sep 1, 2020

No description provided.

… signatureAsBase64 nullable as it is set null at creation time and set later after signing. We use filter protobuf data as input for signature so we have to set signature to null and apply the signature afterwards. To keep object immutable we clone it with static clone method. Similar we handle signature verification. We clone the filter with a null value for the signature and do the validation with that cloned object.

Use now the complete object data for signature creation. We use the protobuf data for creating the signature with DER encoding. We restict ourself more regarding backward compatibility but I think it is not a big problem.
If a new field is added to Filter and deployed the maintainer needs to publishes a new filter object. By using the new version he cannot remove the old filter from the network as the protobuf data is different and sig verification on the P2P datastorage level will fail. This is intended to keep the old filter alive for some time to support not updated users. We do not remove invalid filters anymore from our local storage to enable seed nodes to support also old filter objects.
For not updated users the new filter will fail at sig verification because the protobuf data is different. So they ignore the new filter and still use the old filter. For updated users the old filter will fail and the new filter is accepted. As it has a newer date it would also replace the old filter anyway. If the maintainer wants to delete the old filter from the network he can use the old app version and remove the filter. It is recommended to keep a copy of the data directory before the update so that the removal of the older filter is possible.

Refacorings:
- Rename isPeersPaymentAccountDataAreBanned to arePeersPaymentAccountDataBanned
- Rename isSignerPubKeyBanned to isWitnessSignerPubKeyBanned
Separate validation from setting key
- Add more validation
- Add SignerPubKeyAsHex to filter
- Refactor add/remove filter code
We use several signing keys, so better to make it more explicit.
protobuf entry is not changed to not risk issues (i guess it would
work renaming it)
It is used atm only for filter itself which might have limited effect.
Applying it to alert and priv notification requires adding pubKey fields
there which is outside of the scope of that PR but should be added soon
as well.
add his key anyway to src code)
- Fix wrong logs
- Remove duplicated line
Copy link
Member

@sqrrm sqrrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@sqrrm sqrrm merged commit 7830dbf into bisq-network:master Sep 1, 2020
@chimp1984 chimp1984 deleted the refactor-filter branch September 2, 2020 00:16
@ripcurlx ripcurlx added this to the v1.3.8 milestone Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants