Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 17:38

    cameel on multicore-soltest-sh

    fixup! [TMP] Use the split scri… (compare)

  • 17:36
    bshastry commented #12169
  • 17:30

    cameel on optimize-ci-resource-class-medium

    [DEBUG] Switch to large resourc… (compare)

  • 17:30

    cameel on optimize-ci-resource-class-small

    [DEBUG] Switch to large resourc… (compare)

  • 17:22

    cameel on multicore-soltest-sh

    [TMP] Helper script for splitti… [TMP] Use the split script to p… (compare)

  • 16:53
    Marenz synchronize #12199
  • 16:53

    Marenz on expose-parsingAndImporting

    Evaluate absolute paths for imp… (compare)

  • 16:21
    chriseth synchronize #12205
  • 16:21

    chriseth on optimizeextocedsizecheck

    Add test for extcodesize check. (compare)

  • 16:08
    DavidRomanovizc review_requested #12177
  • 16:06
    hrkrshnn commented #12169
  • 16:06
    hrkrshnn commented #12169
  • 16:00
    hrkrshnn commented #12169
  • 15:58
    chriseth synchronize #12205
  • 15:58

    chriseth on optimizeextocedsizecheck

    Skip extcodesize check if retur… Update Changelog.md Co-authore… Update tests and 1 more (compare)

  • 15:41
    chriseth synchronize #12205
  • 15:41

    chriseth on optimizeextocedsizecheck

    Update libsolidity/codegen/Expr… (compare)

  • 15:41

    chriseth on optimizeextocedsizecheck

    Update libsolidity/codegen/ir/I… (compare)

  • 15:41
    chriseth synchronize #12205
  • 15:03
    hrkrshnn commented #12196
StackenBotten
@stackenbotten
✅ Nightly job t_ems_test_ext_colony succeeded on develop. Please see build #887667 for details.
❌ Nightly job t_ubu_ossfuzz failed on develop. Please see build #887671 for details.
chriseth
@chriseth:matrix.org
[m]
hrkrshnn: good call about testing the debug data, it actually does not work :)
I did not add tests because I thought it would be difficult to test, but we actually have a framework in place
hrkrshnn
@hrkrshnn:matrix.org
[m]
Also two edge cases would be calls from inside constructors. Maybe some weird use of selfdestruct?
chriseth
@chriseth:matrix.org
[m]
not sure what you mean
hrkrshnn
@hrkrshnn:matrix.org
[m]
Calling a contract during construction will fail during extcodesize check.
But I don't think there is a way to make it return data. So we're probably safe.
chriseth
@chriseth:matrix.org
[m]
ok, added some tests
Marian
@bleier116_twitter

Hello everybody, I am very new in Solidity and also in JavaScript. I finished the CryptoZombies tutorial (maybe you know that) and now I am just playing around a bit to display some things via Javascript.

I have the following problem: I have an array where some parameters as "name" "age" etc are stored and a mapping where it is stored which array entry belongs to which user. So there are more than one entry per address possible.

My problem now is, if I want to display it and I use a "while"-pattern, the while pattern is finished before the results from the smart contract querys are there. And also the results from the smart contract array are not always available in the order requested. so an example:

according to the mapping array entry 0, 3 and 4 belong to some specific address.

so i implemented a while pattern and requested entrys 0, 3 and 4 of the array in the contract but results got in order 3, 0, 4. From MySQL and PHP what I learned several years ago the results are always presented in the order you wanted them. Any suggestions?

cameel
@cameel:matrix.org
[m]
@bleier116_twitter: This is a channel about Solidity compiler development. For questions about solidity contracts and dapps please try #solidity instead.
Marian
@bleier116_twitter
alright, thank you :) I am sorry
cameel
@cameel:matrix.org
[m]
chriseth: I see that you approved ethereum/solidity#12177 but just to be doubly sure - we are ok with disabling metadata in all syntax tests?
I can't really see many downsides but I saw for example that in semantic tests it's disabled only in some cases (gas tests IIRC?) so maybe there are some good reasons to want it.
1 reply
Pretty simple PR to review without any dependencies: ethereum/solidity#12187
Just updates README and changes branches and repo URLs.
chriseth
@chriseth:matrix.org
[m]
but I mean yeah, maybe disable it as a switch?
but I'm actually unsure on this and would delegate to your judgment
StackenBotten
@stackenbotten
❌ Nightly job t_ubu_ossfuzz failed on optimize-ci. Please see build #888355 for details.
❌ Nightly job t_ubu_ubsan_clang_soltest failed on optimize-ci-resource-class-small. Please see build #888417 for details.
1 reply
cameel
@cameel:matrix.org
[m]
If you don't see any downsides either then I my opinion is it should be safe.
The only situations I can think of that it would affect are rare corner cases like this one where we rely on the size of the binary.
And we can restore that and add the switch if we run into something were we do want the metadata.
BTW, please ignore the nightly messages above - I'm doing test CI runs to see which jobs can benefit from different machine sizes. I added nightly jobs to the PR run to test them too but looks like I forgot to disable their notifications :)
StackenBotten
@stackenbotten
❌ Nightly job t_ubu_ossfuzz failed on optimize-ci-resource-class-xlarge. Please see build #888422 for details.
chriseth
@chriseth:matrix.org
[m]
I just realized that in CMAKE_BUILD_TYPE=, the solc binary has 400 MB...
1 reply
chriseth
@chriseth:matrix.org
[m]
@bshastry: can you explain why you think ethereum/solidity#12061 is different from the already documented behaviour for modifiers?
bshastry
@bshastry:matrix.org
[m]

