-
Notifications
You must be signed in to change notification settings - Fork 143
proxy: log filters #3461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
proxy: log filters #3461
Changes from all commits
dfca8f0
1c7c5c0
9ee3935
6b83d9d
11fa141
73a0dbb
77d2d39
d7fe602
5bb8b62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
{.push raises: [], gcsafe.} | ||
|
||
import | ||
std/tables, | ||
json_rpc/[rpcproxy, rpcclient], | ||
web3/[eth_api, eth_api_types], | ||
stint, | ||
|
@@ -63,6 +64,10 @@ type | |
eth_getTransactionByHash*: GetTransactionByHashProc | ||
eth_getLogs*: GetLogsProc | ||
|
||
FilterStoreItem* = object | ||
filter*: FilterOptions | ||
blockMarker*: Opt[Quantity] | ||
|
||
VerifiedRpcProxy* = ref object | ||
evm*: AsyncEvm | ||
proxy*: RpcProxy | ||
|
@@ -74,6 +79,7 @@ type | |
|
||
# TODO: when the list grows big add a config object instead | ||
# config parameters | ||
filterStore*: Table[string, FilterStoreItem] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It appears that this table can grow without limit. I didn't see any upper bound set on the number of filters that can be created. I would suggest setting a max for this. If you are at the max then creating new filters should fail. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch. will change this |
||
chainId*: UInt256 | ||
maxBlockWalk*: uint64 | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the generated id is already used? Sure this is very unlikely to happen but it wouldn't hurt to check for this and generate a second id if there is a clash perhaps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. Will implement this