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

eth, miner: add timeout for building sealing block #73

Merged
merged 5 commits into from
Mar 15, 2024

Conversation

YoshihitoAso
Copy link
Member

@YoshihitoAso YoshihitoAso commented Mar 15, 2024

close #40

Since it was not possible to port it directly from geth, I implemented it from scratch while using it as a reference.

Test module

The test load module for payload timeout is available at the URL below.

$ export CONTRACT_NAME=Loop
$ python tests/compile.py
$ python tests/loop_deploy.py
DEPLOYED_CONTRACT_ADDRESS=0x20EF95C9C5059f1596F4fd50dAE2DC606f19C780
$ export DEPLOYED_CONTRACT_ADDRESS=0x20EF95C9C5059f1596F4fd50dAE2DC606f19C780
$ python loop.py

Results

INFO [03-15|09:06:31.022] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=2.145ms   mgasps=0.000   number=211,858 hash=6de036..8eafe9 dirty=4.12MiB
INFO [03-15|09:06:32.017] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=3.617ms   mgasps=0.000   number=211,859 hash=00a2cb..0ce4cf dirty=4.12MiB
INFO [03-15|09:06:33.021] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=5.136ms   mgasps=0.000   number=211,860 hash=459860..8168d6 dirty=4.12MiB
INFO [03-15|09:06:34.034] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=4.065ms   mgasps=0.000   number=211,861 hash=fb1ab7..e93af3 dirty=4.12MiB
INFO [03-15|09:06:35.050] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=15.031ms  mgasps=0.000   number=211,862 hash=a8c9c1..8d90ca dirty=4.12MiB
INFO [03-15|09:06:36.026] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=3.269ms   mgasps=0.000   number=211,863 hash=b4273f..ee5fec dirty=4.12MiB
INFO [03-15|09:06:37.020] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=3.743ms   mgasps=0.000   number=211,864 hash=1ec481..5e174d dirty=4.12MiB
INFO [03-15|09:06:38.031] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=11.257ms  mgasps=0.000   number=211,865 hash=28ade6..5a0c2a dirty=4.12MiB
INFO [03-15|09:06:39.944] Imported new chain segment               blocks=1  txs=38  mgas=17.146  elapsed=267.648ms mgasps=64.063  number=211,866 hash=87be23..06df60 dirty=4.19MiB
INFO [03-15|09:06:40.924] Imported new chain segment               blocks=1  txs=105 mgas=47.378  elapsed=887.221ms mgasps=53.400  number=211,867 hash=d8de83..309169 dirty=4.34MiB
INFO [03-15|09:06:41.032] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=6.697ms   mgasps=0.000   number=211,868 hash=1c94f5..3a1c75 dirty=4.34MiB
INFO [03-15|09:06:43.152] Downloader queue stats                   receiptTasks=0 blockTasks=0 itemSize=7.12KiB throttle=8192
INFO [03-15|09:06:43.360] Imported new chain segment               blocks=1  txs=146 mgas=65.878  elapsed=1.300s    mgasps=50.662  number=211,869 hash=4ab84f..c2a1f4 dirty=4.54MiB
INFO [03-15|09:06:43.373] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=7.762ms   mgasps=0.000   number=211,870 hash=11bac6..b1765f dirty=4.54MiB
INFO [03-15|09:06:45.781] Imported new chain segment               blocks=1  txs=150 mgas=67.683  elapsed=1.112s    mgasps=60.852  number=211,871 hash=70d5ae..092b90 dirty=4.75MiB
INFO [03-15|09:06:45.798] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=13.452ms  mgasps=0.000   number=211,872 hash=4a2abb..235b34 dirty=4.75MiB
INFO [03-15|09:06:46.986] Imported new chain segment               blocks=1  txs=153 mgas=69.036  elapsed=950.497ms mgasps=72.632  number=211,873 hash=4b805d..c40aad dirty=4.97MiB
INFO [03-15|09:06:47.553] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=14.702ms  mgasps=0.000   number=211,874 hash=fc605b..417b83 dirty=4.97MiB
INFO [03-15|09:06:48.030] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=6.062ms   mgasps=0.000   number=211,875 hash=009dbe..d92010 dirty=4.97MiB
INFO [03-15|09:06:50.839] Imported new chain segment               blocks=1  txs=179 mgas=80.768  elapsed=1.786s    mgasps=45.221  number=211,876 hash=397111..517fd0 dirty=5.22MiB
INFO [03-15|09:06:50.867] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=20.408ms  mgasps=0.000   number=211,877 hash=3321f0..4c650e dirty=5.22MiB
INFO [03-15|09:06:51.051] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=3.066ms   mgasps=0.000   number=211,878 hash=c16ec9..c3be76 dirty=5.22MiB
INFO [03-15|09:06:52.996] Imported new chain segment               blocks=1  txs=229 mgas=103.329 elapsed=355.587ms mgasps=290.587 number=211,879 hash=f17768..9cfdd5 dirty=5.51MiB
INFO [03-15|09:06:53.519] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=2.695ms   mgasps=0.000   number=211,880 hash=7e2806..5276b3 dirty=5.51MiB
INFO [03-15|09:06:54.024] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=1.520ms   mgasps=0.000   number=211,881 hash=49234a..689d3a dirty=5.51MiB
INFO [03-15|09:06:55.019] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=2.886ms   mgasps=0.000   number=211,882 hash=ff5599..8d9337 dirty=5.51MiB
INFO [2024-03-15 09:06:55,081|MONITOR-BLOCK-SYNC] Blocks are successfully synchronized: start=211852, latest=211882
INFO [03-15|09:06:56.522] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=2.396ms   mgasps=0.000   number=211,883 hash=e1d5f0..a1df53 dirty=5.51MiB
INFO [03-15|09:06:57.530] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=3.033ms   mgasps=0.000   number=211,884 hash=989327..337dfe dirty=5.51MiB
INFO [03-15|09:06:58.524] Imported new chain segment               blocks=1  txs=0   mgas=0.000   elapsed=2.483ms   mgasps=0.000   number=211,885 hash=114831..e9499e dirty=5.51MiB

@YoshihitoAso YoshihitoAso marked this pull request as ready for review March 15, 2024 09:07
GasCeil: params.GenesisGasLimit,
GasPrice: big.NewInt(params.GWei),
Recommit: 3 * time.Second,
NewPayloadTimeout: 800 * time.Millisecond, // for ibet
Copy link
Member Author

@YoshihitoAso YoshihitoAso Mar 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it is set to 800msec, more detailed verification may be necessary.

@YoshihitoAso YoshihitoAso self-assigned this Mar 15, 2024
@YoshihitoAso YoshihitoAso merged commit 2750303 into dev-2.3 Mar 15, 2024
5 checks passed
@YoshihitoAso YoshihitoAso deleted the feature/#40 branch March 15, 2024 11:05
@YoshihitoAso
Copy link
Member Author

We verified the validity of the setting value of 800 milliseconds. Confirmed that it works without problems even on networks where timeouts occur frequently. We also tested a setting of 600 milliseconds.

PayloadTimeout_analysis.xlsx

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.

txpool is stuck due to heavy transaction
2 participants