* HIP18: support allowlist
* sort allowlist by default order
* fix and add unit test
* simplified calculation of index of leader
* restore code of NthNextHmy()
* rename MaxLimit to MaxLimitPerShard and add comments
* init allowlist of testnet
* update allowlist
* change HIP18 epoch to TBD
* set HIP18 of testnet to 75840
* rename _BLS() to BLS()
* update comment
* add version of allowlist variable
* recover the travis_rpc_checker script
* update HIP18 epoch
...and ensure transfers from the precompile address can be made before
executing them. Since we are now blocking multiple `CXReceipts` per
transaction explicitly, it doesn't make sense to be wary of contracts
subsidizing cross shard transfers for end users via `delegatecall`. It
is then safe to remove the gas charge for the precompile. Secondly,
ensure that there are enough funds on the precompile via `CanTransfer`
as part of the sanity check.
* add new config to set local accounts from harmony config
* removed extra if for checking flag change and fix format
Co-authored-by: “GheisMohammadi” <“Gheis.Mohammadi@gmail.com”>
* fix unexpected chain id (https://github.com/harmony-one/harmony/issues/4129)
* update epoch numbers for ChainId fix
* updated ChainID Epoch for test net
* align comment with other comments
* fix the build using goimports
* added flags to enable/disable rpc for staking and eth
* add feature to be able to feed custom configuration for each single node in testnet
* add method filter
* add rpc method filters file and one new flag for legacy APIs
* fixed tests and improved method filter and added more tests
* fix format and removed extra comments
* fix method_filter comments
* remove extra debug print
Co-authored-by: “GheisMohammadi” <“Gheis.Mohammadi@gmail.com”>
This reverts commit aa30288dce. The commit
will be remade when #4146 is merged with the same epoch as that of HIP18
to make a combined hard fork for both features.
* fix unexpected chain id (https://github.com/harmony-one/harmony/issues/4129)
* update epoch numbers for ChainId fix
* updated ChainID Epoch for test net
* align comment with other comments
* fix the build using goimports
Co-authored-by: “GheisMohammadi” <“Gheis.Mohammadi@gmail.com”>
* [p2p]: feat: allow disable scan of private ips
Add a command line flag `--p2p.no-private-ip-scan` or config file option
in P2P `DisablePrivateIPScan` to stop node operators from receiving
netscan abuse emails. Fixes#4036, #4046 and #3788. After this change,
node operators should not need to use `iptables` to firewall out RFC1918
traffic.
* [p2p] fix: Cascade disallow private scan
...for native tokens only, and not for smart contracts (which will be
added later). Resolves#4132 and requires a hard fork, currently
scheduled at EpochTBD on main and test nets, but epoch 1 (after
AcceptsCrossTx) on other nets.
The precompile is at address 249 and the method has the signature
`crossShardTransfer(uint256 amount, address to, uint32 toShardID)`. It
requires a transfer of the `amount` to the precompile address first, in
the form of `msg.value`, and cascades a cross shard receipt to the
network when executed. At this stage, it is blocked for use by smart
contracts by checking that there is no code at the address, and that the
address is not a validator. Documentation for Python integration tests
to follow.
The version of the reflect2 library we were pulling in (transitively,
via json-iterator) segfaults on go 1.18, due to some use of the unsafe
package that is not portable accross version; I was seeing this manifest
not long after running `make debug`.
The problem is fixed in the latest version, and similarly the latest
version of json-iterator depends on the fixed version. So, this patch
updates to the latest version to get he fix.