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

Quorum node crashing when running with QBFT #1491

Closed
vsmk98 opened this issue Sep 2, 2022 · 2 comments · Fixed by #1506
Closed

Quorum node crashing when running with QBFT #1491

vsmk98 opened this issue Sep 2, 2022 · 2 comments · Fixed by #1506
Assignees

Comments

@vsmk98
Copy link
Contributor

vsmk98 commented Sep 2, 2022

System information

Geth version: Geth
Version: 1.10.2-stable
Git Commit: 0b0881a
Git Commit Date: 20220822
Quorum Version: 22.7.0
Architecture: amd64
Network Id: 1337
Go Version: go1.18.2
Operating System: darwin
GOPATH=
GOROOT=go
OS & Version: OSX
Commit hash : 0b0881a

Expected behaviour

QBFT consensus working fine without any faulires

Actual behaviour

Node crashed with the below message:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x49d2292]

Steps to reproduce the behaviour

  • bring up 7 node quorum network
  • execute a smart contract running a simple for loop with high loop count
  • tx fails with vm out of gas error
  • node crashes suddenly

Backtrace

INFO [09-01|16:38:00.912] QBFT: start new round                    address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 old.round=0  old.sequence=128 old.state=Committed        old.proposer=0xF512a992F3fb749857d758fFDa1330e590fa915E next.round=0 next.seq=129 next.proposer=0xb131288F355BC27090E542aE0be213c20350B767 next.valSet="[0x6571D97f340c8495B661a823F2C2145cA47D63c2 0x8157D4437104e3B8dF4451a85F7B2438ef6699FF 0xF512a992F3fb749857d758fFDa1330e590fa915E 0xb131288F355BC27090E542aE0be213c20350B767 0xb912De287F9b047B4228436E94B5b78E3Ee16171 0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 0xe36cbeB565B061217930767886474e3cDe903AC5]" next.size=7 next.IsProposer=false
INFO [09-01|16:38:26.756] VM returned with error                   err="out of gas"
INFO [09-01|16:38:26.756] Aborting transaction processing due to 'commitInterruptNewHead', elapsed time=30.864690149s
INFO [09-01|16:38:26.757] Commit new mining work                   number=129 sealhash="38586b…451231" uncles=0 txs=0 gas=0 fees=0 elapsed="229.351µs"
INFO [09-01|16:38:26.757] QBFT: handle block proposal request      address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state="Accept request"
INFO [09-01|16:38:30.832] QBFT: handle PRE-PREPARE message         address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966
INFO [09-01|16:38:30.833] QBFT: accepted PRE-PREPARE message       address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966
INFO [09-01|16:38:30.833] QBFT: changed state                      address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 old.state="Accept request" new.state=Preprepared
INFO [09-01|16:38:30.833] QBFT: broadcast PREPARE message          address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state=Preprepared      msg.code=19 msg.source=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 msg.round=0 msg.sequence=129 payload=0xf868e4818180a0a5c2d86eab596cece47b350312a86bdbd5dffa6979d2b3c838ef055ebbc390d2b841ef0297e53ad30632b6e5d56cbf33caeae079237b83ee3e80eb37233d9ea5f1e459e33e07d5f6581c92da2018ee313272ed2743c46dd566def7374ca344ebc95401
INFO [09-01|16:38:30.833] QBFT: handle PREPARE message             address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state=Preprepared      msg.code=19 msg.source=0xb131288F355BC27090E542aE0be213c20350B767 msg.round=0 msg.sequence=129 prepares.count=0 quorum=5
INFO [09-01|16:38:30.834] QBFT: handle PREPARE message             address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state=Preprepared      msg.code=19 msg.source=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 msg.round=0 msg.sequence=129 prepares.count=1 quorum=5
INFO [09-01|16:38:30.835] QBFT: handle PREPARE message             address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state=Preprepared      msg.code=19 msg.source=0xe36cbeB565B061217930767886474e3cDe903AC5 msg.round=0 msg.sequence=129 prepares.count=2 quorum=5
INFO [09-01|16:38:30.836] QBFT: handle PREPARE message             address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state=Preprepared      msg.code=19 msg.source=0x6571D97f340c8495B661a823F2C2145cA47D63c2 msg.round=0 msg.sequence=129 prepares.count=3 quorum=5
INFO [09-01|16:38:30.845] QBFT: handle PREPARE message             address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state=Preprepared      msg.code=19 msg.source=0xF512a992F3fb749857d758fFDa1330e590fa915E msg.round=0 msg.sequence=129 prepares.count=4 quorum=5
INFO [09-01|16:38:30.846] QBFT: received quorum of PREPARE messages address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state=Preprepared      msg.code=19 msg.source=0xF512a992F3fb749857d758fFDa1330e590fa915E msg.round=0 msg.sequence=129 prepares.count=5 quorum=5
INFO [09-01|16:38:30.846] QBFT: changed state                      address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 old.state=Preprepared      new.state=Prepared
INFO [09-01|16:38:30.846] QBFT: broadcast COMMIT message           address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state=Prepared         msg.code=20 msg.source=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 msg.round=0 msg.sequence=129 payload=0xf8acf867818180a0a5c2d86eab596cece47b350312a86bdbd5dffa6979d2b3c838ef055ebbc390d2b84124777982e8e519e9034b14694cb52a58c2298a398dcb45109a0adc2306717d304e0612d29bca4f8a7892a7b49704d5c989e4446b65cf0de016ac5546e30579e401b841dc8a7c9e7dbc3756e18a83239ed90e30aecc28d8005ab3c90faf4a3cd709144c4840406b4138cf4afca944f92de0824deafa029d11df2112541e87c6b392c2c601
INFO [09-01|16:38:30.849] QBFT: handle COMMIT message              address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state=Prepared         msg.code=20 msg.source=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 msg.round=0 msg.sequence=129 commits.count=0 quorum=5
INFO [09-01|16:38:30.850] QBFT: handle COMMIT message              address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state=Prepared         msg.code=20 msg.source=0xb912De287F9b047B4228436E94B5b78E3Ee16171 msg.round=0 msg.sequence=129 commits.count=1 quorum=5
INFO [09-01|16:38:30.850] QBFT: handle COMMIT message              address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state=Prepared         msg.code=20 msg.source=0xe36cbeB565B061217930767886474e3cDe903AC5 msg.round=0 msg.sequence=129 commits.count=2 quorum=5
INFO [09-01|16:38:30.851] QBFT: handle COMMIT message              address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state=Prepared         msg.code=20 msg.source=0x6571D97f340c8495B661a823F2C2145cA47D63c2 msg.round=0 msg.sequence=129 commits.count=3 quorum=5
INFO [09-01|16:38:30.852] QBFT: handle COMMIT message              address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state=Prepared         msg.code=20 msg.source=0xF512a992F3fb749857d758fFDa1330e590fa915E msg.round=0 msg.sequence=129 commits.count=4 quorum=5
INFO [09-01|16:38:30.852] QBFT: received quorum of COMMIT messages address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state=Prepared         msg.code=20 msg.source=0xF512a992F3fb749857d758fFDa1330e590fa915E msg.round=0 msg.sequence=129 commits.count=5 quorum=5
INFO [09-01|16:38:30.852] QBFT: changed state                      address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 old.state=Prepared         new.state=Committed
INFO [09-01|16:38:30.852] BFT: block proposal committed            author=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 hash="a5c2d8…c390d2" number=129
INFO [09-01|16:38:30.855] Imported new chain segment               blocks=1 txs=0 mgas=0.000 elapsed=1.330ms     mgasps=0.000 number=129 hash="a5c2d8…c390d2" dirty=0.00B
INFO [09-01|16:38:30.856] QBFT: handle final committed             address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 state=Committed
INFO [09-01|16:38:30.856] QBFT: initialize new round               address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=129 target.round=0 lastProposal.number=129 lastProposal.hash="a5c2d8…c390d2"
INFO [09-01|16:38:30.856] QBFT: changed state                      address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=130 old.state=Committed        new.state="Accept request"
INFO [09-01|16:38:30.856] QBFT: start new round                    address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 old.round=0  old.sequence=129 old.state=Committed        old.proposer=0xb131288F355BC27090E542aE0be213c20350B767 next.round=0 next.seq=130 next.proposer=0xb912De287F9b047B4228436E94B5b78E3Ee16171 next.valSet="[0x6571D97f340c8495B661a823F2C2145cA47D63c2 0x8157D4437104e3B8dF4451a85F7B2438ef6699FF 0xF512a992F3fb749857d758fFDa1330e590fa915E 0xb131288F355BC27090E542aE0be213c20350B767 0xb912De287F9b047B4228436E94B5b78E3Ee16171 0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 0xe36cbeB565B061217930767886474e3cDe903AC5]" next.size=7 next.IsProposer=false
INFO [09-01|16:38:41.235] QBFT: handle ROUND-CHANGE message        address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=130 state="Accept request" msg.code=21 msg.source=0xe36cbeB565B061217930767886474e3cDe903AC5 msg.round=1 msg.sequence=130 higherRoundChanges.count=0 currentRoundChanges.count=0
INFO [09-01|16:38:41.256] QBFT: handle ROUND-CHANGE message        address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=130 state="Accept request" msg.code=21 msg.source=0x6571D97f340c8495B661a823F2C2145cA47D63c2 msg.round=1 msg.sequence=130 higherRoundChanges.count=1 currentRoundChanges.count=0
INFO [09-01|16:38:41.285] QBFT: handle ROUND-CHANGE message        address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=130 state="Accept request" msg.code=21 msg.source=0x8157D4437104e3B8dF4451a85F7B2438ef6699FF msg.round=1 msg.sequence=130 higherRoundChanges.count=2 currentRoundChanges.count=0
INFO [09-01|16:38:41.286] QBFT: received F+1 ROUND-CHANGE messages address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=130 state="Accept request" msg.code=21 msg.source=0x8157D4437104e3B8dF4451a85F7B2438ef6699FF msg.round=1 msg.sequence=130 higherRoundChanges.count=3 currentRoundChanges.count=0 F=2
INFO [09-01|16:38:41.286] QBFT: initialize new round               address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=130 target.round=1 lastProposal.number=129 lastProposal.hash="a5c2d8…c390d2"
INFO [09-01|16:38:41.286] QBFT: start new round                    address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 old.round=0  old.sequence=130 old.state="Accept request" old.proposer=0xb912De287F9b047B4228436E94B5b78E3Ee16171 next.round=1 next.seq=130 next.proposer=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 next.valSet="[0x6571D97f340c8495B661a823F2C2145cA47D63c2 0x8157D4437104e3B8dF4451a85F7B2438ef6699FF 0xF512a992F3fb749857d758fFDa1330e590fa915E 0xb131288F355BC27090E542aE0be213c20350B767 0xb912De287F9b047B4228436E94B5b78E3Ee16171 0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 0xe36cbeB565B061217930767886474e3cDe903AC5]" next.size=7 next.IsProposer=true
INFO [09-01|16:38:41.286] QBFT: broadcast ROUND-CHANGE message     address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=1 current.sequence=130 state="Accept request" msg.code=21 msg.source=0x0000000000000000000000000000000000000000 msg.round=1 msg.sequence=130 payload=0xf84cf848c4818201c0b8413b079a705d70c2cf4c6487b4081b89ceb31b11425d03f80aa2968290437d2c48478fad9dd4c40980047c5682dc96889e6e27eb9140eccad1e31af02fca6adc9301c0c0
INFO [09-01|16:38:41.287] QBFT: handle ROUND-CHANGE message        address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=1 current.sequence=130 state="Accept request" msg.code=21 msg.source=0xF512a992F3fb749857d758fFDa1330e590fa915E msg.round=1 msg.sequence=130 higherRoundChanges.count=0 currentRoundChanges.count=3
INFO [09-01|16:38:41.287] QBFT: handle ROUND-CHANGE message        address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=1 current.sequence=130 state="Accept request" msg.code=21 msg.source=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 msg.round=1 msg.sequence=130 higherRoundChanges.count=0 currentRoundChanges.count=4
INFO [09-01|16:38:41.287] QBFT: received quorum of ROUND-CHANGE messages address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=1 current.sequence=130 state="Accept request" msg.code=21 msg.source=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 msg.round=1 msg.sequence=130 higherRoundChanges.count=0 currentRoundChanges.count=5
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x49d2292]

