-
Notifications
You must be signed in to change notification settings - Fork 366
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
INDY-2297, INDY-2302: Allow multiple active TAAs, change GET_TAA's reply format #1424
Conversation
TODO: - Choose versions mechanism in the write_request_manager - Add TAA validations for other requests Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
…nto task-2297-get-taa-digest
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
This pull request introduces 2 alerts when merging 142f296 into 956cc45 - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging 3c6877c into 956cc45 - view on LGTM.com new alerts:
|
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
This pull request introduces 3 alerts when merging 8e92c92 into 956cc45 - view on LGTM.com new alerts:
|
This pull request introduces 3 alerts when merging b088222 into 956cc45 - view on LGTM.com new alerts:
|
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 might be missing something, but - is there old TAA request handler, did I miss it somehow?
This pull request introduces 3 alerts when merging 91b7aae into fc5d8c0 - view on LGTM.com new alerts:
|
This pull request introduces 3 alerts when merging 1644abe into 8340342 - view on LGTM.com new alerts:
|
…nto task-2297-get-taa-digest
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
This pull request introduces 20 alerts when merging 01e8f50 into beb45f9 - view on LGTM.com new alerts:
|
This pull request introduces 22 alerts when merging 115cd81 into beb45f9 - view on LGTM.com new alerts:
|
test this please |
This pull request introduces 22 alerts when merging 9aa1ea5 into beb45f9 - view on LGTM.com new alerts:
|
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.
Code review part 1
|
||
class BaseTAAHandler(WriteRequestHandler, metaclass=ABCMeta): | ||
|
||
def _update_txn_author_agreement(self, digest, seq_no, txn_time, text=None, version=None, retired=None): |
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.
This function looks a bit overcomplicated due to usage in very different scenarios. Probably it makes sense to split it into:
- create_txn_author_agreement (which writes to all keys)
- update_txn_author_agreement (which updates just key containing data)
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
[INDY-2302] Fix getting the latest taa digest
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
This pull request introduces 22 alerts when merging 59f2722 into beb45f9 - view on LGTM.com new alerts:
|
plenum/test/req_handler/test_txn_author_agreement_disable_handler.py
Outdated
Show resolved
Hide resolved
state_value[TXN_AUTHOR_AGREEMENT_TIMESTAMP] = None if retired else taa_txn_time | ||
|
||
# Set a TAA | ||
txn_author_agreement_handler.update_state(taa_txn, None, taa_request) |
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 it is better to:
- move preparation stage (writing TAA to state) to helper function
- add case when we have more than one TAA in ledger when TAA_DISABLE is processed (and check that all of TAAs are disable)
- add case when we send another TAA to ledger after sending TAA_DISABLE and make sure that all previously disabled TAAs stay disabled
plenum/test/txn_author_agreement/acceptance/test_taa_acceptance_validation.py
Outdated
Show resolved
Hide resolved
plenum/test/txn_author_agreement/acceptance/test_taa_acceptance_validation.py
Show resolved
Hide resolved
plenum/test/txn_author_agreement/test_get_txn_author_agreement.py
Outdated
Show resolved
Hide resolved
match='Transaction author agreement is already disabled' | ||
): | ||
sdk_send_txn_author_agreement_disable(looper, sdk_pool_handle, sdk_wallet_trustee) | ||
assert get_txn_author_agreement() is None |
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.
Same comment as in similar unit-like tests - having more cases would be very nice
This pull request introduces 22 alerts when merging 7e5ef8d into beb45f9 - view on LGTM.com new alerts:
|
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
This pull request introduces 22 alerts when merging d4acabd into beb45f9 - view on LGTM.com new alerts:
|
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
This pull request introduces 22 alerts when merging ef899e3 into beb45f9 - view on LGTM.com new alerts:
|
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
This pull request introduces 23 alerts when merging d62d67b into beb45f9 - view on LGTM.com new alerts:
|
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
This pull request introduces 23 alerts when merging cf0527b into beb45f9 - view on LGTM.com new alerts:
|
Test this please |
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
This pull request introduces 19 alerts when merging 0d981e6 into beb45f9 - view on LGTM.com new alerts:
|
raise LogicError( | ||
"Txn Author Agreement digest is not defined: version {}, seq_no {}, txn_time {}" | ||
.format(taa[TXN_AUTHOR_AGREEMENT_VERSION], taa_seq_no, taa_txn_time) | ||
if not self.get_taa_data(): |
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 we need to get uncommitted TAA here, as committed is not guaranteed to be the same on all the nodes. So, if there is a request with accepted TAA sent right after this TAA is added to the ledger, there is a chance that it may be handled differently by nodes.
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
This pull request introduces 19 alerts when merging 2d83217 into beb45f9 - view on LGTM.com new alerts:
|
else: | ||
raise InvalidClientTaaAcceptanceError( | ||
request.identifier, request.reqId, | ||
"Incorrect Txn Author Agreement(digest={}) in the request".format(r_taa_a_digest) |
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 it's better to say:
Accepted Txn Author Agreement (digest={}) is not found on the ledger. Please make sure that an existing Agreement is accepted.".format(r_taa_a_digest)
"Txn Author Agreement acceptance digest is invalid or non-latest:" | ||
" provided {}, expected {}" | ||
.format(r_taa_a_digest, taa_digest) | ||
"Txn Author Agreement is retired: version {}, seq_no {}, txn_time {}" |
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 it's better to say:
Accepted Txn Author Agreement with version={} and digest={} is retired on {}. Please accept an active Agreement.
) | ||
|
||
retired = taa.get(TXN_AUTHOR_AGREEMENT_RETIRED) | ||
if retired and retired < req_pp_time: |
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.
Should it be <=
?
No description provided.