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

Conversation

@acud
Copy link
Contributor

@acud acud commented May 30, 2018

No description provided.

@acud acud requested review from fjl, gluk256 and zsfelfoldi as code owners May 30, 2018 12:33
@nonsense nonsense removed request for fjl, gluk256 and zsfelfoldi May 30, 2018 12:38
var prevTime time.Time
var cntPrev int

func TestSimulation(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@justelad we have to revert this on our end. Whisper team most probably has already fixed this.


err = node.server.Start()
if err != nil {
t.Fatalf("failed to start server %d.", i)
Copy link
Contributor

Choose a reason for hiding this comment

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

@justelad we have to revert this as well.

}

// GetNodes returns the existing nodes that are up
func (net *Network) GetUpNodes() (nodes []*Node) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I asked about this method a few weeks ago, and it is still not used. I think we should not be committing dead code.

@acud
Copy link
Contributor Author

acud commented May 30, 2018

i think that travis will fail bluntly on the cmd/swarm section. it depends on stuff which needs to be merged from the swarm package. will have to shelve that too with the main merge

)

func TestUPNP_DDWRT(t *testing.T) {
t.Skip("broken")
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 passing on master, not sure why we are skipping it.

}

// tcpPipe creates an in process full duplex pipe based on a localhost TCP socket
func tcpPipe() (net.Conn, net.Conn, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This must go away.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nonsense go away as in go away with all of the code which depends on it? there's dependant code in pss_test and snapshot_sync_test

Copy link
Contributor

Choose a reason for hiding this comment

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

We already have this in rlpx_test.go - we should export TCPPipe and reuse in this package.

configs := []string{
"--vendor",
"--tests",
"--deadline=10m",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nonsense do we want to introduce this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think there is no harm in it.

Msg: msg,
Ctx: newContext(l.ctx, ctx),
Call: stack.Caller(2),
Call: stack.Caller(skip),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nonsense why was this change introduced? i mean, not better to have this adjustable from one spot instead of 12 others?

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 needed, so that we have the Output method, which takes a different skip level.

Copy link
Contributor

Choose a reason for hiding this comment

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

See function Respond in swarm/api/http/error.go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, but maybe we could have a const for the default value of 2?

Copy link
Member

Choose a reason for hiding this comment

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

why do we need this change?

Copy link
Contributor

Choose a reason for hiding this comment

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

@zelig it is explained above why we need it - See function Respond and the Output method. This helps us track the caller line more stacks up, than just 2.

@acud
Copy link
Contributor Author

acud commented May 31, 2018

@nonsense this is ready for another review


/**
* Transforms given string to valid 20 bytes-length addres with 0x prefix
* Transforms given string to valid 20 bytes-length address with 0x prefix
Copy link
Member

Choose a reason for hiding this comment

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

this change should be sumbitted to web3 js not here this file is updated from there.
Skip this one

const (
timeFormat = "2006-01-02T15:04:05-0700"
termTimeFormat = "01-02|15:04:05"
termTimeFormat = "01-02|15:04:05.999999"
Copy link
Member

Choose a reason for hiding this comment

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

do we really need nanosecond resolution on log stamps?

Copy link
Contributor

Choose a reason for hiding this comment

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

With all the race conditions we had to track and fix, this was very useful.

Msg: msg,
Ctx: newContext(l.ctx, ctx),
Call: stack.Caller(2),
Call: stack.Caller(skip),
Copy link
Member

Choose a reason for hiding this comment

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

why do we need this change?

errc := make(chan error)

go func() {
log.Trace(fmt.Sprintf("trigger %v (%v)....", trig.Msg, trig.Code))
Copy link
Member

Choose a reason for hiding this comment

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

remove these trace

// shrinks on demand. If the buffer reaches the size below, the subscription is
// dropped.
maxClientSubscriptionBuffer = 8000
maxClientSubscriptionBuffer = 20000
Copy link
Member

Choose a reason for hiding this comment

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

please mention this is the PR synopsis as separate point

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@nonsense
Copy link
Contributor

nonsense commented Jun 4, 2018

@zelig why do we need this change? -> because of the Output method, which is used for logging errors - we care about the line of the Error, and not about the line that logs the Error.

// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package helpers
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 a bad name for the package. maybe just call it pipes?

@nonsense
Copy link
Contributor

nonsense commented Jun 4, 2018

@justelad thanks for taking care of this.

Just two remarks from my side:

  1. Rename helpers package to pipes.
  2. Remove the tracing that @zelig noted.

The rest I am happy with and hopefully will get approved on ethereum/go-ethereum side.

@acud
Copy link
Contributor Author

acud commented Jun 4, 2018

@zelig @nonsense your comments were addressed. can i reopen this on the main repo?
last delta: 9edebd8

karalabe and others added 9 commits June 4, 2018 14:52
…all non-swarm package changes relevant for the main go-ethereum repository for the upcoming swarm-network-rewrite merge into master

rpc/client: increased maxClientSubscriptionBuffer to 20000
Fix a spelling mistake in comment
This commit adds many comments and removes unused code.
It also removes the EmptyHash function, which had some uses
but was silly.
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.