-
Notifications
You must be signed in to change notification settings - Fork 11
Increase retry to 200 is not compact key; Add regen key when not comp… #10
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,4 @@ | ||
| {"1.1.0", | ||
| [{<<"clique">>, | ||
| {git,"https://github.com/helium/clique.git", | ||
| {ref,"e327ba3058004c32dd2166416a60497ba87933af"}}, | ||
| 0}, | ||
| {<<"cuttlefish">>, | ||
| {git,"https://github.com/helium/cuttlefish.git", | ||
| {ref,"8672838e8f4ef61602aee6e4ff97ec9be54031dc"}}, | ||
| 1}, | ||
| {<<"ecc508">>, | ||
| {git,"https://github.com/helium/ecc508.git", | ||
| {ref,"91d20ce3caf4f0567e95f71926d03ad3dcc2061d"}}, | ||
| 0}, | ||
| {<<"ecc_compact">>, | ||
| {git,"https://github.com/helium/ecc_compact.git", | ||
| {ref,"a4508cbfa31f7c6f1a5b4e0391c1cc7d185ae0b1"}}, | ||
| 0}, | ||
| {<<"erl_base58">>,{pkg,<<"erl_base58">>,<<"0.0.1">>},0}, | ||
| {<<"erlang_ale">>, | ||
| [{<<"erlang_ale">>, | ||
| {git,"https://github.com/helium/erlang_ale", | ||
| {ref,"9db629ebf946e9b32a4dd5efefea3d16c3f808b9"}}, | ||
| 1}, | ||
| {<<"getopt">>,{pkg,<<"getopt">>,<<"1.0.1">>},2}, | ||
| {<<"goldrush">>,{pkg,<<"goldrush">>,<<"0.1.9">>},1}, | ||
| {<<"lager">>,{pkg,<<"lager">>,<<"3.6.7">>},0}]}. | ||
| [ | ||
| {pkg_hash,[ | ||
| {<<"erl_base58">>, <<"37710854461D71DF338E73C65776302DB41C4BAB4674D2EC134ED7BCFC7B5552">>}, | ||
| {<<"getopt">>, <<"C73A9FA687B217F2FF79F68A3B637711BB1936E712B521D8CE466B29CBF7808A">>}, | ||
| {<<"goldrush">>, <<"F06E5D5F1277DA5C413E84D5A2924174182FB108DABB39D5EC548B27424CD106">>}, | ||
| {<<"lager">>, <<"2FBF823944CAA0FC10DF5EC13F3F047524A249BB32F0D801B7900C9610264286">>}]} | ||
| ]. | ||
| {ref,"07e10e656693f07a0d577f3651e76e52680c3768"}}, | ||
| 0}]. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -276,7 +276,11 @@ check_miner_key(Pid) -> | |
| {ok, PubKey} -> | ||
| case ecc_compact:is_compact(PubKey) of | ||
| {true, _} -> ok; | ||
| false -> {error, not_compact} | ||
| false -> | ||
| case gen_compact_key(Pid, ?KEY_SLOT) of | ||
| {ok, _} -> ok; | ||
| {error, Error} -> {error, Error} | ||
| end | ||
| end; | ||
| {error, Error} -> | ||
| {error, Error} | ||
|
|
@@ -288,7 +292,7 @@ check_miner_key(Pid) -> | |
| %% | ||
|
|
||
| gen_compact_key(Pid, Slot) -> | ||
| gen_compact_key(Pid, Slot, 100). | ||
| gen_compact_key(Pid, Slot, 200). | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you have to double the number of retries to 200? That seems like there's an issue with the part you are using if it needs this many retries to generate a private key
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As test by my customer, they find many failure chip, which can't pass the private key testing as not compact key. So we can increase to retry 200 times to gen a compact private key.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This usually implies a hardware integration issue. We used to have the same problems on the original Helium hotspot and it turned out to be either a badly configured driver or i2c bus issues |
||
|
|
||
| gen_compact_key(_Pid, _Slot, 0) -> | ||
| {error, compact_key_create_failed}; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem correct.. check_miner_key is not there to actually generate the private key. It's just there to validate that there is a public compact key in a slot. There is a separate command to generate the private key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If check the key not compact, it will always fail when run test. We can't run provision again to re-gen the private key any more. So this code can fix it by re-gen private key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the right assumption. Check_key_configuration should only check that the chip was already correctly configured. If it returns an error on is_compact it means it was not provisioned/configured correctly in a previous step