Closed UnitylChaos closed 4 years ago
I'm trying to use the library, and seem to have encountered an infinite loop when calling handle_input on an instance of QueueingHoneyBadger with a single validator, in particular in the propose function. https://github.com/poanetwork/hbbft/blob/4857b7f9c7a0f513caca97c308d352c6a77fe5c2/src/queueing_honey_badger/mod.rs#L341-L353
handle_input
The can_propose function keeps returning true even after the step is extended with the contents of the current queue. It seems that the items proposed are not removed from the queue, and this is intended behavior, but the dyn_hb.has_input() isn't returning true properly. https://github.com/poanetwork/hbbft/blob/4857b7f9c7a0f513caca97c308d352c6a77fe5c2/src/queueing_honey_badger/mod.rs#L333-L338
can_propose
dyn_hb.has_input()
This seems to be because the internal HoneyBadger instance in dyn_hb is setting has_input when proposing, but is then unsetting it and advancing the epoch during try_output_batches and QHB and DHB expect it to still be set. https://github.com/poanetwork/hbbft/blob/4857b7f9c7a0f513caca97c308d352c6a77fe5c2/src/honey_badger/honey_badger.rs#L88-L95
HoneyBadger
has_input
try_output_batches
https://github.com/poanetwork/hbbft/blob/4857b7f9c7a0f513caca97c308d352c6a77fe5c2/src/honey_badger/honey_badger.rs#L164-L185
Thank you for the analysis! Good catch! Could you take a look at #433 — that should fix it, I think?
I'm trying to use the library, and seem to have encountered an infinite loop when calling
handle_input
on an instance of QueueingHoneyBadger with a single validator, in particular in the propose function. https://github.com/poanetwork/hbbft/blob/4857b7f9c7a0f513caca97c308d352c6a77fe5c2/src/queueing_honey_badger/mod.rs#L341-L353The
can_propose
function keeps returning true even after the step is extended with the contents of the current queue. It seems that the items proposed are not removed from the queue, and this is intended behavior, but thedyn_hb.has_input()
isn't returning true properly. https://github.com/poanetwork/hbbft/blob/4857b7f9c7a0f513caca97c308d352c6a77fe5c2/src/queueing_honey_badger/mod.rs#L333-L338This seems to be because the internal
HoneyBadger
instance in dyn_hb is settinghas_input
when proposing, but is then unsetting it and advancing the epoch duringtry_output_batches
and QHB and DHB expect it to still be set. https://github.com/poanetwork/hbbft/blob/4857b7f9c7a0f513caca97c308d352c6a77fe5c2/src/honey_badger/honey_badger.rs#L88-L95https://github.com/poanetwork/hbbft/blob/4857b7f9c7a0f513caca97c308d352c6a77fe5c2/src/honey_badger/honey_badger.rs#L164-L185