-
Notifications
You must be signed in to change notification settings - Fork 900
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
[Follow up] Add Transaction Permissioning Hook to PermissioningService Interface #8365
Conversation
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
…hen it already exists Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
…er#7835 # Conflicts: # acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/plugins/PermissioningPluginTest.java
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: Vaidik <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: Vaidik <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: Sally MacFarlane <[email protected]>
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.
thanks for your contribution! Strong preference for not modifying the smart contract permissioning code at this stage since it's about to be removed.
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.
we've deprecated smart contract based permissioning per the sunset plan https://www.lfdecentralizedtrust.org/blog/sunsetting-tessera-and-simplifying-hyperledger-besu
so this class is going to be removed
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.
and right now we're effectively in a code freeze for the sunset features. So would prefer not to modify this code if possible, and if not possible, would prefer to remove smart contract permissioning first.
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.
That was indeed another thing that I wanted to mention in the first comment. I can revert that change. Should I also add @Depracted
tag? or is it not common practice here?
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.
Meanwhile, I checked the latest version from main reverting the changes. Let me know if I need to do other cleanups of the previous changes.
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.
looking pretty good, couple of minor suggestions
...java/org/hyperledger/besu/ethereum/permissioning/account/AccountPermissioningController.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Sally MacFarlane <[email protected]> Signed-off-by: Cristiano Aguzzi <[email protected]>
Signed-off-by: reluc <[email protected]>
Signed-off-by: reluc <[email protected]>
I fixed the build error of the previous CI run, it should be ready now. |
for (TransactionPermissioningProvider provider : this.pluginProviders) { | ||
if (!provider.isPermitted(transaction)) { | ||
LOG.trace( | ||
"Account permissioning - {}: Rejected transaction {} from {}", |
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.
thinking we should standardise the class naming and logging to "Transaction permissioning" rather than "Account permissioning" - but this can be a separate PR
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.
You could even call it "Transaction Rejector" or something that conveys that the default case is to permit the transaction.
Should I resolve the conflicts with main? I don't want to trigger CI again for a trivial hash check in the build system. |
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 think this is good, the only part of the design I would tighten up would be to require transaction permissioning to be defined under a broader permissioning config.
Not sure if that is by design or not, but one could view it as a leaky abstraction.
@@ -1177,10 +1177,17 @@ private Optional<AccountPermissioningController> buildAccountPermissioningContro | |||
final BesuController besuController, | |||
final TransactionSimulator transactionSimulator) { | |||
|
|||
if (permissioningConfiguration.isPresent()) { | |||
if (permissioningConfiguration.isPresent() | |||
|| permissioningService.getTransactionPermissioningProviders().size() > 0) { |
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.
Allowing transaction permissioning without a broader permissioningConfiguration seems weird, we will need to clarify in the docs that you can set up permissioning on just the transactions in this manner.
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 followed the same behavior of Node permissioning above. Should I change both of them? How should the end result looks like? User create an empty account permissioning file to enable a plugin that filters transactions? Shall I create an additional option --permissions-accounts-plugin-enable
(and also --permissions-node-plugin-enable
) ?
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 think this could be refactored separately (different PR) since the same pattern is used for node permissioning
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.
for (TransactionPermissioningProvider provider : this.pluginProviders) { | ||
if (!provider.isPermitted(transaction)) { | ||
LOG.trace( | ||
"Account permissioning - {}: Rejected transaction {} from {}", |
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.
You could even call it "Transaction Rejector" or something that conveys that the default case is to permit the transaction.
I've updated the logging messages, however, if you ask me, it is weird that a class called AccountPermissioningController logs messages with |
Thats ok, the details on which class are emitting the log should be preserved via the SLF4J pattern. So the message should focus on what it is doing, i.e. rejecting transactions. |
updated check api checksum accordingly. Signed-off-by: reluc <[email protected]>
Signed-off-by: reluc <[email protected]>
Signed-off-by: Sally MacFarlane <[email protected]>
…e Interface (hyperledger#8365) * fixing the issue of implementing the permission service class in pr when it already exists Signed-off-by: vaidikcode <[email protected]> * wiring transaction filtering for Permissioning Plugins * revert modify deprated code for TransactionSmartContractPermissioning * Improve logging for AccountPermissioningController Co-authored-by: Sally MacFarlane <[email protected]> Signed-off-by: Cristiano Aguzzi <[email protected]> * Improve logging messages for AccountPermissioningController * Allign AccountPermissioningControllerFactoryTest with the latest api Signed-off-by: reluc <[email protected]> --------- Signed-off-by: Vaidik <[email protected]> Signed-off-by: Sally MacFarlane <[email protected]> Signed-off-by: reluc <[email protected]> Signed-off-by: Cristiano Aguzzi <[email protected]> Co-authored-by: vaidikcode <[email protected]> Co-authored-by: Sally MacFarlane <[email protected]> Co-authored-by: Justin Florentine <[email protected]> Signed-off-by: Marcos Serradilla Diez <[email protected]>
PR description
This PR builds upon the work started in #7952, finalizing the implementation while maintaining consistency with the existing changes.
Key Updates:
Basically, after merging this work, people can filter transactions using the PermissioningService in their plugins. I would say adding some examples to the documentation might be useful.
Note: I didn't like the previous acceptance test, I found it a little bit convoluted for simply assigning the filtering mechanism of the plugins. As I said, I tried to be as conservative as I could. If you want, we can discuss possible improvements there.
Fixed Issue(s)
#7835
Thanks for sending a pull request! Have you done the following?
doc-change-required
label to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew spotlessApply
./gradlew build
./gradlew acceptanceTest
./gradlew integrationTest
./gradlew ethereum:referenceTests:referenceTests