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

chore(network): extract network implementation from SwingSet #8151

Merged
merged 4 commits into from
Aug 8, 2023

Conversation

michaelfig
Copy link
Member

@michaelfig michaelfig commented Aug 6, 2023

refs: #5973

Description

Move the packages/SwingSet/src/vats/network implementation to packages/network/src. There was no good reason to put it in SwingSet initially.

This is a step toward durability for the network and IBC vats (vat-network.js, vat-ibc.js) without introducing cycles from SwingSet to the Zones.

Security Considerations

n/a

Scaling Considerations

n/a

Documentation Considerations

Moves the location of the network documentation from SwingSet/docs/networking.md to network/README.md, but leaves a forwarding link.

Testing Considerations

n/a

Upgrade Considerations

n/a

@michaelfig michaelfig self-assigned this Aug 6, 2023
@michaelfig michaelfig changed the title chore(vats): adopt network implementation from SwingSet chore(network): extract network implementation from SwingSet Aug 7, 2023
@michaelfig michaelfig force-pushed the mfig-vats-network branch 2 times, most recently from d29ac6a to 681c359 Compare August 7, 2023 01:52
@michaelfig michaelfig requested review from turadg and FUDCo August 7, 2023 03:26
Copy link
Member

@turadg turadg left a comment

Choose a reason for hiding this comment

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

Approved contingent on

  • maintaining history of the files in src/vats/network
  • fixing the 'uuuu' comment

packages/SwingSet/docs/networking.md Show resolved Hide resolved
packages/pegasus/src/pegasus.js Show resolved Hide resolved
@@ -314,7 +313,7 @@ const makePegasus = (zcf, board, namesByAddress) => {

return Far('pegasus', {
/**
* Return a handler that can be used with the Network API.
* Return a handler that can be used with the uuuuuuuu API.
Copy link
Member

Choose a reason for hiding this comment

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

intermediate refactor?

Copy link
Member Author

Choose a reason for hiding this comment

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

Heheh... leaned on the keyboard at the wrong time. :)

scripts/graph.sh Outdated
else
echo "Cycles detected. These lines appear only in the original graph and not the acyclic variant:"
echo 1>&2 "Cycles detected. These lines appear only in the original graph and not the acyclic variant:"
Copy link
Member

Choose a reason for hiding this comment

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

kinda weird to have stderr say "these:" referring to stdout because a user could end up seeing one stream and not the other. Consider reverting.

Copy link
Member

Choose a reason for hiding this comment

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

I see the commit message rationale now, that stdout should have parseable output. That's persuasive to me.. If this script was going to live longer I'd say to update the message to not assume both streams will be seen at once, but I don't really think it's worth bothering

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a cheap fix, and I have to make some other little doc changes, so I'll update the message.

Copy link
Member

Choose a reason for hiding this comment

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

please try to get Git to see that multiaddr.js and types.js moved.

Copy link
Member Author

Choose a reason for hiding this comment

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

If you browse the PR commit-by-commit, you see that Git believes they moved in the first commit, but as soon as you collapse all the commits via a diff, Git's "50% similarity means it moved" heuristic breaks because these are small files with a bunch of lint fixes.

"ava": "^5.3.0",
"c8": "^7.13.0"
},
"exports": {
Copy link
Member

Choose a reason for hiding this comment

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

super.

i forget, does our tooling still allow deep imports anyway?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've found Typescript does, but Endo and Node.js definitely don't.

Copy link
Contributor

@FUDCo FUDCo left a comment

Choose a reason for hiding this comment

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

It's very nice.
Turadg already caught the two things I noticed (uuuuuu and file movement).

# Network API
<!--
content should remain synchronized with
https://github.com/Agoric/documentation/blob/HEAD/main/repl/networking.md
Copy link
Member

Choose a reason for hiding this comment

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

404 Not Found, did you intend a different URL?

Suggested change
https://github.com/Agoric/documentation/blob/HEAD/main/repl/networking.md
https://github.com/Agoric/documentation/blob/main/main/reference/repl/networking.md

Copy link
Member Author

Choose a reason for hiding this comment

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

It was already broken when I got here, but thanks for noticing; updated!

@michaelfig michaelfig added enhancement New feature or request hygiene Tidying up around the house labels Aug 8, 2023
@michaelfig michaelfig added this pull request to the merge queue Aug 8, 2023
Merged via the queue into master with commit 2f092c3 Aug 8, 2023
63 checks passed
@michaelfig michaelfig deleted the mfig-vats-network branch August 8, 2023 04:45
mhofman pushed a commit that referenced this pull request Aug 15, 2023
chore(network): extract network implementation from SwingSet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-eval enhancement New feature or request hygiene Tidying up around the house pegasus SwingSet package: SwingSet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants