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

Implement File Storing Mechanism for toDot Method Output in VerkleTrie #11

Conversation

neotheprogramist
Copy link
Collaborator


private static void handleFileWritingError(String errorMessage, Exception exception) {
LOG.error("Error writing DOT file: {}. Details: {}", errorMessage, exception.getMessage(), exception);
exception.printStackTrace();
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe better to throw the exception instead of doing a printstacktrace, like that the caller can now if the write failed or not

child.getLocation().orElse(Bytes.EMPTY));

if (showRepeatingEdges || !result.contains(edgeString)) {
result += edgeString;
Copy link
Collaborator

Choose a reason for hiding this comment

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

in general in java it's better to use StringBuilder instead of using +=, because it will create new string everytime and it's not efficient

build.gradle Outdated
@@ -52,12 +52,15 @@ dependencies {
implementation 'io.tmio:tuweni-rlp'
implementation 'org.hyperledger.besu:ipa-multipoint'
implementation 'org.hyperledger.besu.internal:trie:23.1.3-SNAPSHOT'
implementation 'org.slf4j:slf4j-api:1.7.32'
Copy link
Collaborator

Choose a reason for hiding this comment

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

version shoud be in the version.gradle file and the version are too old

https://mvnrepository.com/artifact/org.slf4j/slf4j-api/2.0.9

is logback really needed or just slf4J ?

Copy link

Choose a reason for hiding this comment

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

  1. I agree with your suggestion to manage the version in the 'version.gradle' file. I will ensure to update them accordingly.
  2. Additionally, regarding the inclusion of SLF4J and Logback in the build.gradle file, SLF4J is an abstraction that requires an underlying logging framework to function. This is why I included 'ch.qos.logback:logback-classic' in the dependencies. Without this implementation, Log.info/error, etc., won't work. For example, after removing the implementation dependency from build.gradle and adding Log to the DotExporterTest class, the test will pass, but there will be the info message: 'SLF4J: Defaulting to no-operation (NOP) logger implementation.' Therefore, I would recommend keeping Logback in the dependencies for proper logging functionality.

@neotheprogramist neotheprogramist force-pushed the 3-implement-file-storing-mechanism-for-todot-method-output-in-verkletrie branch 2 times, most recently from 59bec26 to 67477c6 Compare November 20, 2023 08:39
…e possibility of displaying repeating edges, if 'true' show all adges, if 'false' don't display repeating edges

Signed-off-by: Neo <[email protected]>
…e possibility of displaying repeating edges, if 'true' show all adges, if 'false' don't display repeating edges

Signed-off-by: Neo <[email protected]>
…ng StringBuilder usage with String.format()

Signed-off-by: Neo <[email protected]>
…ify tests accordingly to read from files.

Signed-off-by: Neo <[email protected]>
@neotheprogramist neotheprogramist force-pushed the 3-implement-file-storing-mechanism-for-todot-method-output-in-verkletrie branch from c2f01fe to deee991 Compare November 21, 2023 09:46
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.

Ensure Clean State of Nodes After Commit in Besu-Verkle-Trie
3 participants