Skip to content
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

Simple Contract Integrations #16

Merged
merged 19 commits into from
Mar 4, 2020
Merged

Conversation

ben-chain
Copy link
Collaborator

Description

Fixes YAS-65 usage of transpiled Simple* contracts.

Talked with @karlfloersch and decided to put them in rollup-full-node--we could also put in the integrations repo, but our conclusion was if these ever break, we need that to surface as soon as possible.

Metadata

Fixes

  • Fixes YAS 65

Contributing Agreement

ben-chain and others added 17 commits February 4, 2020 10:41
* Changing examples package to be more generic
* Updating default exec manager address
* Add executable fullnode

* Add better logging with debug mode

* Fix linting bug
We've forked Geth to intercept calls to the ExecutionManger contract in ethereum-optimism/go-ethereum#1. Add a a test that tests these changes. The test is a copy of the existing simple storage spec with some minor changes. Namely, we don't test that storage events were emitted when ExecutionManager#ovmSSTORE is called because our forked version of Geth doesn't emit events. This also makes a couple changes to test helper file:

We pass in the address of the ExecutionManager to manuallyDeployOvmContract instead of the ExecutionManager itself. This allows us to pass in an address of an ExecutionManager that's already been deployed which we need to do in our new test.

Replace getTransactionReceipt with waitForTransaction. When we were using the Javascript provider transactions would be mined more-or-less immediately. This means that getTransactionReceipt could be called immediately after sendTransaction and the transaction would be ready. When we're talking to a Geth node this may not be the case. Switching to waitForTransaction allows time for the transaction to be mined.
Working Truffle Example!
Note: A small hack is required to get this to work -- documented in `packages/examples/truffle-config.js`

Also adds:
* Fix for nonces in ExecutionManager.sol
* Gas limit fix setting it to the required 9_000_000 vs 5_000_000 in the fullnode
* Util for adding padding to strings to make them of a certain length
* Optional `add0x` param on `bufToHexStr(...)`
* Lock around separate txs that are assumed to be run sequentially in DefaultWeb3Handler

Co-authored-by: Mason Fischer <mason@kissr.co>
Before we were only incrementing nonces on CREATE. Wallets expect nonces
to be incremented on CALLs aswell. This test tests that we are in fact
inrementing nonces on CALLs aswell.

Other changes:

* Update the name of the executeCall test
Copy link
Contributor

@karlfloersch karlfloersch left a comment

Choose a reason for hiding this comment

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

This looks great! One comment could be that you may want to either remove the timestamp test or actually implement a timestamp test considering we've added timestamps.

However, other than that, this looks great!