goroutine 338 [running]:
github.com/ethereum/go-ethereum/consensus/istanbul/qbft/core.(*core).handleRoundChange(0xc0002a4100, 0xc00172cb40)
	github.com/ethereum/go-ethereum/consensus/istanbul/qbft/core/roundchange.go:153 +0x652
github.com/ethereum/go-ethereum/consensus/istanbul/qbft/core.(*core).deliverMessage(0xc0002a4100, {0x555f0e0, 0xc00172cb40})
	github.com/ethereum/go-ethereum/consensus/istanbul/qbft/core/handler.go:217 +0xf8
github.com/ethereum/go-ethereum/consensus/istanbul/qbft/core.(*core).handleDecodedMessage(0xc0002a4100?, {0x555f0e0, 0xc00172cb40})
	github.com/ethereum/go-ethereum/consensus/istanbul/qbft/core/handler.go:202 +0xd1
github.com/ethereum/go-ethereum/consensus/istanbul/qbft/core.(*core).handleEncodedMsg(0xc0002a4100, 0xc0009e3f2c?, {0xc00164c0f0, 0x4e, 0x4e})
	github.com/ethereum/go-ethereum/consensus/istanbul/qbft/core/handler.go:188 +0x385
github.com/ethereum/go-ethereum/consensus/istanbul/qbft/core.(*core).handleEvents(0xc0002a4100)
	github.com/ethereum/go-ethereum/consensus/istanbul/qbft/core/handler.go:122 +0x2dd
