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

[bug] Protocol issues #60

Open
farmage opened this issue Aug 23, 2021 · 1 comment
Open

[bug] Protocol issues #60

farmage opened this issue Aug 23, 2021 · 1 comment
Labels
◼ Type: Bug This issue relates to an encountered bug.

Comments

@farmage
Copy link
Contributor

farmage commented Aug 23, 2021

🐛 BUG REPORT

debug log shows some issues with messages sent by some nodes
if node can't get previeous_hash and block_height it still sends messages with empty block_height and previous_block_hash
example:

Function Calls:       
#1 validate_data: Invalid message
                                                                                               
MESSAGE: {     
 "message_settings": "SEND_CURRENT_BLOCK_HEIGHT",
 "block_height": "",
"public_address": "XCA1imCxpjCYT5VdcNdkA6FQMR3BFkPUdRSXc3Hj4QXGHrnuyTMauxGEnq8pCP82cXMWFRyZHU8UKCZjGMYBAfYq2fFdgzVYcg",
 "previous_block_hash": "",   

Another issue - some messages have no public_address field. That's leading to a validation error.

validate_data: Error
Sun 22 Aug 2021 19:45:39 UTC
-----------------------------------------------------------------------------------------------
Function Calls:
#1 validate_data: Invalid message

MESSAGE: {
 "message_settings": "BLOCK_VERIFIERS_TO_BLOCK_VERIFIERS_ONLINE_STATUS",
}

The same issue with 'non-standard' messages

Function Calls:
#1 verify_data: Could not find the public key to verify the message

MESSAGE: NODE_TO_BLOCK_VERIFIERS_GET_RESERVE_BYTES_DATABASE_HASH|850951|XCA1pBdRSiveCMWgkbExKXW1D8UcjeDuHh72oKvmApYaPmKhWDnS18M9M4pyM2aXiFKHVdeBCgq6dWVjJwRegRTa543gaesH2M|RSx1Ips4ViIYF0zrWpDiOuPwhUcm40cLJyBfNR9zZHnuvKJiZaoCs1YzLYLFPMfmaEpNlma8RnqcVXiJXx9fmVCYJdrmNuyNYLp7|f41ec9ce7110f8cd311aff4b5d20bde4275cb58e5f0f4f8284112bd40c4c350a88210a88317c6c8a4922037245f431
@farmage farmage added the ◼ Type: Bug This issue relates to an encountered bug. label Aug 23, 2021
@zachhildreth
Copy link
Member

Hi @farmage

For the first one it does check the block hash, but does need a check for the block height, but as long as the error happens "honestly" it should still invalidate the message
https://github.com/X-CASH-official/xcash-dpops/blob/master/src/functions/network_functions/network_security_functions/network_security_functions.c#L686

For the second one that is by design, as it sends out a dummy message after a successful creation of the socket to check if we could send any data to the delegate. If not then their offline
https://github.com/X-CASH-official/xcash-dpops/blob/master/src/functions/block_verifiers_functions/block_verifiers_update_functions/block_verifiers_update_functions.c#L1255

For the third one, that is correct. If a xcashd sends that type of message with a public address and key, then it gets validated by the delegates that they are part of db of delegates when the DDOS check happens. If a node just sends the block height then it just checks the IP for DDOS

so the above would error if that delegate is not in the db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
◼ Type: Bug This issue relates to an encountered bug.
Projects
None yet
Development

No branches or pull requests

2 participants