-
Notifications
You must be signed in to change notification settings - Fork 1
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
src/main/java/org/hyperledger/besu/ethereum/trie/verkle/exporter/DotExporter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/hyperledger/besu/ethereum/trie/verkle/exporter/DotExporter.java
Outdated
Show resolved
Hide resolved
|
||
private static void handleFileWritingError(String errorMessage, Exception exception) { | ||
LOG.error("Error writing DOT file: {}. Details: {}", errorMessage, exception.getMessage(), exception); | ||
exception.printStackTrace(); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I agree with your suggestion to manage the version in the 'version.gradle' file. I will ensure to update them accordingly.
- 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.
59bec26
to
67477c6
Compare
…sentation in Dot format. Signed-off-by: Neo <neotheprogramist@proton.me>
Signed-off-by: Neo <neotheprogramist@proton.me>
…e possibility of displaying repeating edges, if 'true' show all adges, if 'false' don't display repeating edges Signed-off-by: Neo <neotheprogramist@proton.me>
…overload in SimpleVerkleTrie Signed-off-by: Neo <neotheprogramist@proton.me>
…sentation in Dot format. Signed-off-by: Neo <neotheprogramist@proton.me>
…e possibility of displaying repeating edges, if 'true' show all adges, if 'false' don't display repeating edges Signed-off-by: Neo <neotheprogramist@proton.me>
…ng StringBuilder usage with String.format() Signed-off-by: Neo <neotheprogramist@proton.me>
…est'. Signed-off-by: Neo <neotheprogramist@proton.me>
Signed-off-by: Neo <neotheprogramist@proton.me>
Signed-off-by: Neo <neotheprogramist@proton.me>
Signed-off-by: Neo <neotheprogramist@proton.me>
…ify tests accordingly to read from files. Signed-off-by: Neo <neotheprogramist@proton.me>
Signed-off-by: Neo <neotheprogramist@proton.me>
Signed-off-by: Neo <neotheprogramist@proton.me>
Signed-off-by: Neo <neotheprogramist@proton.me>
…e, modify DotExporterTest Signed-off-by: Neo <neotheprogramist@proton.me>
Signed-off-by: Neo <neotheprogramist@proton.me>
…y in Node classes Signed-off-by: Neo <neotheprogramist@proton.me>
…ck dependency versions to versions.gradle, small import fixes Signed-off-by: Neo <neotheprogramist@proton.me>
Signed-off-by: Neo <neotheprogramist@proton.me>
Signed-off-by: Neo <neotheprogramist@proton.me>
Signed-off-by: Neo <neotheprogramist@proton.me>
Signed-off-by: Neo <neotheprogramist@proton.me>
Signed-off-by: Neo <neotheprogramist@proton.me>
Signed-off-by: Neo <neotheprogramist@proton.me>
c2f01fe
to
deee991
Compare
fixes visoftsolutions#3