Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

network/simulation: Add ExecAdapter capability to swarm simulations #1503

Merged
merged 4 commits into from
Jun 24, 2019

Conversation

nolash
Copy link
Contributor

@nolash nolash commented Jun 21, 2019

This change makes it possible to select ExecAdapter for the Swarm simulations wrapper package.

nonsense
nonsense previously approved these changes Jun 24, 2019
@nonsense
Copy link
Contributor

@nolash approved, provided tests are passing, I can see a few more references to New.

}

adapterServices := s.addServices(services)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is still confusing (but better than before), because s.addServices is not only returning adapterServices, but also modifying s.

Maybe it'd be better is line 111 was part of s.addServices so that you don't have to return the adapterServices and rely on s.addServices to add them to the simulation and register them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thing is we don't need to RegisterServices there for the inproc node.

@nolash
Copy link
Contributor Author

nolash commented Jun 24, 2019

nolash dismissed nonsense’s stale review via 688aec4 14 minutes ago

eh - I didn't mean to do that.

@nonsense nonsense merged commit a0a14cc into ethersphere:master Jun 24, 2019
@nonsense
Copy link
Contributor

@nolash yeah, this is configured by default now - if someone approves a PR and you add a commit, the reviews are dismissed. I also forgot about that.

@nonsense nonsense added this to the 0.4.2 milestone Jun 24, 2019
@nolash nolash deleted the execnode-activate branch June 24, 2019 08:20
adapterServices := s.toAdapterServices(services)

// exec adapters register services up front, not at node creation time
adapters.RegisterServices(adapterServices)
Copy link
Contributor

@skylenet skylenet Jun 26, 2019

Choose a reason for hiding this comment

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

@nolash We have a problem with this RegisterServices() function. It should be called within an init() function as described in the documentation: https://github.com/ethereum/go-ethereum/tree/master/p2p/simulations#services

So basically, to make the current exec/docker adapter work. we would have to register all services upfront.
In our case it gets a bit harder, because we attached this to (s *Simulation)... so unless we define all our simulations inside an init(), this won't work.

I've been thinking now about this for a while and I don't find a decent solution.... any idea?

fyi @nonsense

Copy link
Contributor

Choose a reason for hiding this comment

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

I had completely forgotten about this requirement, I remember reading about it a year or so ago...

I also don't have any solutions :(

Copy link
Contributor Author

@nolash nolash Jun 27, 2019

Choose a reason for hiding this comment

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

In our case it gets a bit harder

Why exactly do we need to put it in an init (except for the doc claiming that we do)?

vojtechsimetka added a commit that referenced this pull request Jul 9, 2019
* master:
  network/newstream: new stream! protocol base implementation (#1500)
  swarm: fix bzz_info.port when using dynamic port allocation (#1537)
  cmd/swarm: make bzzaccount flag optional and add bzzkeyhex flag (#1531)
  cmd/swarm: remove separate function to parse env vars (#1536)
  network/bitvector: Multibit set/unset + string rep (#1530)
  swarm: 0.4.3 unstable (#1526)
  travis: also build on release tags (#1527)
  swarm: release v0.4.2 (#1496)
  network: bump bzz stream hive (#1522)
  docker: update ca-certificates file (#1525)
  Add swarm guide to /docs (#1513)
  network/simulation: Add ExecAdapter capability to swarm simulations (#1503)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants