Skip to content

Conversation

@snadrus
Copy link
Contributor

@snadrus snadrus commented Oct 15, 2025

Make our Ingest & Address configuration dynamic such that the values apply instantly.

Market will ERROR on 0 <--> 1 that a restart is required to enable the correct services.

Discoveries
Computed Values: These become their own config.NewDynamic() which gets updated by a callback on the source(s).
I could be persuaded to turn these into event streams into reactive programming: https://github.com/samber/ro

I don't think we should be stopping & starting services on these changes. That will simply be unsupported.

Bad configuration is setup to throw error and reuse the original in all the secondary-interpretations, otherwise it'll stream out errors until fixed in the direct consumptions. These seem reasonable.

I couldn't get TOML to do value unmarshal as it knows documents only at the top level, so I built an ugly wrapper full of reflection that we should use instead of TOML unmarshal. It works, but it's ugly.

@snadrus snadrus requested a review from a team as a code owner October 15, 2025 02:35
@snadrus snadrus requested a review from magik6k October 15, 2025 02:36
@snadrus snadrus marked this pull request as draft October 15, 2025 02:36
@snadrus snadrus marked this pull request as ready for review October 17, 2025 21:57
@snadrus snadrus changed the title Apply dyn-cfg Apply dyn-cfg to p1 cases Oct 17, 2025
@snadrus snadrus requested a review from Reiers October 17, 2025 22:09
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is extremely cursed, love it

Copy link
Collaborator

Choose a reason for hiding this comment

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

This might be one of the rare cases where it would be good to try and get high unit test coverage

Copy link
Contributor Author

@snadrus snadrus Oct 22, 2025

Choose a reason for hiding this comment

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

how about 97.38% for dynamic_toml.go ? (also, thanks, I found a few bugs in it)

Verif storiface.Verifier
As *multictladdr.MultiAddressSelector
Maddrs map[dtypes.MinerAddress]bool
Maddrs *config.Dynamic[map[dtypes.MinerAddress]bool]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know we like our hammers, but this also really looks like atomic.Value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a subtle difference worth noting: All dynamics are under 1 mutex so that we never get one updated and the other with the original value, even for a short while.

Comment on lines 834 to 835
# Updates will affect running instances.
# Updates will affect running instances.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Weird that this is doubled up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

db: db,
api: api,
maxWaitTime: cfg.Ingest.MaxDealWaitTime,
maxWaitTime: cfg.Ingest.MaxDealWaitTime.Get(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should either propagate the dynamic deeper or not make it a dynamic in the config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


func (f *F3Task) Adder(taskFunc harmonytask.AddTaskFunc) {
for a := range f.actors {
for a := range f.actors.Get() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not really dynamic, this only runs once on startup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done. That was one of the first ones before I realized what I needed to do. I must not have swept back well enough.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We have f05 support in Wallet Manager, this is the legacy version of that - I'd just drop it

Copy link
Contributor Author

@snadrus snadrus Oct 22, 2025

Choose a reason for hiding this comment

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

DId you want me to remove all of balance manager? It's only 7 months old, are you sure its functions have been superceded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@LexLuthr #431 just added this. Can you weigh in?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, let's get rid of it

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agent report?

Copy link
Contributor Author

@snadrus snadrus Oct 22, 2025

Choose a reason for hiding this comment

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

yes, seemed mildly interesting at the time, but I have now removed it.

@snadrus snadrus requested a review from magik6k October 23, 2025 20:01
@snadrus snadrus enabled auto-merge (squash) October 23, 2025 23:40
@snadrus snadrus disabled auto-merge October 23, 2025 23:40
@snadrus snadrus requested a review from LexLuthr October 29, 2025 14:28
@LexLuthr
Copy link
Contributor

We should Test this with UI and see if new encode/decode works with our weird UI setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants