-
Notifications
You must be signed in to change notification settings - Fork 213
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
Remove /gov/read
and /gov/query
endpoints
#2442
Conversation
@@ -312,238 +192,6 @@ struct TestNewMember | |||
crypto::Pem cert; | |||
}; | |||
|
|||
DOCTEST_TEST_CASE("Add new members until there are 7 then reject") |
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 made use of query
and read
but I decided to scrap it as it is already covered by end-to-end tests.
for table_name, records in tx.get_public_domain().get_tables().items(): | ||
if table_name in public_tables: | ||
public_tables[table_name].update(records) | ||
# Remove deleted keys |
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.
Note that the latest state does not include keys deleted keys (value of None
in delta), although we do include empty tables.
for chunk in self: | ||
for tx in chunk: |
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.
Non-critical: This iteration is going to be very slow. Could we rely on the filenames here to scan to the relevant chunk, and parse it in isolation? And even within that, could we skip over other transactions rather than parsing them? Not needed for this PR or current tests, but will likely bite us if we start using this ledger
util in more places/on real service ledgers.
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.
Yep, I should have mentioned it in the comment. I wanted the fetching to still verify the integrity of the ledger and we currently have no way to do that without starting from the very beginning of the ledger. I'll create a separate ticket and add a comment in the docstring.
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.
@eddyashton See first item in #2453 for follow-up improvements.
Co-authored-by: Eddy Ashton <ashton.eddy@gmail.com>
Co-authored-by: Eddy Ashton <ashton.eddy@gmail.com>
remove_gov_read_1@23206 aka 20210412.8 vs main ewma over 20 builds from 22883 to 23191 Click to see table
|
Part of #2411
This PR removes the existing
/gov/read
and/gov/query
endpoints which used the Lua interpreter and were mostly used for testing.Instead,
ccf.ledger.Ledger
now has two new membersget_transaction(seqno)
to return theccf.ledger.Transaction
recorded in the ledger at a specificseqno
andget_latest_public_state()
to return the latest public state. The former is used to check that a specific table was updated by a proposal (hence tracking the proposal completionseqno
) while the latter is used to check the final public state (e.g. to check that JWT refresh works).