-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
No matching events found #699
Comments
Your stacktrace shows a different event name And it looks like it may have a casing error, since |
Oh damn, sorry. I chagend the code to be minimalistic for the Issue but copied the wrong console output. Edit: I know it should say, but i was sort of a proof of concept |
The error appears to be a failure to find the actual event ABI for named event. Can you provide the full contract ABI for the contract in question (the one with the |
Added ABI. Might be similar issue to #209 with v3.10.0... |
Tested on parity, same result. I think i found the source of the error-output. I didn't provide But this won't explain why it doesn't find any of the events. Any ideas how i could test for the source of the error? |
@Lebski You are right, the reason for the error is the inclusion of The error message is a bit misleading and could be improved to say "No matching event interfaces found". |
@dylanjw But the reason I added this in the first place, is because I couldn't track the event without it. |
Note the block number in the transaction receipt which shows the The default block boundaries on filters can be unintuitive. |
Can you re-verify on the latest stable version? (v4.1.0) |
Same issue... |
Ah yes, there's the known bug that ganache is case-sensitive to searches. I'd recommend a different testing backend until they get that resolved. Closing as a duplicate of #674 |
I'm so sorry to bother you again. Since v5 got already announced I'd love to wrap my head around before the method isn't available anymore.
The transfer_filter is every times successful, but the event_filter is never. |
What web3.py version? Which provider? What type of node? Also, looks like a copy/paste error in your code, can you take another look?
No need to apologize, we're happy to help! We usually need version info and a minimal, complete, and verifiable example to provide that help. :) |
Thank you very much. I was worried because this issue is going on since over a month now...
Script import json, web3, time
from web3 import Web3, HTTPProvider
def setup_Web3():
global web3
web3 = Web3(HTTPProvider('http://localhost:8545'))
def make_request(contract_interface, contract_address):
deployed_Contract = web3.eth.contract(abi=contract_interface['abi'], address=contract_address)
event_filter = deployed_Contract.events.PermissionRequestDeployed.createFilter(fromBlock="latest")
transfer_filter = deployed_Contract.eventFilter('PermissionRequestDeployed')
while True:
print ("Event_filter: {}".format(event_filter.get_new_entries()))
print ("Transfer_filter: {}".format(transfer_filter.get_new_entries()))
time.sleep(0.1)
print("listening...")
def handle_event(event):
print(event)
setup_Web3()
#loading resources
make_request(contract_interface, contract_address)` Output Event_filter: []
Transfer_filter: [AttributeDict({'logIndex': 0, 'transactionIndex': 0, 'blockNumber': 1262, 'blockHash': HexBytes('0x82383db66f6ac078180a1687dd54365e140c45fba85b893d374efa360c234aec'), 'address': '0x0aF62bE1f6c6a9F1c569c362eAdcDA9198eb9688', 'transactionHash': HexBytes('0x82d8591df9951bb9759a55b53fc6db26c89f9bf07373758c197217d2cdd6f60c'), 'event': 'PermissionRequestDeployed', 'args': AttributeDict({'permissionId': b'o\x80Zb\xf1\x07t\xdf\xf4\x1e\xe1\x11\x86\xbcF\x8bt=\xf9\x86\xf9\xee,\xb4\xe0\xc0\x1eL\xa4\xbe[\xef'})})] |
Cool, this highlights an interesting case. @dylanjw might have more ideas, but the first difference I notice between the two is the last_block_num = web3.eth.getBlock('latest').number
deployed_Contract.events.PermissionRequestDeployed.createFilter(fromBlock=last_block_num) |
I tried using a static value as you suggest in the example. I got the receipt from geth: {
blockHash: "0xc74ba710c19be11f19629f390e8f03f7d5eb0e19d4db3db381f574be44d55ca2",
blockNumber: 1897,
from: "0x4f6b4c67eee111497ef2b85fc1d133d3ca3fd51b",
gas: 194079,
gasPrice: 18000000000,
hash: "0x6f4e3961cd68c6532d44158b77755a4e8f3bebe629b05fa4f8d8d6591da2b33b",
input: "0xded56e846f805a62f10774dff41ee11186bc468b743df986f9ee2cb4e0c01e4ca4be5bef52533235360000000000000000000000000000000000000000000000000000004a575400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000091d000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002",
nonce: 26,
r: "0x3711c0f88f2541974a5cace6c2677f8b93244c16ceb61af38b1dc81feacd0817",
s: "0x1d194c5ff8eff501c5406d70d2d2001a229a2aba7b0bcf2afd91fb580d8423ea",
to: "0x2c7477dac8a800a530f19cc359205af6506afc6f",
transactionIndex: 0,
v: "0xc4b",
value: 0
} |
Ok, I'm going to reopen this, and update the summary with this info. It seems like a Web3.py bug, if not in the code, then in the docs. |
Since the same behavior is happening with a numbered block as with "latest", Im lead to believe this to be something else weird between the two api's. The two implementations do have some differences in the resulting filter parameters they generate. The new createFilter api will be more strict in matching events, whereas the eventFilter will be less strict. @Lebski Can you paste the values of the following attributes? event_filter.filter_params
transfer_filter.filter_params |
Thanks! event_filter.filter_parms: {'topics': [[], ['0xcaa1f0711b61f68acccf4ded56d6d4d50c40d4d8e4374a0fd108938d71e22966']], 'fromBlock': 614, 'address': ['0x3E11998369808487c3a7444454241619E4903c83', '0x3E11998369808487c3a7444454241619E4903c83'], 'toBlock': 'latest'} transfer_filter.filter_parms: {'topics': ['0xcaa1f0711b61f68acccf4ded56d6d4d50c40d4d8e4374a0fd108938d71e22966'], 'address': '0x3E11998369808487c3a7444454241619E4903c83'} |
@dylanjw , it's |
No problem. Im glad we could get to the bottom of it! Re-open this issue if you hit an issue after upgrading. |
(with rpcapi="db,eth,net,web3,personal,web3")
Script
Output
last_block_num
was set to Block 1895.The transaction was mined in Block 1897.
The text was updated successfully, but these errors were encountered: