Closed crisdut closed 7 months ago
Very good work!
I think we need to get rid of old commands - I do not see the usecase for the fixed index. If someone needs one, it is just two instructions, one to load the fixed index into a register.
Today, only the UDA uses these two instructions with fixed indexes. I can change the code after rgb-core new release.
Can you pls re-work PR by not adding new operations and instead modifying existing ones?
Yes, I will make that!
Today, only the UDA uses these two instructions with fixed indexes. I can change the code after rgb-core new release.
Yes. But I will update the UDA script then
Today, only the UDA uses these two instructions with fixed indexes. I can change the code after rgb-core new release.
Yes. But I will update the UDA script then
Ok, sure. I reviewed the UDA script and I noticed the ldp
uses a fixed index too. I think it would be better to change the ldc
and ldp
to support register instead of fixed indexes, right?
Yes, correct. We than can push constant number to a register and just add one instruction to the script in front of ldc
and ldp
Hi @dr-orlovsky,
I was thinking, ldc
and ldg
are equivalent operations, right?
Is this separation due to operations such as Genesis, Transition and Enxtension?
They are not. ldc
takes the contract global state, while ldg
takes operations's global state (which, with the only except of genesis operation is not ever equal to contract).
They are not.
ldc
takes the contract global state, whileldg
takes operations's global state (which, with the only except of genesis operation is not ever equal to contract).
Thanks for reply!
BTW, I finish the changes!
Can you pls re-do this PR against master
and not v0.11
branch so we have CI running?
Also can you please run cargo +nightly fmt --all
to remove the formatting changes which complicate the review?
Attention: Patch coverage is 0%
with 78 lines
in your changes are missing coverage. Please review.
Project coverage is 15.5%. Comparing base (
0716f0e
) to head (010603f
). Report is 3 commits behind head on master.
Files | Patch % | Lines |
---|---|---|
src/vm/op_contract.rs | 0.0% | 78 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
amazing stuff
Adding a global contract state seems to be very challenging and will require refactoring validation workflow: https://github.com/RGB-WG/rgb-core/pull/208
I propose to restrict this PR to the changes in already implemented instructions - and leave LdG
for v0.12
Adding a global contract state seems to be very challenging and will require refactoring validation workflow: #208
Great!
I propose to restrict this PR to the changes in already implemented instructions - and leave
LdG
for v0.12
I think you mean LdC
, because in the master branch this instruction is not implemented yet. Right?
I think you mean LdC, because in the master branch this instruction is not implemented yet. Right?
Yes
There were multiple issues so I decided to proof them by myself. Pls check the last three commitments
Sorry Maxim, I dont understand why they are issues, as I was using these registers from the beginning. Could you explain me?
List of things I have changed:
src_reg
was not modified, while the commands now accept a source regisgerLdF
was not changedldp
contained a errorMost of these things I proved in https://github.com/RGB-WG/rgb-core/pull/201/commits/8752e06f38321019c3256544f8b570dca302ce84, but in other commitments as well
Most of these things I proved in 8752e06, but in other commitments as well
Maxim, I think I found other issues, I will publish new commit.
Can you review, please?
Sure!
@crisdut why do you think we need this? Reg32
, Reg16
and Reg8
are just different bit-length for the registry index, it has nothing to do with a8/a16/a32
... The proposed commit breaks word alignment and adds "dummy" bits, which is unnecessary
@crisdut why do you think we need this?
Reg32
,Reg16
andReg8
are just different bit-length for the registry index, it has nothing to do witha8/a16/a32
... The proposed commit breaks word alignment and adds "dummy" bits, which is unnecessary
Oh Sorry, I understood that it was necessary to make these changes to follow with change in registers, but it really makes sense to avoid these changes.
I force-push it to remove it.
Tank you! I know this thing is confusing - I even did the same myself during work on this PR and then recalled that a16
doesn't imply Reg16
:)
Probably I have to rename types in AluVM
...
LGTM, but I need your approval on my changes, that I do not miss something - and then I will merge
I tested here and the code works.
ACK.
Hi @zoedberg @nicbus
Do you need any help getting this implementation started, or can we do the merge?
@crisdut could you please rebase this on top of master? otherwise it doesn't compile in rgb-lib
@crisdut could you please rebase this on top of master? otherwise it doesn't compile in rgb-lib
This is very strange, could you add here the reason for the problem.
It is worth remembering that as we changed the AluVM instructions, we also need to update the rgb-schemata as well, as all instructions that used fixed indexes now use registers.
It is worth remembering that as we changed the AluVM instructions, we also need to update the rgb-schemata as well, as all instructions that used fixed indexes now use registers.
If you prefer, I can open the PR containing the changes and then you can test it with the two updated crates. What do you think?
@crisdut I think the reason that we break the AluVM compatibility, this first we need to update schemata with a different code
@crisdut I think the reason that we break the AluVM compatibility, this first we need to update schemata with a different code
Yes, I believe that's exactly what it is.
But we need to not only change the rgb-schemata
, but also the rgb-std
, as the size of the inputs in the operations was changed from tiny to small (see here), therefore, the transitions in the rgb-std need to be modified (but specifically, here). Right?
BTW,
@zoedberg I created two draft PRs, please see:
Could you check if the problem persists with these PRs?
If yes, please post the error log in the thread.
Hope this helps
Right?
Correct
@crisdut I've patched the 2 PRs and now it compiles. I've ran rgb-lib's test suite and everything works good so I think we can merge your PRs.
Description
This PR intent:
cng
andcnc
.lds
andldg
with registers [1].cnp
,cns
,cng
andcnc
[1] Depends: