rjl493456442
a41ea8a97c
all: cleanup the APIs for initializing genesis ( #25473 )
...
* all: polish tests
* core: apply feedback from Guillaume
* core: fix comment
2 years ago
Delweng
b196ad1c16
all: add whitespace linter ( #25312 )
...
* golangci: typo
Signed-off-by: Delweng <delweng@gmail.com>
* golangci: add whietspace
Signed-off-by: Delweng <delweng@gmail.com>
* *: rm whitesapce using golangci-lint
Signed-off-by: Delweng <delweng@gmail.com>
* cmd/puppeth: revert accidental resurrection
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2 years ago
Seungbae.yu
2697e44d81
all: change format `0x%x` to `%#x` ( #25221 )
2 years ago
lightclient
10dc5dce08
all: remove concept of public/private API definitions ( #25053 )
...
* internal/ethapi: rename PublicEthereumAPI to EthereumAPI
* eth: rename PublicEthereumAPI to EthereumAPI
* internal/ethapi: rename PublicTxPoolAPI to TxPoolAPI
* internal/ethapi: rename PublicAccountAPI to EthereumAccountAPI
* internal/ethapi: rename PrivateAccountAPI to PersonalAccountAPI
* internal/ethapi: rename PublicBlockChainAPI to BlockChainAPI
* internal/ethapi: rename PublicTransactionPoolAPI to TransactionAPI
* internal/ethapi: rename PublicDebugAPI to DebugAPI
* internal/ethapi: move PrivateDebugAPI methods to DebugAPI
* internal/ethapi: rename PublicNetAPI to NetAPI
* les: rename PrivateLightServerAPI to LightServerAPI
* les: rename PrivateLightAPI to LightAPI
* les: rename PrivateDebugAPI to DebugAPI
* les: rename PublicDownloaderAPI to DownloaderAPI
* eth,les: rename PublicFilterAPI to FilterAPI
* eth: rename PublicMinerAPI to MinerAPI
* eth: rename PublicDownloaderAPI to DownloaderAPI
* eth: move PrivateMinerAPI methods to MinerAPI
* eth: rename PrivateAdminAPI to AdminAPI
* eth: rename PublicDebugAPI to DebugAPI
* eth: move PrivateDebugAPI methods to DebugAPI
* node: rename publicAdminAPI to adminAPI
* node: move privateAdminAPI methods to adminAPI
* node: rename publicWeb3API to web3API
* eth,internal/ethapi: sync comments with previous renamings
2 years ago
lightclient
1cf58c7b81
readme,eth: remove references to eth.wiki ( #25086 )
2 years ago
Martin Holst Swende
a907d7e81a
all: more linters ( #24783 )
...
This enables the following linters
- typecheck
- unused
- staticcheck
- bidichk
- durationcheck
- exportloopref
- gosec
WIth a few exceptions.
- We use a deprecated protobuf in trezor. I didn't want to mess with that, since I cannot meaningfully test any changes there.
- The deprecated TypeMux is used in a few places still, so the warning for it is silenced for now.
- Using string type in context.WithValue is apparently wrong, one should use a custom type, to prevent collisions between different places in the hierarchy of callers. That should be fixed at some point, but may require some attention.
- The warnings for using weak random generator are squashed, since we use a lot of random without need for cryptographic guarantees.
2 years ago
Sina Mahmoodi
d9566e39bd
eth/filters: fix getLogs for pending block ( #24949 )
...
* eth/filters: fix pending for getLogs
* add pending method to test backend
* fix block range validation
2 years ago
Boqin Qin(秦 伯钦)
03157b6efa
eth/filters: use buffered channel to avoid goroutine leak ( #24928 )
2 years ago
Martin Holst Swende
7175f82495
eth/fetcher: avoid hang in tests (partial fix for #23331 ) ( #23351 )
...
* eth/fetcher: fix test to avoid hanging. Partial fix for #23331
* eth/filters: avoid dangling goroutines
* eth/fetcher: revert closing of proceed
3 years ago
EXEC
256aae0bfa
eth/filters: remove explicit continue label in filterLogs ( #24795 )
...
The loop label can be removed because this 'continue' statement
is not in a nested loop.
3 years ago
EXEC
d6b77f661c
eth/filters: fix code comment ( #24799 )
3 years ago
hero5512
f94e23ca66
eth/filters: remove unused struct fields ( #24782 )
3 years ago
Eng Zer Jun
8d066f1f42
all: use T.TempDir to create temporary test directories ( #24633 )
...
This commit replaces ioutil.TempDir with t.TempDir in tests. The
directory created by t.TempDir is automatically removed when the test
and all its subtests complete.
Prior to this commit, temporary directory created using ioutil.TempDir
had to be removed manually by calling os.RemoveAll, which is omitted in
some tests. The error handling boilerplate e.g.
defer func() {
if err := os.RemoveAll(dir); err != nil {
t.Fatal(err)
}
}
is also tedious, but t.TempDir handles this for us nicely.
Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
3 years ago
aaronbuchwald
d78590560d
eth/filters: remove unused field 'chaindb' in PublicFilterAPI ( #24072 )
3 years ago
Martin Holst Swende
31870a59ff
eth/filters, p2p/simulations: fix benchmarks ( #23806 )
...
Some benchmarks in eth/filters were not good: they weren't reproducible, relying on geth chaindata to be present.
Another one was rejected because the receipt was lacking a backing transcation.
The p2p simulation benchmark had a lot of the warnings below, due to the framework calling both
Stop() and Close(). Apparently, the simulated adapter is the only implementation which has a Close(),
and there is no need to call both Stop and Close on it.
3 years ago
Miro
5a0e1d88f4
eth/filters: fix TestPendingLogsSubscription ( #23619 )
...
The test did not synchronize with per-case goroutines, and thus didn't notice
that some tests were just hanging. This change adds missing synchronization
and fixes the broken tests.
3 years ago
Péter Szilágyi
7a7abe3de8
accounts/abi/bind: fix bounded contracts and sim backend for 1559 ( #23038 )
...
* accounts/abi/bind: fix bounded contracts and sim backend for 1559
* accounts/abi/bind, ethclient: don't rely on chain config for gas prices
* all: enable London for all internal tests
* les: get receipt type info in les tests
* les: fix weird test
Co-authored-by: Martin Holst Swende <martin@swende.se>
3 years ago
aaronbuchwald
f66f1a16b3
eth/filters: fix comment on PublicFilterAPI timeoutLoop ( #22782 )
4 years ago
gary rong
0c70b83e00
all: add read-only option to database ( #22407 )
...
* all: add read-only option to database
* all: fixes tests
* cmd/geth: migrate flags
* cmd/geth: fix the compact
* cmd/geth: fix the format
* cmd/geth: fix log
* cmd: add chain-readonly
* core: add readonly notion to freezer
* core/rawdb: add log
* core/rawdb: fix freezer close
* cmd: fix
* cmd, core: construct db
* core: update tests
4 years ago
Sina Mahmoodi
c4307a9339
eth/filters: fix potential deadlock in filter timeout loop ( #22178 )
...
This fixes #22131 and adds a test reproducing the issue.
4 years ago
Suriyaa Sundararuban
0a09a39325
eth/filters: replace wiki links with new doc pages ( #22070 )
4 years ago
Alex Prut
810f9e057d
all: remove redundant conversions and import names ( #21903 )
4 years ago
Martin Holst Swende
6402c42b67
all: simplify and fix database iteration with prefix/start ( #20808 )
...
* core/state/snapshot: start fixing disk iterator seek
* ethdb, rawdb, leveldb, memorydb: implement iterators with prefix and start
* les, core/state/snapshot: iterator fixes
* all: remove two iterator methods
* all: rename Iteratee.NewIteratorWith -> NewIterator
* ethdb: fix review concerns
5 years ago
ucwong
47f7c736cb
eth/filters: add missing Ticker.Stop call ( #20862 )
5 years ago
Ha ĐANG
5d7e5b00be
eth/filters: fix typo on unindexedLogs function's comment ( #20827 )
5 years ago
Felix Lange
d90d1db609
eth/filters: remove use of event.TypeMux for pending logs ( #20312 )
5 years ago
大彬
4ac04ae0fe
all: replace fmt.Print* calls with t.Log* in tests ( #19670 )
5 years ago
Péter Szilágyi
7221cb1434
core, eth, les, light: scope receipt functionality a bit cleaner
6 years ago
Matthew Halpern
6b0ddd141e
core, eth, les, light: store transaction receipts without txHash and gasCost
6 years ago
Péter Szilágyi
054412e335
all: clean up and proerly abstract database access
6 years ago
gary rong
c4a1d4fecf
eth/filters: fix the block range assignment for log filter ( #17284 )
6 years ago
Oleg Kovalov
d42ce0f2c1
all: simplify switches ( #17267 )
...
* all: simplify switches
* silly mistake
6 years ago
Ian Macalinao
d96ba77113
eth/filters: improve error message for invalid filter topics ( #17234 )
6 years ago
Péter Szilágyi
e1f1d3085c
accounts, eth, les: blockhash based filtering on all code paths
6 years ago
Domino Valdano
96339daf40
eth/filters, ethereum: EIP-234 add blockHash param for eth_getLogs
6 years ago
knarfeh
e75d0a6e4c
eth/filters: make filterLogs func more readable ( #16920 )
7 years ago
Péter Szilágyi
49719e21bc
core, eth: minor txpool event cleanups
7 years ago
rjl493456442
a2e43d28d0
all: collate new transaction events together
7 years ago
gary rong
7beccb29be
all: get rid of error when creating memory database ( #16716 )
...
* all: get rid of error when create mdb
* core: clean up variables definition
* all: inline mdb definition
7 years ago
gary rong
4e7dc34ff1
eth/filter: check nil pointer when unsubscribe ( #16682 )
...
* eth/filter: check nil pointer when unsubscribe
* eth/filters, accounts, rpc: abort system if subscribe failed
* eth/filter: add crit log before exit
* eth/filter, event: minor fixes
7 years ago
Domino Valdano
fedae95015
eth/filters: derive FilterCriteria from ethereum.FilterQuery ( #16629 )
7 years ago
Péter Szilágyi
6cf0ab38bd
core/rawdb: separate raw database access to own package ( #16666 )
7 years ago
Felix Lange
c7ab3e5544
common: delete StringToAddress, StringToHash ( #16436 )
...
* common: delete StringToAddress, StringToHash
These functions are confusing because they don't parse hex, but use the
bytes of the string. This change removes them, replacing all uses of
StringToAddress(s) by BytesToAddress([]byte(s)).
* eth/filters: remove incorrect use of common.BytesToAddress
7 years ago
Yusup
7aad81f881
eth: fix typos ( #16414 )
7 years ago
Péter Szilágyi
5cf1d35470
eth, les, light: filter on logs only, derive receipts on demand
7 years ago
Péter Szilágyi
1bf508b449
accounts/abi/bind: support event filtering in abigen
7 years ago
Péter Szilágyi
6f69cdd109
all: switch gas limits from big.Int to uint64
7 years ago
gary rong
5f8888e116
accounts, consensus, core, eth: make chain maker consensus agnostic ( #15497 )
...
* accounts, consensus, core, eth: make chain maker consensus agnostic
* consensus, core: move CalcDifficulty to Engine interface
* consensus: add docs for calcDifficulty function
* consensus, core: minor comment fixups
7 years ago
Péter Szilágyi
463014126f
core/bloombits: handle non 8-bit boundary section matches
7 years ago
ferhat elmas
86f6568f66
build: enable unconvert linter ( #15456 )
...
* build: enable unconvert linter
- fixes #15453
- update code base for failing cases
* cmd/puppeth: replace syscall.Stdin with os.Stdin.Fd() for unconvert linter
7 years ago