This repository has been archived by the owner on Aug 2, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
swarm, swap: add addresses to logs #1806
swarm, swap: add addresses to logs #1806
Changes from 30 commits
ed9f561
7295408
f91233a
02ef574
c10beae
86bb6e7
1632fdb
9d6eb39
f1c3fc4
b6086a1
c151daa
ecfec4c
518ccf1
083cb4e
0746650
0399110
6a6c293
e35dc65
1100486
7be01a1
272db7f
f771aa2
e424853
0d892a3
a0238b7
423ff3d
f4e5156
8c42e64
7989efc
346edeb
2d25f1f
1f58276
edc9db0
481f5e0
d91d4a6
43d8d45
32af153
48dc81b
c49d7cb
6ebda39
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can we not keep the
swapLogger
package wide and only do thepeerLogger
per instance?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 can, but i'm not sure i see reason to.
could you please explain why this would be preferable? in general i try to avoid global variables and the like.
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.
Because the logger is shared, and is not in any way a property of
Swap
. Then we also don't need to pass it around methods.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.
it's a logger specifically for swap, but yes, maybe it doesn't belong in the struct itself (although if the logpath does, one could argue for this).
it certainly doesn't need to be there.
i've changed it back to a global variable.
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.
To be honest
Params
is poorly designed and was meant as an organizing thing for economic parametrization (thresholds, cashing strategy, amounts, etc.).We have been refactoring the
Swap
constructor all the time recently, that is why instead of making a huuuuuge constructor with maaaany parameters (resulting in many changes), we started adding mixed parameters to this genericParams
struct.I would like to see a refactoring of this, but it does not need to be in this PR. Conceptually
OverlayAddr
does not belong to this struct, butLogPath
neither does.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 agree.
i never really understood this
Params
business—indeed, i only placedOverlayAddr
here since it seemed to fit in well next tologpath
as an "infrastructure" sort of variable for theSwap
struct 🤷♂️we can have them moved to the
Swap
struct directly if you prefer, i don't mind.or: we can revisit this issue later down the road, when refactoring as you say
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.
created issue #1877 for this
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 is not from this PR, but we need to rename this function, it creates a conflict with the builtin
new
keyword ofgo
if it would be used inside this package.Call it
newInstance
or something else you prefer. You can also create a different PR for this if you prefer.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.
pushed this change and added it to the PR description. thanks