Giter Site home page Giter Site logo

Comments (9)

macfarla avatar macfarla commented on September 21, 2024

@matthew1001 are you able to take a look at this one?

from besu.

matthew1001 avatar matthew1001 commented on September 21, 2024

Yes sure, I'll assign it to myself and take a look

from besu.

v0dev avatar v0dev commented on September 21, 2024

Hey @matthew1001 , were you able to check this issue?

from besu.

matthew1001 avatar matthew1001 commented on September 21, 2024

I should be able to take a look today

from besu.

matthew1001 avatar matthew1001 commented on September 21, 2024

Could you include your config file and/or CLI args please @v0dev ?

from besu.

matthew1001 avatar matthew1001 commented on September 21, 2024

I'm not seeing the same StringIndexOutOfBoundsException error you are seeing, but the validator contract definitely isn't working.

I've tried deploying the Besu sample contract https://github.com/Consensys/validator-smart-contracts/blob/main/contracts/allowlist/ValidatorSmartContractAllowList.sol which seems to work fine. If I do a test invocation of getValidators() on that contract once the node has started I correctly get back

output=0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000009a6d82ef3912d5ab60473124bccd2f2a640769d700000000000000000000000065463bf6268e5cc409b6501ec846487b935a1446,

which is the validator list 0x9A6d82Ef3912d5aB60473124BCCd2f2A640769D7,0x65463BF6268e5cC409b6501eC846487B935A1446.

However, invoking getValidators() on your contract after starting the node returns a large data payload (it looks like it might be returning the code of the contract itself? At least it's a data payload very similar to the bytecode of the contract:

output=0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063b7ab4db514610030575b600080fd5b61003861004e565b6040516100459190610321565b60405180910390f35b60606000600467ffffffffffffffff81111561006d5761006c610343565b5b60405190808252806020026020018201604052801561009b5781602001602082028036833780820191505090505b5090507368b9adc0556f86a122b12aa1e8af8951362ca676816000815181106100c7576100c6610372565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073dc398a72b509053a77f828067471d0f71964c7a68160018151811061012a57610129610372565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050730b60f4774e6df60833813a3853f2f2341d8d38608160028151811061018d5761018c610372565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250507308134eea5b10594e52c11dc0198ab95c5e0b328e816003815181106101f0576101ef610372565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508091505090565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006102888261025d565b9050919050565b6102988161027d565b82525050565b60006102aa838361028f565b60208301905092915050565b6000602082019050919050565b60006102ce82610231565b6102d8818561023c565b93506102e38361024d565b8060005b838110156103145781516102fb888261029e565b9750610306836102b6565b9250506001810190506102e7565b5085935050505092915050565b6000602082019050818103600083015261033b81846102c3565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea2646970667358221220e6fe023edcd49585727277945693024f0af34bd4ca8dae3e5de042d9347af14764736f6c63430008140033

Your contract itself, if manually deployed and invoked, does appear to work as expected. I'm wondering if it's something specific to do with the way Besu deploys a contract from the genesis file.

Regarding the shanghai/non-shanghai difference, if I don't enable shanghai on my chain I get the same INVALID_OPERATION. If I do enable it then I see the issues described above. I think this is as expected but I notice your genesis has shanghaiTime set. Did you have shanghaiTime set when you were seeing INVALID_OPERATION? Could you confirm exactly which version of Besu this is all using?

from besu.

matthew1001 avatar matthew1001 commented on September 21, 2024

I've made a bit more progress, in as much as if I use Hardhat to compile your contract into bytecode and use that in the genesis.json, it works perfectly fine.

If I use remix to compile your contract and put the bytecode into the genesis.json, it doesn't work.

I've tried several combinations of compiler version and EVM version in remix and cannot make your contract, or the sample contract https://github.com/Consensys/validator-smart-contracts/blob/main/contracts/allowlist/ValidatorSmartContractAllowList.sol work. Remix does have several places where it outputs bytecode. Perhaps they differ slightly?

Could you try compiling with Hardhat and see if it works for you? If it does, I think the issue may be around pulling the bytecode out of remix.

from besu.

v0dev avatar v0dev commented on September 21, 2024

Hey @matthew1001 , I will using hardhat instead of Remix , and let you know!

from besu.

matthew1001 avatar matthew1001 commented on September 21, 2024

I suggest closing this for now. Happy for it to be reopened if there's an issue in the way Besu is treating the bytecode.

from besu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.