created by github.com/ethereum/go-ethereum/consensus/istanbul/qbft/core.(*core).Start
	github.com/ethereum/go-ethereum/consensus/istanbul/qbft/core/handler.go:37 +0xa5

When submitting logs: please submit them as text and not screenshots.
1.log

@baptiste-b-pegasys
Copy link
Contributor

baptiste-b-pegasys commented Sep 6, 2022

Hello I am not able to reproduce this on mac m1

INFO [09-06|18:23:52.170] Imported new chain segment               blocks=1 txs=1 mgas=0.172 elapsed="653.75µs"  mgasps=263.065 number=19 hash=fc412f..f3650b dirty=986.00B
INFO [09-06|18:23:52.171] Commit new mining work                   number=20 sealhash=def0bc..42cd69 uncles=0 txs=0 gas=0       fees=0 elapsed="109.167µs"
INFO [09-06|18:23:52.171] QBFT: handle final committed             address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=19 state=Committed
INFO [09-06|18:23:52.171] QBFT: initialize new round               address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=19 target.round=0 lastProposal.number=19 lastProposal.hash=fc412f..f3650b
INFO [09-06|18:23:52.171] QBFT: changed state                      address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 old.state=Committed        new.state="Accept request"
INFO [09-06|18:23:52.171] QBFT: start new round                    address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 old.round=0  old.sequence=19 old.state=Committed        old.proposer=0xb912De287F9b047B4228436E94B5b78E3Ee16171 next.round=0 next.seq=20 next.proposer=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 next.valSet="[0x6571D97f340c8495B661a823F2C2145cA47D63c2 0x8157D4437104e3B8dF4451a85F7B2438ef6699FF 0xF512a992F3fb749857d758fFDa1330e590fa915E 0xb131288F355BC27090E542aE0be213c20350B767 0xb912De287F9b047B4228436E94B5b78E3Ee16171 0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 0xe36cbeB565B061217930767886474e3cDe903AC5]" next.size=7 next.IsProposer=true
WARN [09-06|18:23:52.608] Caller gas above allowance, capping      requested=3,739,788,830 cap=25,000,000
INFO [09-06|18:23:52.625] VM returned with error                   err="out of gas"
INFO [09-06|18:23:52.646] VM returned with error                   err="out of gas"
INFO [09-06|18:23:52.669] VM returned with error                   err="out of gas"
INFO [09-06|18:23:52.693] VM returned with error                   err="out of gas"
INFO [09-06|18:23:52.719] VM returned with error                   err="out of gas"
INFO [09-06|18:23:52.744] VM returned with error                   err="out of gas"
INFO [09-06|18:23:52.770] VM returned with error                   err="out of gas"
INFO [09-06|18:23:52.796] VM returned with error                   err="out of gas"
INFO [09-06|18:23:52.822] VM returned with error                   err="out of gas"
INFO [09-06|18:23:52.848] VM returned with error                   err="out of gas"
INFO [09-06|18:23:52.874] VM returned with error                   err="out of gas"
INFO [09-06|18:23:52.901] VM returned with error                   err="out of gas"
INFO [09-06|18:23:52.927] VM returned with error                   err="out of gas"
INFO [09-06|18:23:52.953] VM returned with error                   err="out of gas"
INFO [09-06|18:23:52.979] VM returned with error                   err="out of gas"
INFO [09-06|18:23:53.006] VM returned with error                   err="out of gas"
INFO [09-06|18:23:53.033] VM returned with error                   err="out of gas"
INFO [09-06|18:23:53.059] VM returned with error                   err="out of gas"
INFO [09-06|18:23:53.086] VM returned with error                   err="out of gas"
INFO [09-06|18:23:53.113] VM returned with error                   err="out of gas"
INFO [09-06|18:23:53.139] VM returned with error                   err="out of gas"
INFO [09-06|18:23:53.165] VM returned with error                   err="out of gas"
INFO [09-06|18:23:53.192] VM returned with error                   err="out of gas"
INFO [09-06|18:23:53.218] VM returned with error                   err="out of gas"
INFO [09-06|18:23:53.245] VM returned with error                   err="out of gas"
INFO [09-06|18:23:53.272] VM returned with error                   err="out of gas"
WARN [09-06|18:23:53.272] Served eth_sendTransaction               conn=[::1]:52630 reqid=19 t=663.744708ms err="gas required exceeds allowance (25000000)"
INFO [09-06|18:23:57.000] QBFT: handle block proposal request      address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state="Accept request"
INFO [09-06|18:24:02.001] QBFT: broadcast PRE-PREPARE message      address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state="Accept request" msg.code=18 msg.source=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 msg.round=0 msg.sequence=20 block.number=20 block.hash=0xdef0bc1906e9de819bb71b0f7156fc10a814da1f2af63f26d0118241b642cd69 payload=0xf90307f90301f902bb1480f902b6f902b1a0fc412f4584f7c1dc5c44e237ac9e096fd90ad1cca9daf8bf37e4dbd7f6f3650ba01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794d8dba507e85f116b1f7e231ca8525fc9008a6966a018afc13d0b8c45803acf3d55858843eded9d17314ea76e75020574efe7f384b2a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011484dee8a61e80846317741db8bbf8b9a0da83010a03846765746889676f312e31362e31358664617277696e0000000000f893946571d97f340c8495b661a823f2c2145ca47d63c2948157d4437104e3b8df4451a85f7b2438ef6699ff94b131288f355bc27090e542ae0be213c20350b76794b912de287f9b047b4228436e94b5b78e3ee1617194d8dba507e85f116b1f7e231ca8525fc9008a696694e36cbeb565b061217930767886474e3cde903ac594f512a992f3fb749857d758ffda1330e590fa915ec080c0a063746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365880000000000000000c0c0b841a5f1598e2c58ab7bd6c9b9304b71a4442e53c36b312a96c5353124c0653c28432fa486a4ed9a7ac95acd000dd080279e520dfae4c056969832f0def13c38652301c2c0c0
INFO [09-06|18:24:02.002] QBFT: handle PRE-PREPARE message         address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966
INFO [09-06|18:24:02.002] QBFT: accepted PRE-PREPARE message       address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966
INFO [09-06|18:24:02.002] QBFT: changed state                      address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 old.state="Accept request" new.state=Preprepared
INFO [09-06|18:24:02.002] QBFT: broadcast PREPARE message          address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state=Preprepared      msg.code=19 msg.source=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 msg.round=0 msg.sequence=20 payload=0xf867e31480a0def0bc1906e9de819bb71b0f7156fc10a814da1f2af63f26d0118241b642cd69b84165d84d58dcba4b0d5928d3d939c5294c1760cb052c2068660c68693cc16aa997206ea1f33f0b8efb2b53d97debb9d263408eae60aa980bcd1f645eaab3aefbca01
INFO [09-06|18:24:02.002] QBFT: handle PREPARE message             address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state=Preprepared      msg.code=19 msg.source=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 msg.round=0 msg.sequence=20 prepares.count=0 quorum=5
INFO [09-06|18:24:02.003] QBFT: handle PREPARE message             address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state=Preprepared      msg.code=19 msg.source=0xb912De287F9b047B4228436E94B5b78E3Ee16171 msg.round=0 msg.sequence=20 prepares.count=1 quorum=5
INFO [09-06|18:24:02.004] QBFT: handle PREPARE message             address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state=Preprepared      msg.code=19 msg.source=0xb131288F355BC27090E542aE0be213c20350B767 msg.round=0 msg.sequence=20 prepares.count=2 quorum=5
INFO [09-06|18:24:02.004] QBFT: handle PREPARE message             address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state=Preprepared      msg.code=19 msg.source=0xe36cbeB565B061217930767886474e3cDe903AC5 msg.round=0 msg.sequence=20 prepares.count=3 quorum=5
INFO [09-06|18:24:02.006] QBFT: handle PREPARE message             address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state=Preprepared      msg.code=19 msg.source=0xF512a992F3fb749857d758fFDa1330e590fa915E msg.round=0 msg.sequence=20 prepares.count=4 quorum=5
INFO [09-06|18:24:02.006] QBFT: received quorum of PREPARE messages address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state=Preprepared      msg.code=19 msg.source=0xF512a992F3fb749857d758fFDa1330e590fa915E msg.round=0 msg.sequence=20 prepares.count=5 quorum=5
INFO [09-06|18:24:02.006] QBFT: changed state                      address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 old.state=Preprepared      new.state=Prepared
INFO [09-06|18:24:02.006] QBFT: broadcast COMMIT message           address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state=Prepared         msg.code=20 msg.source=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 msg.round=0 msg.sequence=20 payload=0xf8abf8661480a0def0bc1906e9de819bb71b0f7156fc10a814da1f2af63f26d0118241b642cd69b841b948adc8483873af00de19bca6f39c25d3be0f672328d8974d55a6216ab15e691d7099a182cc673683cdae24fce80982156dc3f69b067115da2e14fcda84dea201b841f5ab107cf6c384167bf6fa4f2c67266be0c805ca0f47b32e819769f7145c529d6a8b5fa569ed9cda809ba2b7cdc4ec06d62e999201725c6cbd29fcc5fc554ba201
INFO [09-06|18:24:02.006] QBFT: handle COMMIT message              address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state=Prepared         msg.code=20 msg.source=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 msg.round=0 msg.sequence=20 commits.count=0 quorum=5
INFO [09-06|18:24:02.010] QBFT: handle COMMIT message              address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state=Prepared         msg.code=20 msg.source=0xF512a992F3fb749857d758fFDa1330e590fa915E msg.round=0 msg.sequence=20 commits.count=1 quorum=5
INFO [09-06|18:24:02.011] QBFT: handle COMMIT message              address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state=Prepared         msg.code=20 msg.source=0x6571D97f340c8495B661a823F2C2145cA47D63c2 msg.round=0 msg.sequence=20 commits.count=2 quorum=5
INFO [09-06|18:24:02.012] QBFT: handle COMMIT message              address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state=Prepared         msg.code=20 msg.source=0xb912De287F9b047B4228436E94B5b78E3Ee16171 msg.round=0 msg.sequence=20 commits.count=3 quorum=5
INFO [09-06|18:24:02.013] QBFT: handle COMMIT message              address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state=Prepared         msg.code=20 msg.source=0x8157D4437104e3B8dF4451a85F7B2438ef6699FF msg.round=0 msg.sequence=20 commits.count=4 quorum=5
INFO [09-06|18:24:02.013] QBFT: received quorum of COMMIT messages address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 state=Prepared         msg.code=20 msg.source=0x8157D4437104e3B8dF4451a85F7B2438ef6699FF msg.round=0 msg.sequence=20 commits.count=5 quorum=5
INFO [09-06|18:24:02.013] QBFT: changed state                      address=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 current.round=0 current.sequence=20 old.state=Prepared         new.state=Committed
INFO [09-06|18:24:02.013] BFT: block proposal committed            author=0xd8Dba507e85F116b1f7e231cA8525fC9008A6966 hash=def0bc..42cd69 number=20
INFO [09-06|18:24:02.013] Successfully sealed new block            number=20 sealhash=def0bc..42cd69 hash=def0bc..42cd69 elapsed=9.842s
INFO [09-06|18:24:02.013] 🔨 mined potential block                  number=20 hash=def0bc..42cd69