@@ -148,7 +148,7 @@ describe('Solitity contracts should have constants correctly accessible when usi
const bytesMemoryConstB: Buffer = hexStrToBuf(
'BBBbeedfeedBBBBBBbeedfeedBBBBBBbeedfeedBBBBBBbeedfeedBBBBBBbeedfeedBBBBBBbeedfeedBBBBBBbeedfeedBBB'
)
it('should work for the first bytes memory constant', async () => {
it('should work for the second bytes memory constant', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Asked Ben about this, he said that it was just a type-o where he copied a test but forgot to update the name

@@ -0,0 +1,7 @@
pragma solidity ^0.5.0;

contract SelfAware {
Copy link
Contributor

Choose a reason for hiding this comment

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

lulz

const timeGetter = await deployContract(wallet, TimeGetter, [], [])
const time = await timeGetter.getTimestamp()
time._hex.should.equal('???')
})
Copy link
Contributor

Choose a reason for hiding this comment

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

We've technically added timestamp in 4bf0c7e so this test could be enabled.

import * as CallerGetter from '../contracts/build/transpiled/CallerGetter.json'
import * as OriginGetter from '../contracts/build/transpiled/OriginGetter.json'
import * as CallerReturner from '../contracts/build/transpiled/CallerReturner.json'
import * as TimeGetter from '../contracts/build/transpiled/TimeGetter.json'
Copy link
Contributor

@karlfloersch karlfloersch Mar 2, 2020

Choose a reason for hiding this comment

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

Btw one thing I forgot to mention is that technically if we were keeping to convention there'd be a comment for Contract Imports which has all of these as opposed to internal imports, even though of course contract imports are internal. But just a note that's the convention that has organically emerged (I think from Kelvin)

@ben-chain ben-chain merged commit 00581e3 into master Mar 4, 2020
@ben-chain ben-chain deleted the feat/simple-contract-integrations branch March 4, 2020 20:18
masonforest added a commit that referenced this pull request Mar 4, 2020
willmeister pushed a commit that referenced this pull request Mar 5, 2020
gakonst added a commit that referenced this pull request Apr 12, 2021
* chore: cleanup gitignore

* fix: adjust package.json and tsconfigs

* feat: expose base-service in core-utils

* chore(l1-ingestion): use base-service from core-utils

* chore(l2-ingestion): use base-service from core-utils

* chore: use base-service from core-utils in remaining services
snario pushed a commit that referenced this pull request Apr 14, 2021
InoMurko referenced this pull request in omgnetwork/optimism May 25, 2021
* chore: cleanup gitignore

* fix: adjust package.json and tsconfigs

* feat: expose base-service in core-utils

* chore(l1-ingestion): use base-service from core-utils

* chore(l2-ingestion): use base-service from core-utils

* chore: use base-service from core-utils in remaining services
max-sanchez added a commit to hemilabs/optimism that referenced this pull request Apr 16, 2024
88047e707 Add tbcd, a small bitcoin daemon that participates on bitcoin p2p (ethereum-optimism#50)
1146a08b5 localnet reorg fix (ethereum-optimism#76)
87f18a191 build(deps): bump github.com/docker/docker (ethereum-optimism#64)
9073baeaf localnet (ethereum-optimism#37)
1588cbf04 Add common user-specific files to gitignore (ethereum-optimism#51)
210aabe7a Update popm.go, fix typo (ethereum-optimism#40)
a5e689493 make: automate copyright headers (ethereum-optimism#31)
1c3bfc9bc Use `maps.Clone(m)` to copy returned map in `APICommands()` (ethereum-optimism#33)
1be4df2a3 Use 'errors.Is' to compare errors (ethereum-optimism#32)
3f6bc5f8e e2e: sync ElectrumX environment variables with infra (ethereum-optimism#36)
c5b0fea01 electrumx: add connection reuse and pooling (ethereum-optimism#26)
cfc1293e9 Update README.md (ethereum-optimism#29)
8896259f0 retry mine keystone on failure (ethereum-optimism#18)
a10e3bb29 Use '%w' verb in fmt.Errorf to wrap errors (fixes ethereum-optimism#13) (ethereum-optimism#27)
6cd677611 deps: update google.golang.org/protobuf to v1.33.0 (ethereum-optimism#28)
ed7eb8e97 ci: fix concurrency cancel-in-progress for pull requests (ethereum-optimism#16)
ac3b7eacb docker: update golang image to v1.22.1 (ethereum-optimism#25)
d6b0ac8af returning response errors if they exist from bfg -> popm (ethereum-optimism#24)
d450b787a Network test start height + no panic (ethereum-optimism#22)
b390805c5 allowing BTC Block and L2 Keystone generation rates to be configurable in local network (ethereum-optimism#19)
bfd3b1dc0 make: add -local flag to goimports (ethereum-optimism#9)
e0e8964fc Move internal error into protocol package (ethereum-optimism#10)
7875a897c l2 keystone mining fixes (#3)

git-subtree-dir: heminetwork
git-subtree-split: 88047e707e2db8522e2ad77c5f849e55bc94cd10
ClaytonNorthey92 pushed a commit to hemilabs/optimism that referenced this pull request Apr 17, 2024
88047e707 Add tbcd, a small bitcoin daemon that participates on bitcoin p2p (ethereum-optimism#50)
1146a08b5 localnet reorg fix (ethereum-optimism#76)
87f18a191 build(deps): bump github.com/docker/docker (ethereum-optimism#64)
9073baeaf localnet (ethereum-optimism#37)
1588cbf04 Add common user-specific files to gitignore (ethereum-optimism#51)
210aabe7a Update popm.go, fix typo (ethereum-optimism#40)
a5e689493 make: automate copyright headers (ethereum-optimism#31)
1c3bfc9bc Use `maps.Clone(m)` to copy returned map in `APICommands()` (ethereum-optimism#33)
1be4df2a3 Use 'errors.Is' to compare errors (ethereum-optimism#32)
3f6bc5f8e e2e: sync ElectrumX environment variables with infra (ethereum-optimism#36)
c5b0fea01 electrumx: add connection reuse and pooling (ethereum-optimism#26)
cfc1293e9 Update README.md (ethereum-optimism#29)
8896259f0 retry mine keystone on failure (ethereum-optimism#18)
a10e3bb29 Use '%w' verb in fmt.Errorf to wrap errors (fixes ethereum-optimism#13) (ethereum-optimism#27)
6cd677611 deps: update google.golang.org/protobuf to v1.33.0 (ethereum-optimism#28)
ed7eb8e97 ci: fix concurrency cancel-in-progress for pull requests (ethereum-optimism#16)
ac3b7eacb docker: update golang image to v1.22.1 (ethereum-optimism#25)
d6b0ac8af returning response errors if they exist from bfg -> popm (ethereum-optimism#24)
d450b787a Network test start height + no panic (ethereum-optimism#22)
b390805c5 allowing BTC Block and L2 Keystone generation rates to be configurable in local network (ethereum-optimism#19)
bfd3b1dc0 make: add -local flag to goimports (ethereum-optimism#9)
e0e8964fc Move internal error into protocol package (ethereum-optimism#10)
7875a897c l2 keystone mining fixes (#3)

git-subtree-dir: heminetwork
git-subtree-split: 88047e707e2db8522e2ad77c5f849e55bc94cd10
therealbytes added a commit to therealbytes/optimism that referenced this pull request May 17, 2024
* refactor: var rename

* refactor: use uint64 for timestamp and gas limit

* refactor: alias api to cc_api for consistency

* refactor: var renames

* refactor: var and alias name changes

* build: wasm test binaries
bap2pecs referenced this pull request in babylonlabs-io/optimism Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants