Skip to content

Blue oyster mushrooms: Evolving node validity, optimization, domain separation, and migration.#1881

Merged
KPrasch merged 32 commits intomainfrom
blue-oyster-mushrooms
Sep 25, 2020
Merged

Blue oyster mushrooms: Evolving node validity, optimization, domain separation, and migration.#1881
KPrasch merged 32 commits intomainfrom
blue-oyster-mushrooms

Conversation

@jMyles
Copy link
Contributor

@jMyles jMyles commented Apr 13, 2020

Contains the following PRs:

Closes issues:

Issues to address:

@jMyles jMyles force-pushed the blue-oyster-mushrooms branch from dfb1e5d to e8338e9 Compare April 21, 2020 19:45
@mswilkison mswilkison linked an issue Apr 22, 2020 that may be closed by this pull request
@mswilkison mswilkison added the Epic 📖 Upstream branches with a project focus label May 11, 2020
@KPrasch KPrasch changed the base branch from master to main July 21, 2020 00:44
@KPrasch
Copy link
Member

KPrasch commented Aug 20, 2020

I'd like to suggest that we use the "scope hammer" for Issues regarding migration and include them in another PR.

@cygnusv cygnusv force-pushed the blue-oyster-mushrooms branch 2 times, most recently from 21179e3 to 7f39e90 Compare September 14, 2020 11:35
@cygnusv cygnusv force-pushed the blue-oyster-mushrooms branch 2 times, most recently from 7fba47c to 0fa885a Compare September 20, 2020 15:22
@KPrasch KPrasch force-pushed the blue-oyster-mushrooms branch from 0fa885a to cf8913f Compare September 21, 2020 22:36
@cygnusv cygnusv force-pushed the blue-oyster-mushrooms branch from cf8913f to 395135f Compare September 22, 2020 07:56
@cygnusv cygnusv changed the title [WIP] Blue oyster mushrooms: Evolving node validity, optimization, domain separation, and migration. Blue oyster mushrooms: Evolving node validity, optimization, domain separation, and migration. Sep 23, 2020
@cygnusv cygnusv force-pushed the blue-oyster-mushrooms branch from d2a6ec6 to 100175c Compare September 23, 2020 18:23
uris.extend(hardcoded_uris)

return uris
# TODO: This module seems unused
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@KPrasch KPrasch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turned into a very nice cleanup. 🤠

In it goes.

__DEFAULT_MIDDLEWARE_CLASS = RestMiddleware

LEARNER_VERSION = LEARNING_LOOP_VERSION
LOWEST_COMPATIBLE_VERSION = 2 # Disallow versions lower than this
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like a semantic version tuple would be more intuitively understandable here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YES! I though something like that but also had second thoughts regarding how to encode this efficiently.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This raises two questions from me:

  • What does a minor vs major bump mean?
  • How and when does the version get updated?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both good questions. The current design in main implicitly assumes all versions are going to be back-wards compatible, in the sense that if you detect a node from a past version, no special handling of the metadata is performed. There are cases, like our particular bump from version 1 to version 2, where this is not desirable (as this is a "major" change in semver parlance), but I certainly can imagine other cases where we bump the version and at the same time try to maintain compatibility with the old version (a "minor" change). The approach taken in this PR is very simplistic, and I think there's room for improvement, but at least ensures that no metadata from version 1 will linger on the network.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Interesting - I suggest we open an Issue to track and leave it for a future PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can we keep a whole other Ursula class accessible? What's the mechanism here?

Copy link
Contributor

@vepkenez vepkenez Sep 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kind of like what's happening in this test:
https://github.com/nucypher/bytestringSplitter/blob/master/tests/test_kwargifiers.py#L127

The "EnergyDrink" class, in this case being the "future Ursula with new methods and attributes"

Copy link
Contributor

@fjarri fjarri Sep 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I meant is that you'll have to have the V1 Ursula class defined somewhere. Which is huge, and has links to other parts of the codebase. Feels like it would be easier to convert whatever you deserialized to the current Ursula.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well yeah... it depends on where the future takes us. If the V1 can be the super class of the V2, then it's not so bad, we just change/add some methods.

If it's a total brand new distinct class, then it's less fun.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized, something similar to this situation is already happening in the case of TreasureMaps vs SignedTreasureMaps.

Two distinct classes with different bytestring de/serializations, one a subclass of the other.

here

@cygnusv cygnusv force-pushed the blue-oyster-mushrooms branch from 2254ee3 to 47e01d6 Compare September 24, 2020 18:29
# The number of nodes having the map is approximately the number you'd expect from full utilization of Alice's publication threadpool.
# TODO: This line fails sometimes because the loop goes too fast.
assert len(nodes_that_have_the_map_when_we_unblock) == pytest.approx(policy.publishing_mutex._block_until_this_many_are_complete, .2)
# assert len(nodes_that_have_the_map_when_we_unblock) == pytest.approx(policy.publishing_mutex._block_until_this_many_are_complete, .2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to do any follow-up here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's in issue #2016

@cygnusv cygnusv mentioned this pull request Sep 25, 2020
Co-authored-by: Derek Pierre <derek.pierre@gmail.com>
Copy link
Member

@derekpierre derekpierre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎸

@KPrasch KPrasch merged commit 9b45c08 into main Sep 25, 2020
@KPrasch KPrasch deleted the blue-oyster-mushrooms branch January 22, 2021 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Epic 📖 Upstream branches with a project focus

Projects

None yet

7 participants