39 Commits

Author SHA1 Message Date
Anton Kaliaev
c1f264822a p2p: remove NewNetAddressStringWithOptionalID (#3711)
Fixes #3521

The function NewNetAddressStringWithOptionalID is from a time when peer
IDs were optional. They're not anymore. So this should be renamed to
NewNetAddressString and should ensure the ID is provided.

* update changelog
* use NewNetAddress in transport tests
* use NewNetAddress in TestTransportMultiplexAcceptMultiple
2019-06-05 17:39:28 +02:00
Thane Thomson
70592cc4d8 libs/common: remove deprecated PanicXXX functions (#3595)
* Remove deprecated PanicXXX functions from codebase

As per discussion over
[here](https://github.com/tendermint/tendermint/pull/3456#discussion_r278423492),
we need to remove these `PanicXXX` functions and eliminate our
dependence on them. In this PR, each and every `PanicXXX` function call
is replaced with a simple `panic` call.

* add a changelog entry
2019-04-26 14:23:43 +04:00
Jae Kwon
9a6dd96cba Revert to using defers in addrbook. (#3025)
* Revert to using defers in addrbook.  ValidateBasic->Validate since it requires DNS

* Update CHANGELOG_PENDING
2018-12-16 12:27:16 -05:00
Jae Kwon
5b19fcf204 p2p: AddressBook requires addresses to have IDs; Do not close conn immediately after sending pex addrs in seed mode (#2797)
* Require addressbook to only store addresses with valid ID

* Do not shut down peer immediately after sending pex addrs in SeedMode

* p2p: fix #2773

* seed mode: use go-routine to sleep before stopping peer
2018-11-11 06:50:25 -05:00
Anton Kaliaev
e1538bf67e state: require block.Time of the fist block to be genesis time (#2594)
* require block.Time of the fist block to be genesis time

Refs #2587:

```
We only start validating block.Time when Height > 1, because there is no
commit to compute the median timestamp from for the first block. This
means a faulty proposer could make the first block with whatever time
they want.

Instead, we should require the timestamp of block 1 to match the genesis
time.

I discovered this while refactoring the ValidateBlock tests to be
table-driven while working on tests for #2560.
```

* do not accept blocks with negative height

* update changelog and spec

* nanos precision for test genesis time

* Fix failing test (#2607)
2018-10-12 01:03:58 -04:00
Pierrick Hymbert
1d8348d707 [p2p] Malformed external address causes SIGSEGV (if URL has empty host) (#2564)
fix #2071

Signed-off-by: phymbert <pierrick.hymbert@gmail.com>
2018-10-06 09:53:52 -04:00
Dev Ojha
2756be5a59 libs: Remove usage of custom Fmt, in favor of fmt.Sprintf (#2199)
* libs: Remove usage of custom Fmt, in favor of fmt.Sprintf

Closes #2193

* Fix bug that was masked by custom Fmt!
2018-08-10 09:25:57 +04:00
Ethan Buchman
d55243f0e6 fix import paths 2018-07-01 22:36:49 -04:00
Ethan Buchman
0450e35d67 some comments 2018-04-28 15:19:33 -04:00
Ethan Buchman
3ee1d7909e p2p: explicit netaddress errors 2018-04-28 14:48:51 -04:00
Ethan Buchman
936d1a0e68 some notes about the p2p layer 2018-04-28 11:35:09 -04:00
Ethan Buchman
c170800fbd Merge branch 'develop' into jae/aminoify 2018-04-07 16:16:53 +03:00
Anton Kaliaev
904a3115a6
require addresses to have an ID by default
Refs #1228
2018-04-05 11:55:29 +02:00
Thomas Corbière
2644a529f0 Fix lint errors (#1390)
* use increment and decrement operators.

* remove unnecessary else branches.

* fix package comment with leading space.

* fix receiver names.

* fix error strings.

* remove omittable code.

* remove redundant return statement.

* Revert changes (code is generated.)

* use cfg as receiver name for all config-related types.

* use lsi as the receiver name for the LastSignedInfo type.
2018-04-02 10:21:17 +02:00
Jae Kwon
901b456151 P2P now works with Amino 2018-03-26 06:40:02 +02:00
Ethan Buchman
68237911ba NetAddress.Same checks ID or DialString 2018-01-14 01:15:37 -05:00
Ethan Buchman
53a5498fc5 more fixes from review 2018-01-13 17:34:12 -05:00
Ethan Buchman
e4d52401cf some fixes from review 2018-01-13 16:06:51 -05:00
Ethan Buchman
6e823c6e87 p2p: support addr format ID@IP:PORT 2018-01-01 23:08:20 -05:00
Ethan Buchman
7d35500e6b p2p: add ID to NetAddress and use for AddrBook 2018-01-01 22:39:08 -05:00
Anton Kaliaev
c513649df4
strip protocol if defined
Fixes #934
2017-12-15 13:36:08 -06:00
Anton Kaliaev
c609b18698
tolerate unresolvable seeds (Refs #880) 2017-12-07 13:17:09 -06:00
zramsay
cf31f8d06f core: apply megacheck vet tool (unused, gosimple, staticcheck) 2017-05-29 23:11:40 -04:00
Ethan Buchman
23a6a6f8fc move into p2p package 2017-04-21 18:07:52 -04:00
Jae Kwon
c4ed55d801 Refactor to move common libraries out of project 2015-10-22 17:39:06 -07:00
Ethan Buchman
bb662b8861 more config options 2015-09-25 11:58:11 -04:00
Ethan Buchman
8e50bf15de panic wrapper functions 2015-07-21 10:46:05 -04:00
Jae Kwon
fcc26d7355 Resolve host for NetAddressFromString(). Test fix. 2015-04-23 18:41:14 -07:00
Jae Kwon
fa7c83166f P2P docs 2014-12-23 19:31:24 -08:00
Jae Kwon
83d313cbe5 Refactor Tx, Validator, and Account structure 2014-12-16 05:45:40 -08:00
Jae Kwon
e53b148acf refactor from Binary centric model to global method model 2014-09-03 20:41:57 -07:00
Jae Kwon
a8ece216f0 fix test cases 2014-08-31 01:48:40 -07:00
Jae Kwon
d300a67bb1 saving development state... 2014-08-30 04:17:10 -07:00
Jae Kwon
666122861c implementing block_manager. currently only supports one datatype. 2014-07-29 23:53:35 -07:00
Jae Kwon
34fe442514 Connection -> MConnection, huge refactor. True multiplexing. 2014-07-28 01:41:25 -07:00
Jae Kwon
6750d05b05 Message is wrapped by TypedMessage. 2014-07-18 21:21:42 -07:00
Jae Kwon
442cae1f3f addrbook cleanup 2014-07-10 02:19:50 -07:00
Jae Kwon
1b59caf950 created "Node" 2014-07-09 18:33:44 -07:00
Jae Kwon
61224f86c9 package rename peer -> p2p 2014-07-07 20:03:50 -07:00