Am I missing something?

a = eth.accounts[0]
web3.eth.defaultAccount = a;

// abi and bytecode generated from simplestorage.sol:
// > solcjs --bin --abi simplestorage.sol
var abi = [
	{
		"inputs": [
			{
				"internalType": "uint256",
				"name": "num",
				"type": "uint256"
			}
		],
		"name": "doLoops",
		"outputs": [],
		"stateMutability": "nonpayable",
		"type": "function"
	},
	{
		"inputs": [],
		"name": "retrieve",
		"outputs": [
			{
				"internalType": "uint256",
				"name": "",
				"type": "uint256"
			}
		],
		"stateMutability": "view",
		"type": "function"
	},
	{
		"inputs": [
			{
				"internalType": "uint256",
				"name": "num",
				"type": "uint256"
			}
		],
		"name": "store",
		"outputs": [],
		"stateMutability": "nonpayable",
		"type": "function"
	}
];

var bytecode = "0x608060405234801561001057600080fd5b50610228806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80631db71ffb146100465780632e64cec1146100625780636057361d14610080575b600080fd5b610060600480360381019061005b91906100fd565b61009c565b005b61006a6100d5565b6040516100779190610139565b60405180910390f35b61009a600480360381019061009591906100fd565b6100de565b005b60005b818110156100d1576000808154809291906100b99061015e565b919050555080806100c99061015e565b91505061009f565b5050565b60008054905090565b8060008190555050565b6000813590506100f7816101db565b92915050565b600060208284031215610113576101126101d6565b5b6000610121848285016100e8565b91505092915050565b61013381610154565b82525050565b600060208201905061014e600083018461012a565b92915050565b6000819050919050565b600061016982610154565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561019c5761019b6101a7565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600080fd5b6101e481610154565b81146101ef57600080fd5b5056fea26469706673582212200d0c4ff652a5d407e8b61a6f0682597d99d0c2ad8e3056d498b782598232f58e64736f6c63430008070033";

