Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

web3js 4.x RC upgrade#6013

Closed
nikoulai wants to merge 13 commits into
ConsenSys-archive:developfrom
nikoulai:nikos/web3js-4.x-upgrade
Closed

web3js 4.x RC upgrade#6013
nikoulai wants to merge 13 commits into
ConsenSys-archive:developfrom
nikoulai:nikos/web3js-4.x-upgrade

Conversation

@nikoulai

@nikoulai nikoulai commented May 3, 2023

Copy link
Copy Markdown

web3js 4.x

@jdevcs

jdevcs commented May 3, 2023

Copy link
Copy Markdown

Thanks @nikoulai .
@haltman-at @eggplantzzz need your feedback in this PR ,
and also could you trigger tests in CI. Thanks

Comment thread packages/artifactor/test/contracts.js
Comment thread packages/codec/docs/tsconfig.json
Comment thread packages/codec/lib/abi-data/allocate/index.ts
Comment thread packages/config/package.json
Comment thread packages/contract-tests/test/abiV2.js
Comment on lines -164 to +168
assert(error.message.includes("intrinsic gas too low"));
// assert(error.innerError.message.includes("intrinsic gas too low"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out line

Comment thread packages/contract-tests/test/deploy.js
Comment thread packages/contract-tests/test/deploy.js
Comment thread packages/contract-tests/test/deploy.js
Comment on lines -268 to +277
it("overrides 50 blocks err / return a usable instance", async function () {
//todo web3js-migration fix test
it.skip("overrides 50 blocks err / return a usable instance", async function () {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unhandled TODO

Comment on lines +315 to +317
//todo web3js-migration fix test
it.skip(
"overrides gateway tx propagation delay err / return a usable instance",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unhandled TODO

Comment thread packages/contract-tests/test/errors.js
Comment on lines -151 to +152
it("validates method arguments for .sends", async function () {
//todo web3js-migration remove skip
it.skip("validates method arguments for .sends", async function () {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unhandled TODO

Comment thread packages/contract-tests/test/errors.js
if (!handlers.ignoreTimeoutError(context, error)) {
context.promiEvent.eventEmitter.emit("error", error);
this.removeListener("error", handlers.error);
this.off("error", handlers.error);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't removeListener work here? What was the issue?

Comment on lines -20 to +19
return web3Utils.toBN(val);
return new BN(val);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI to Truffle team, we no longer use bignumber.js or bn.js, just BigInts

Comment on lines -37 to +40
return web3Utils.isBN(val) || web3Utils.isBigNumber(val);
//todo web3js-migration check if this is sufficient
return BN.isBN(val);
// || web3Utils.isBigNumber(val);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unhandled TODO

Comment thread packages/contract/lib/utils/index.js
Comment thread packages/contract/webpack.config.js
Comment thread packages/dashboard-message-bus-e2e-test/package.json
Comment thread packages/db-kit/src/cli/decodeTransaction/useDecodedTransaction.ts
// and include anything mentioned in receipt logs
for (const { address } of receipt.logs) {
addresses.push(address);
addresses.push(address as string);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the type of address? It should be a string by default

Comment thread packages/db-kit/src/cli/menu/Menu.tsx
Comment thread packages/db/src/index.ts
Comment thread packages/db/src/meta/id/hash.ts
Comment thread packages/db/src/meta/process/run.ts
Comment thread packages/db/src/network/index.ts
Comment thread packages/db/src/network/test/index.spec.ts
Comment thread packages/db/src/network/test/mockProvider.ts
Comment thread packages/db/src/network/test/mockProvider.ts
Comment thread packages/db/src/network/test/mockProvider.ts
Comment thread packages/db/src/project/test/assignNames.spec.ts
Comment thread packages/db/src/resources/projects/test/contractInstances.spec.ts
Comment thread packages/db/src/test/source.spec.ts
Comment thread packages/decoder/tsconfig.json
Comment thread packages/deployer/ens.js
Comment thread packages/deployer/ens.js
Comment on lines +155 to +156
const ZERO_NODE =
"0x0000000000000000000000000000000000000000000000000000000000000000";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should remove if "0x0" suffices

eventArgs.error = err.error || err;
const message = await self.emit("deployment:failed", eventArgs);
self.close();
console.warn(message);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should remove

Comment on lines +306 to +316
console.log(libReceipt.blockNumber, startBlock);
console.log(
exampleReceipt.blockNumber,
libReceipt.blockNumber,
startBlock
);
// The first confirmation is the block that accepts the tx. Then we wait two more.
// Then Example is deployed in the consequent block.
assert(libReceipt.blockNumber === startBlock + 1);
assert(exampleReceipt.blockNumber === libReceipt.blockNumber + 3);
assert(libReceipt.blockNumber === startBlock + BigInt(1));
//todo web3js-migration this fails
// assert(exampleReceipt.blockNumber === libReceipt.blockNumber + BigInt(3));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unhandled TODO

@Spacesai1or Spacesai1or May 4, 2023

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikoulai Did you add all this? Where is it from, what's it for?

Same with the files:

  • packages/encoder/test/initialization.test.js
  • packages/encoder/test/integer.test.js
  • packages/encoder/test/udvt.test.js

And these lib/ files shouldn't be included?

  • packages/fetch-and-compile/lib/debug.js
  • packages/fetch-and-compile/lib/fetch.js
  • packages/fetch-and-compile/lib/index.js
  • packages/fetch-and-compile/lib/multiple.js
  • packages/fetch-and-compile/lib/recognizer.js
  • packages/fetch-and-compile/lib/types.js
  • packages/fetch-and-compile/lib/utils.js

@cds-amal

cds-amal commented May 4, 2023

Copy link
Copy Markdown
Contributor

Note: @nazarhussain was (is?) working this issue and there might be some learnings in his PR #5393.

@nazarhussain

Copy link
Copy Markdown

@cds-amal @nikoulai Was holding it off to get fixed the identified issues in web3-4x first, publish it into a release, and then continue with this upgrade process.

So that you know, I identified the following list of issues during this upgrade process. This is the reason my PR taking long time to shape up.

web3/web3.js#5287
web3/web3.js#5288
web3/web3.js#5232
web3/web3.js#5208
web3/web3.js#5207
web3/web3.js#5201
web3/web3.js#5090
web3/web3.js#5203
web3/web3.js#5196
web3/web3.js#5189
web3/web3.js#5171
web3/web3.js#5170
web3/web3.js#5169
web3/web3.js#5127
web3/web3.js#5126
web3/web3.js#5125
web3/web3.js#5319
web3/web3.js#5320
web3/web3.js#5321
web3/web3.js#5712
web3/web3.js#5714
web3/web3.js#5717

@nikoulai nikoulai closed this May 9, 2023
@nazarhussain

Copy link
Copy Markdown

For clarity, @nikoulai and I discussed and agreed to make the #5393 as a base for this work. And @nikoulai will continue on that PR further.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants