-
Notifications
You must be signed in to change notification settings - Fork 241
#4394 Removed all HC Commitment code #4409
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
Conversation
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.
Looks good to me, some minor comments.
Also I suspect there is a bit too much removed in BTC/Doge HTTP clients - pinning will be creating/signing/posting transactions 🤔 Since we are supposed to support at least BTC we probably want to keep that?
@@ -8,15 +8,6 @@ | |||
|
|||
-module(aec_parent_connector). | |||
|
|||
%% Functionality: |
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.
You deleted all functionality comments, does that mean that the remaining code has no functionality at all?
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.
yes, dead code(rs) society is here.
Yes, A bunch of code that is very likely usable in pinning was removed
there. Unused methods were causing fails in dialyzer tests (at least that
was what it looked like). I will dig in Git history and reinsert once we
get to that point.
…On Mon, Sep 9, 2024 at 3:26 PM Hans Svensson ***@***.***> wrote:
***@***.**** commented on this pull request.
Looks good to me, some minor comments.
Also I suspect there is a bit too much removed in BTC/Doge HTTP clients -
pinning will be creating/signing/posting transactions 🤔 Since we are
supposed to support at least BTC we probably want to keep that?
------------------------------
In apps/aecore/src/aec_parent_connector.erl
<#4409 (comment)>:
> %%%=============================================================================
%%% Gen Server Callbacks
%%%=============================================================================
-spec init([any()]) -> {ok, #state{}}.
-init([ParentConnMod, FetchInterval, ParentHosts, NetworkId, SignModule, HCPCPairs, Recipient, Fee, Amount]) ->
- if is_integer(FetchInterval) ->
- erlang:send_after(FetchInterval, self(), check_parent);
- true -> ok
- end,
- CDetails =
- #commitment_details{ parent_network_id = NetworkId, %% TODO: assert all nodes are having the same network id
- sign_module = SignModule,
- recipient = Recipient,
- amount = Amount,
- fee = Fee
- },
+init([ParentConnMod, FetchInterval, ParentHosts, _NetworkId, _SignModule, HCPCPairs, _Recipient, _Fee, _Amount]) ->
Are you expecting to use these arguments for pinning or could they be
removed completely?
------------------------------
In apps/aecore/src/aec_parent_connector.erl
<#4409 (comment)>:
> + % if is_integer(FetchInterval) ->
+ % erlang:send_after(FetchInterval, self(), check_parent);
+ % true -> ok
+ % end,
Remove?
—
Reply to this email directly, view it on GitHub
<#4409 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIQDLIHJNIYX5FPP6B2S3DZVWOX3AVCNFSM6AAAAABN4PDECWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDEOBZHA4TQMBSGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Exactly :P
…On Mon, Sep 9, 2024 at 3:27 PM Thomas Arts ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In apps/aecore/src/aec_parent_connector.erl
<#4409 (comment)>:
> @@ -8,15 +8,6 @@
-module(aec_parent_connector).
-%% Functionality:
You deleted all functionality comments, does that mean that the remaining
code has no functionality at all?
—
Reply to this email directly, view it on GitHub
<#4409 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIQDLO7NK5RC27ZBTCIXZLZVWO5LAVCNFSM6AAAAABN4PDECWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDEOBZHEYTQOBYHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@@ -7,9 +7,6 @@ | |||
-export([get_latest_block/2, |
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.
My feeling is that this whole module can be deleted if we don't care about commitments. What else did it offer that is not in the standard http client software??
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.
For similarity to bitcoin and dodge module, we could keep it, of course. We still need to be able to see what epoch the parent chain is in
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.
It's just a wrapper but since it is a wrapper that gets dynamically selected (ae, btc, doge) there needs to be one for aeternity as well. I kind-of like this way, so I think it should be kept.
Either (temporarily) export the functions, or keep them commented out. I think the first is preferred. |
apps/aehttp/src/aehttpc_doge.erl
Outdated
catch E:R:S -> | ||
{error, {E, R, S}} | ||
end; | ||
% getblock(NodeSpec, Seed, Hash, 2) -> |
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.
Should we not be able to get a block here?
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.
It's not used anywhere, and is only called with (,,_,1) internally, but I kept it because it felt, I dunno, prudent(?)
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.
@ThomasArts the problem with that particular method (head) is that it fails dialyzer:
The pattern <NodeSpec, Seed, Hash, 2> can never match the type <,,_,1>
That is why I edited it out What to you suggest I do with it? Expose it directly, write additional wrappers for get_latest_blocks?
apps/aehttp/src/aehttpc_doge.erl
Outdated
catch E:R -> | ||
{error, {E, R}} | ||
end. | ||
% -spec getrawtransaction(aehttpc:node_spec(), binary()) -> {ok, binary()} | {error, term()}. |
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.
Possibly useful as well when dealing with dodge as parent chain?
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.
Again, I can reintroduce all the pruned code from these aehttpc modules (or whatever they are called) and export them. then these would make more sense. And not trigger build fails I suppose?
@@ -10,7 +10,8 @@ | |||
-define(CHILD_CHAIN_NETWORK_ID, <<"hc_network_id">>). | |||
-define(SIGN_MODULE, aec_preset_keys). | |||
|
|||
ae_sim_test_() -> | |||
% removed as test, should/could be removed altogether, same goes for btc version below. | |||
ae_sim_test_rem() -> |
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.
test_
as ending of a function name has a specific meaning. Cannot just at rem
after it without changing that meaning. See eunit documentation for detail
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.
I know, this leaves that particular test out of the suite. So here I could keep that code, in case it was actually testing something besides commitments. But perhaps it is not?
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.
So, my question is if the two "_rem" methods (that are left in the code but not invoked as tests...) actually do anything but commitment testing, or of they can be removed altogether?
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.
They do "test" that indeed one can talk to the parent BTC or parent Dodge. But My proposal is to just delete these two tests completely instead of renaming them _rem
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.
You want to write very similar tests as soon as you add pinning, right?
- removed non-needed args in parent_connector:startlink - various cleanups
%% - To BTC/Doge parent - signed by the external bitcoind/dogecoind hosted wallet | ||
%% Functionality | ||
%% Holds parent chain connection state and contains various utilities for | ||
%% interacting withvthe PC. Wraps parent implementation specific stuff |
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.
%% interacting withvthe PC. Wraps parent implementation specific stuff | |
%% interacting with the PC. Wraps parent implementation specific stuff |
- added comments to explain "disabled" test methods, left the methods for future ref.
So, these worked on my build locally. Intermittent? Re-run? |
Removal of all HC Comittment code
This PR is supported by the Æternity Foundation