Skip to content

fix komodo_args, add ParseArgumentsTests, fix LegacyEvents test#601

Merged
ca333 merged 7 commits intoGLEECBTC:devfrom
DeckerSU:patch-parse-arg-test
Nov 8, 2023
Merged

fix komodo_args, add ParseArgumentsTests, fix LegacyEvents test#601
ca333 merged 7 commits intoGLEECBTC:devfrom
DeckerSU:patch-parse-arg-test

Conversation

@DeckerSU
Copy link
Copy Markdown

@DeckerSU DeckerSU commented Nov 7, 2023

It has been discovered that in certain environments, such as when building a daemon on MacOS using the native clang instead of the default gcc provided in the repository, the daemon binary had a bug with the p2p/rpc port and magic (only for ACs, KMD itself was not affected). This bug was caused by incorrect extrabuf filling. Further investigation revealed that this behavior was due to not properly clearing some internal variables and a dangling pointer issue. This pull request fixes this erroneous behavior and also resolves compatibility issues between legacy events tests and the test_block test. The LegacyEventsTests were not functioning correctly (showing errors) when run immediately after the test_block tests due to changes in the values of certain global variables and the initial block download state. This has now been fixed. Additionally, ParseArgumentsTests have been added to ensure that ACs will have the correct p2p/rpc port in magic.

move extrabuf from condition block scope to the main komodo_args
scope to avoid "dangling" pointer and garbage in buffer after exit
from condition block. add proper init of variables.
For example, the group of test_block tests changes the value
of IsInitialBlockDownload() to false after the first call
to generateBlock. As a result, when komodo_connectblock is called,
komodo_validate_chain should return 1 for the LegacyEvents tests.
Additionally, if we are operating with various data directories
between different tests, the static file pointer fp in komodo.cpp
should be cleared between these tests to avoid writing to the same
file in different tests.
@DeckerSU DeckerSU requested review from Alrighttt and ca333 November 7, 2023 14:29
@ca333 ca333 merged commit c86da4d into GLEECBTC:dev Nov 8, 2023
who-biz pushed a commit to who-biz/komodo that referenced this pull request Jun 22, 2025
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.

2 participants