Skip to content
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

fix: BLAKE2 test implementation #435

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

leovct
Copy link
Member

@leovct leovct commented Nov 13, 2024

Description

This PR addresses #432 (comment).

Follow up of #432.

Not only the precompile address was wrong but also the test implementation!

Most of the Solidity code has been borrowed from the EIP-152 example usage section.

Jira / Linear Tickets

x

Testing

The BLAKE2 precompile is tested properly.

$ polycli loadtest --verbosity 700 --mode px --function 9                                                                                                                            took 8s at 14:11:11
2:11PM TRC Starting logger in console mode
2:11PM INF Starting Load Test
2:11PM INF Connecting with RPC endpoint to initialize load test parameters
2:11PM TRC Retrieved current gas price gasprice=1225209817
2:11PM TRC Retrieved current gas tip cap gastipcap=1000000000
2:11PM TRC Current Block Number blocknumber=12
2:11PM TRC Current account balance balance=1009999999982545501929877500
2:11PM DBG Eip-1559 support detected
2:11PM TRC Detected Chain ID chainID=1337
2:11PM TRC Params Input Params={"AdaptiveBackoffFactor":2,"AdaptiveCycleDuration":10,"AdaptiveRateLimit":false,"AdaptiveRateLimitIncrement":50,"BatchSize":999,"BlobFeeCap":100000,"ByteCount":1024,"CallOnly":false,"CallOnlyLatestBlock":false,"ChainID":1337,"ChainSupportBaseFee":true,"Concurrency":1,"ContractAddress":"","ContractCallData":"","ContractCallFunctionArgs":[],"ContractCallFunctionSignature":"","ContractCallPayable":false,"ContractETHAddress":"0x0000000000000000000000000000000000000000","CurrentBaseFee":253348661,"CurrentGasPrice":1225209817,"CurrentGasTipCap":1000000000,"CurrentNonce":11,"DelAddress":null,"ECDSAPrivateKey":{"Curve":{"B":7,"BitSize":256,"Gx":55066263022277343669578718895168534326250603453777594175500187360389116729240,"Gy":32670510020758816978083085130507043184471273380659243275938904335757337482424,"N":115792089237316195423570985008687907852837564279074904382605163141518161494337,"P":115792089237316195423570985008687907853269984665640564039457584007908834671663},"D":30175782965061331201157137042014122781558886384910785332752666033589853463034,"X":36405839969746785076083915005678656647806951607600131854360360806126023484467,"Y":33607126158016649181688023362411565996635601901352589004706892696521135399893},"ERC20Address":"","ERC721Address":"","EthAmountInWei":0.001,"ForceContractDeploy":false,"ForceGasLimit":0,"ForceGasPrice":0,"ForcePriorityGasPrice":0,"FromETHAddress":"0x85da99c8a7c2c95964c8efd687e95e632fc533d6","Function":9,"InscriptionContent":"data:,{\"p\":\"erc-20\",\"op\":\"mint\",\"tick\":\"TEST\",\"amt\":\"1\"}","Iterations":1,"LegacyTransactionMode":false,"LtAddress":"","Mode":10,"Modes":["px"],"MultiMode":false,"ParsedModes":[10],"PrivateKey":"42b6e34dc21598a807dc19d7784c71b2a7a01f6480dc6f58258f78e539f1a1fa","RPCUrl":"http://localhost:8545","RateLimit":4,"RecallLength":50,"Requests":1,"Seed":123456,"SendAmount":1000000000000000,"SendOnly":false,"ShouldProduceSummary":false,"StartNonce":0,"SteadyStateTxPoolSize":1000,"SummaryOutputMode":"text","TimeLimit":-1,"ToAddress":"0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF","ToETHAddress":"0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef","ToRandom":false}
2:11PM TRC Load test contract address contractaddress=0xa724c1d8be68fedde7a9ad08bf18b270c0935c76
2:11PM DBG Obtained load test contract address ltAddr=0xA724c1d8be68FeDDe7A9Ad08BF18B270c0935C76
2:11PM INF setting the starting nonce startNonce=0
2:11PM DBG Starting main load test loop currentNonce=12
2:11PM TRC Starting Thread routine=0
2:11PM TRC Finished starting go routines. Waiting..
2:11PM TRC Executing contract method method=TestBlake2f
2:11PM TRC Request mode=loadTestModeSpecificPrecompiledContract nonce=12 request=0 routine=0
2:11PM DBG Finished main load test loop lastNonce=13 startNonce=12
2:11PM DBG Waiting for remaining transactions to be completed and mined
2:11PM TRC It looks like all transactions have been mined currentNonceForFinalBlock=13 endblock=14 startblock=13
2:11PM DBG Got final block number currentNonce=13 final block number=14
2:11PM INF * Results
2:11PM INF Samples samples=1
2:11PM INF Start time of loadtest (first transaction sent) startTime=2024-11-13T14:11:16+01:00
2:11PM INF End time of loadtest (final transaction mined) endTime=2024-11-13T14:11:16+01:00
2:11PM INF Successful Requests Per Second tps=256.8327792594176
2:11PM INF Request Latency of Transactions Stats max=0.002913834 mean=0.002913834 median=0.002913834 min=0.002913834 stddev=0
2:11PM INF Rough test summary finalRateLimit=4 testDuration=0.003893584
2:11PM INF Num errors numErrors=0
2:11PM INF Finished

@leovct leovct merged commit 3fee0b7 into 0xPolygon:main Nov 13, 2024
6 checks passed
@leovct leovct deleted the fix/blake2f-test-implementation branch November 13, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants