Skip to content
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

Migrate to new types fromcoreutils #1233

Draft
wants to merge 264 commits into
base: dev
Choose a base branch
from
Draft

Migrate to new types fromcoreutils #1233

wants to merge 264 commits into from

Conversation

peterjan
Copy link
Member

@peterjan peterjan commented May 15, 2024

This PR migrates renterd to use the new types in coreutils, e.g. the wallet, syncer and chain manager.

Keeping it as a DRAFT for the time being, now that we're play testing it on our nodes I figured it's a good time to look at the diff and keep it up-to-date with dev more frequently.

peterjan and others added 30 commits January 31, 2024 15:07
Make use of new chain.Announcement and chain.ForEachHostAnnouncement helpers in coreutils
add SQL impl. for syncer.PeerStore
Make SQLStore implement SingleAddressStore
@peterjan peterjan changed the title Migrate to coreutils Migrate to new types fromcoreutils May 15, 2024
@peterjan peterjan self-assigned this May 23, 2024
This PR upgrades `coreutils` dependencies and adds a type for the
`eventData`. This PR really only unblocks `its-happening` and allows me
to merge in `dev`. After which I'll immediately change this to raw SQL
and get rid of the awful `eventData` type (following this PR:
#1272).
peterjan and others added 16 commits June 4, 2024 14:46
This PR is an intermediate step into cleanly getting `dev` merged into
`its-happening`. This is currently a little awkward because we
introduced `events` in `dev` which relies on consensus changes...
Merging it into `its-happening` requires a little reshuffle because of
that.

I moved the subscriber to the `internal` package, and to avoid confusion
I moved all (old) `internal/node` code into `host.go` because a) that
will soon disappear anyway and b) we only need it to create test hosts.
The idea is to give the subscriber the same events broadcaster as we do
the bus, so the subscriber can notify us when consensus updates and the
bus can notify us about everything else.

I also moved the syncer in an attempt to clean up the bus constructor,
not quite there yet though but figured I'd push this to avoid bloating
the PR too much.

---------

Co-authored-by: Chris Schinnerl <chris@sia.tech>
This PR merges in `dev` so `its-happening` is finally up-to-date and all
PRs against it unblocked. There's really not that much to focus on
except for the consensus update notification being broadcasted by the
subscriber. I only do that if we're "synced". I'm considering to clean
that up a bit though, now it's very much make-it-work.

I do think the `subscriber` is the one that should be broadcasting that
event. I think it's rather annoying though that the definition of
"synced" is now a bit scattered.

---------

Co-authored-by: Chris Schinnerl <chris@sia.tech>
This PR checks for the presence of a `consensus.db` file and if found
will start the migration to the new `chain.db`. We merely log a warning
the process could take hours, I think that's fine though if we properly
communicate it when we release it.
This migrates chain code to raw SQL, this should help facilitate
upgrading `coreutils` since some of the type changes are annoying to do
with `gorm`.

`NOTE`: this PR skips `TestBlocklist`, I'll fix that in a F/U since this
PR blocks some other PRs

---------

Co-authored-by: Chris Schinnerl <chris@sia.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

None yet

2 participants