Because the next test (expected behavior) passes, and the test after that (same expected behavior) fails

pragma solidity >= 0.0.0;
contract C0 {
  modifier m0(uint i1)
  {
        _;
  }
  function IRReturnsZero() external m0(o0++) m0(o0++) returns (uint o0, uint o1)
  {
  }
}
// ====
// compileViaYul: true
// ----
// IRReturnsZero() -> 0, 0
pragma solidity >= 0.0.0;
contract C0 {
  modifier m0(uint i1)
  {
        _;
  }
  function IRReturnsTwo() external m0(o0++) m0(o0++) returns (uint o0)
  {
  }
}
// ====
// compileViaYul: true
// ----
// IRReturnsTwo() -> 0

The latter test returns 2 instead of 0 and that's the bug

chriseth
@chriseth:matrix.org
[m]
the only differenec is the second return variable?
1 reply
chriseth
@chriseth:matrix.org
[m]
ok, this is really weird
and you can't use the optimizer to lighten this up because it will just tell you "it returns 0" or "it returns 2" ;)
1 reply
I'm looking at the IR, but the non-optimized code is too complicated and the optimized code is too simple :)
1 reply
bshastry
@bshastry:matrix.org
[m]

Here's another example where some garbage value is being returned (instead of zero address)

contract C0 {
  modifier m0()
  {
    _;
  }
  struct St0 {
    bool el0;
    string el1;
    address el2;
  }
  type T0 is bool;
  function f0() external m0 returns(C0.St0 memory o0,C0.T0 o1)
  {
    return (o0, C0.T0.wrap(true));
  }
  function g() external returns (address)
  {
    (C0.St0 memory r1, C0.T0 r2) = this.f0();
    return r1.el2;
  }
}
// ====
// compileViaYul: true
// ----
// f0() -> 64, true, 0x00, 0x60, 0, ""
// g() -> 0

g() should return 0 but it returns 0xe0

chriseth
@chriseth:matrix.org
[m]
it's "empty build type"
bshastry: I actually don't see why it should not return 2 in both cases
1 reply
but yeah, the optimizer claims zero
bshastry: oh' I see it now
I think that's an actual codegen error
            function fun_IRReturnsZero_23_inner(_13, _14) -> var_o0_18, var_o1_20 {
                var_o1_20 := _13
                var_o1_20 := _14
            }
the first assignment should be to _18 instead of _20
good find!
chriseth
@chriseth:matrix.org
[m]
That was really good, I was so close to just closing the issue :)
hrkrshnn
@hrkrshnn:matrix.org
[m]
bshastry: About ethereum/solidity#12169 and other related bugs. There seems to be a lot of issues related to keccak nowadays, especially keccak running out of gas. What changed in the fuzzer?
1 reply
hrkrshnn
@hrkrshnn:matrix.org
[m]

It should also be noted that SELFDESTRUCT (0xff) has no immediate effect on nonce or code, thus a contract cannot be destroyed and recreated within one transaction.

From https://eips.ethereum.org/EIPS/eip-1014. What does that mean?

contract C {
    function f() external {
        selfdestruct(payable(msg.sender));
    }
    function g() external returns (bool) {
        return true;
    }
}
contract Test {
    C c = new C{salt: bytes32("test")}();
    function test() external returns (bool) {
        c.f();
        c = new C{salt: bytes32("test")}();
        c.g();
        return true;
    }
}
// ====
// compileViaYul: also
// ----
// test() -> true
It seems possible?
bshastry
@bshastry:matrix.org
[m]
btw, the linked keccak issue is a legitimate one right? Even if we assume at least one loop iteration, it is not necessary that the keccak path inside the loop body is executed, right?
hrkrshnn
@hrkrshnn:matrix.org
[m]
It's complicated. keccak does not have any side effects (assuming no msize), so you can evaluate it at any point in that sense, except for gas considerations.
bshastry
@bshastry:matrix.org
[m]
I see. I assumed gas consideration is part of side-effects. That's not a technical point though
bshastry
@bshastry:matrix.org
[m]
btw, I don't fully understand why the keccak in for-post-block would be moved out of the loop in the following example
contract C0 {
  function f1() external returns (bytes memory o0)
  {
     assembly
     {
       {
          for { o0 := selfbalance() } o0
              {
                o0 := keccak256(0, 1155939646350332)
              } {}
        }
     }
  }
}
chriseth
@chriseth:matrix.org
[m]
since there is no "continue", body and post are the sa.
bshastry
@bshastry:matrix.org
[m]
I see! So there is something like let tmp = keccak(...) for { o0 := selfbalance() } o0 { o0 := tmp} {} happening
1 reply
and because this is not happening for legacy, only IR runs out of gas
hrkrshnn
@hrkrshnn:matrix.org
[m]
It'll take multiple steps to get there, but that's what's happening in the end