hyperledger / besu

An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu
https://www.hyperledger.org/projects/besu
Apache License 2.0
1.43k stars 759 forks source link

Error out on permissions config accounts-allowlist validation errors. [#7138] #7161

Closed krsh24 closed 1 month ago

krsh24 commented 1 month ago

PR description

When allow_accountlist in "permissions_config.toml" have duplicate or incorrect Ethereum addresses the functionality is to throw IllegalStateException during start-up. Currently, the validation errors are ignored and not logged to the log file as well. This change will ensure the config file is valid before starting up the node.

Fixed Issue(s)

https://github.com/hyperledger/besu/issues/7138

Thanks for sending a pull request! Have you done the following?

Locally, you can run these tests to catch failures early:

macfarla commented 1 month ago

appreciate you adding tests for the broken bit. they just don't quite compile

/home/runner/work/besu/besu/ethereum/permissioning/src/test/java/org/hyperledger/besu/ethereum/permissioning/AccountLocalConfigPermissioningControllerTest.java:122: error: cannot find symbol

Task :config:test assertThrows( ^ symbol: method assertThrows(Class,()->{ cont[...]m); }) location: class AccountLocalConfigPermissioningControllerTest /home/runner/work/besu/besu/ethereum/permissioning/src/test/java/org/hyperledger/besu/ethereum/permissioning/AccountLocalConfigPermissioningControllerTest.java:136: error: cannot find symbol assertThrows( ^ symbol: method assertThrows(Class,()->{ cont[...]m); }) location: class AccountLocalConfigPermissioningControllerTest

Task :ethereum:permissioning:compileTestJava Note: /home/runner/work/besu/besu/ethereum/permissioning/src/test/java/org/hyperledger/besu/ethereum/permissioning/NodeLocalConfigPermissioningControllerTest.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 2 errors

krsh24 commented 1 month ago

appreciate you adding tests for the broken bit. they just don't quite compile

/home/runner/work/besu/besu/ethereum/permissioning/src/test/java/org/hyperledger/besu/ethereum/permissioning/AccountLocalConfigPermissioningControllerTest.java:122: error: cannot find symbol

Task :config:test assertThrows( ^ symbol: method assertThrows(Class,()->{ cont[...]m); }) location: class AccountLocalConfigPermissioningControllerTest /home/runner/work/besu/besu/ethereum/permissioning/src/test/java/org/hyperledger/besu/ethereum/permissioning/AccountLocalConfigPermissioningControllerTest.java:136: error: cannot find symbol assertThrows( ^ symbol: method assertThrows(Class,()->{ cont[...]m); }) location: class AccountLocalConfigPermissioningControllerTest

Task :ethereum:permissioning:compileTestJava Note: /home/runner/work/besu/besu/ethereum/permissioning/src/test/java/org/hyperledger/besu/ethereum/permissioning/NodeLocalConfigPermissioningControllerTest.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 2 errors

Embarrassing! Just pushed a commit @macfarla

macfarla commented 1 month ago

appreciate you adding tests for the broken bit. they just don't quite compile /home/runner/work/besu/besu/ethereum/permissioning/src/test/java/org/hyperledger/besu/ethereum/permissioning/AccountLocalConfigPermissioningControllerTest.java:122: error: cannot find symbol

Task :config:test assertThrows( ^ symbol: method assertThrows(Class,()->{ cont[...]m); }) location: class AccountLocalConfigPermissioningControllerTest /home/runner/work/besu/besu/ethereum/permissioning/src/test/java/org/hyperledger/besu/ethereum/permissioning/AccountLocalConfigPermissioningControllerTest.java:136: error: cannot find symbol assertThrows( ^ symbol: method assertThrows(Class,()->{ cont[...]m); }) location: class AccountLocalConfigPermissioningControllerTest

Task :ethereum:permissioning:compileTestJava Note: /home/runner/work/besu/besu/ethereum/permissioning/src/test/java/org/hyperledger/besu/ethereum/permissioning/NodeLocalConfigPermissioningControllerTest.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 2 errors

Embarrassing! Just pushed a commit @macfarla

no probs! except now DCO is broken - you should be able to follow the instructions https://github.com/hyperledger/besu/pull/7161/checks?check_run_id=25717305093 to fix it. It's just a matter of adding a signoff to your most recent commit. :)