var simpleContract = web3.eth.contract(abi);
var simple = simpleContract.new({from:web3.eth.accounts[0], data: bytecode, gas: 0x47b760}, function(e, contract) {
	if (e) {
		console.log("err creating contract", e);
	} else {
		if (!contract.address) {
			console.log("Contract transaction send: TransactionHash: " + contract.transactionHash + " waiting to be mined...");
		} else {
			console.log("Contract mined! Address: " + contract.address);
			console.log(contract);
			simple.doLoops(100000000000000000000);
		}
	}
});

source of contract

// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.7.0 <0.9.0;

/**
 * @title Storage
 * @dev Store & retrieve value in a variable
 * @custom:dev-run-script ./scripts/deploy_with_ethers.ts
 */
contract Storage {

    uint256 number;

    function doLoops(uint256 num) public {
        for (uint256 i = 0; i < num; i++) {
            number++;
        }
    }

    /**
     * @dev Store value in variable
     * @param num value to store
     */
    function store(uint256 num) public {
        number = num;
    }

    /**
     * @dev Return value 
     * @return value of 'number'
     */
    function retrieve() public view returns (uint256){
        return number;
    }
}

@vsmk98
Copy link
Contributor Author

vsmk98 commented Sep 9, 2022

Hi @baptiste-b-pegasys,
Adding additional details below:
My smart contract code is as below:

