Web3.py - web3.exceptions.BlockNotFound: Block with id:

when i do loop, half of time i got error this web3.py - web3.exceptions.BlockNotFound: Block with id:

my code is like this

from web3 import Web3
from web3.middleware import geth_poa_middleware

w3 = Web3(Web3.HTTPProvider('https://polygon-rpc.com'))
w3.middleware_onion.inject(geth_poa_middleware, layer=0)

my_address = addresses[key]['MY_ADDRESS']
masterchef = w3.eth.contract(address=masterchef_address, abi=abi_masterchef) 
#master_chef
function_call = contract.functions.swapExactTokensForTokens(amountA,amountBMin,[tokenA,tokenB],address,deadline)

transaction = function_call.buildTransaction(
    {
    "from" : address,
}
)
signed_txn = w3.eth.account.sign_transaction(
transaction, private_key=private_key
)
tx_hash = w3.eth.send_raw_transaction(signed_txn.rawTransaction)

it is similar with this question (link)
the only difference is network and function.
idk what is problem, i guess the problem maybe block sync of latest block number
or because of this code w3.middleware_onion.inject(geth_poa_middleware, layer=0)

If POS is given terms of what is a srake it is a action yhat places a variable of currency into a source yhat has a governance and has an awareness of that stake in saying that therefore To prove that stake a centralised identy has to valdate that stake.how truley decentralised is this POS.there has yo be rules yet that also has a centralised control group.NODE algarythims are able to identify fraudulant activity then this becomed a neural network if a i …lets all identify that

@Gobinath @JacksonPolygon Can you please help with this?

1 Like

@JacksonPolygon thanks for answering. so does it mean that all validator do voting for distinguish fraudulant activity and my transfer was distinguished as fraud?

Ah I see, you are referring to one of your own TX?
No, the Governance framework I mentioned above votes on proposals set by team etc.
The framework would only relate to fraudulent activity of a Validator on the PoS chain, not to individual User TX. That would be a different monitoring system entirely.

Can you send the TX hash you are referencing?

@JacksonPolygon
the error appear like that

Block with id: ‘0xc98da3d8dfb31c1db27c4ddc3d936dd6797879627bfb822d7915d4e776d28f96’ not found.

idk it is hash tx or not