pragma solidity ^0.8.4;

contract RunLoop {
    uint public loopValue;

    event LoopComplete(uint _loopValue);

    constructor(uint initVal) {
        loopValue = initVal;
    }

    function run(uint x) public {
        uint value = 0;
        for (uint i = 0; i < x; i++) {
            value += i;
        }
        loopValue = value;
        emit LoopComplete(loopValue);
    }

    function get() view public returns (uint retVal) {
        return loopValue;
    }
}

I had brought up my nodes with --miner.gastarget 100000000000 --miner.gaslimit 100000000000 and a block period of 2 seconds:

      "istanbul": {
        "epoch": 30000,
        "blockperiodseconds": 2,
        "policy": 0,
        "ceil2Nby3Block": 0,
        "testQBFTBlock": 0
      }
    },

After deploying the contract, I was calling the run function with the below input

x=l.run(100000000, {from: eth.accounts[0], gas: "0xD0EA0E40"})

This transaction will be in pending status for quite sometime and eventually crash the node. I just retried the steps and could reproduce this at my end.

> x=l.run(100000000, {from: eth.accounts[0], gas: "0xD0EA0E40"})
"0x7afd50ad6458a3d44cadb73b48afa49e03cf22a1fa369c3bf872946f915ebf14"
> txpool.status
{
  pending: 1,
  queued: 0
}
> txpool.status
{
  pending: 1,
  queued: 0
}
> txpool.status
{
  pending: 1,
  queued: 0
}
> txpool.status
{
  pending: 1,
  queued: 0
}
> txpool.status
{
  pending: 1,
  queued: 0
}
> txpool.status
{
  pending: 1,
  queued: 0
}
> txpool.status
{
  pending: 1,
  queued: 0
}
> txpool.status
{
  pending: 1,
  queued: 0
}
> txpool.status
{
  pending: 1,
  queued: 0
}
> txpool.status
{
  pending: 1,
  queued: 0
}
> txpool.status
Error: dial unix qdata/dd1/geth.ipc: connect: connection refused
	at web3.js:6355:37(47)
	at get (web3.js:6255:66(14))

>

Please note that one of the node crashes. In first few runs it was always the node from which I had submitted transaction. In another run it was a different node. When the transaction is pending the block number does not increase at the block period interval.

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 a pull request may close this issue.

2 participants