Skip to content

Commit

Permalink
fix broken ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Sneh1999 committed Nov 18, 2024
1 parent 6d55758 commit efc4746
Show file tree
Hide file tree
Showing 14 changed files with 729 additions and 503 deletions.
19 changes: 19 additions & 0 deletions .env.sample.goerli
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,22 @@ DEVNET_PRIVKEY=""

## optional - address of already deployed ERC20 token which shall be used as rollup's fee token
FEE_TOKEN_ADDRESS=""

### Example TEE ATTESTATION CONTRACTS ###
DCAP_IMAGE_ID=0x4052beb38db7869b15596d53c2d5c02c9307faffca9215e69b0f0d0e1812a6c2

# On-Chain PCCS Configurations
ENCLAVE_IDENTITY_HELPER=0xfd4a34b578B352FE1896CDafaEb0f45f993352Bf
FMSPC_TCB_HELPER=0xC2A662e08A35513596E22D0aC236Ce72e59125EE
X509_CRL_HELPER=0x12C1E13Aa2a238EAb15c2e2b6AC670266bc3C814
X509_HELPER=0x5213c0e3Ab478dbc83E8afFF8909717332E4f8E1
ENCLAVE_ID_DAO=0x413272890ab9F155a47A5F90a404Fb51aa259087
FMSPC_TCB_DAO=0x7c04B466DebA13D48116b1339C62b35B9805E5A0
PCK_DAO=0x6D4cA6AE5315EBBcb4331c82531db0ad8853Eb31
PCS_DAO=0xD0335cbC73CA2f8EDd98a2BE3909f55642F414D7

RISC0_VERIFIER=0x4967e2fB48E2037eC466a8b60722A94bBce48Eb7
DCAP_ATTESTATION=0xefE368b17D137E86298eec8EbC5502fb56d27832

PCCS_ROUTER=0xbFDeE7A1f1bFA2267cD0DA50BE76D8c4a3864543
V3_VERIFIER=0x67042d171b8b7da1a4a98df787bdce79190dac3c
107 changes: 81 additions & 26 deletions .github/workflows/contract-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ jobs:
with:
version: nightly

- name: Prepare Environment Variables
run: |
cp .env.sample.goerli .env
export $(grep -v '^#' .env | xargs) # Load variables
for var in $(grep -v '^#' .env | cut -d= -f1); do
echo "$var=${!var}" >> $GITHUB_ENV
done
- name: Setup node/yarn
uses: actions/setup-node@v3
with:
Expand All @@ -33,9 +41,6 @@ jobs:
- name: Install packages
run: yarn

- name: Source env
run: source .env.sample.goerli

- name: Build
run: forge test
tests:
Expand All @@ -55,6 +60,20 @@ jobs:
with:
version: nightly

- name: Prepare Environment Variables
run: |
cp .env.sample.goerli .env
export $(grep -v '^#' .env | xargs) # Load variables
for var in $(grep -v '^#' .env | cut -d= -f1); do
echo "$var=${!var}" >> $GITHUB_ENV
done
- name: Run unused Solidity errors checker
uses: OffchainLabs/actions/check-unused-errors@main
with:
directory: './src'
exceptions_file: './test/unused-errors/exceptions.txt'

- name: Setup nodejs
uses: actions/setup-node@v2
with:
Expand All @@ -79,9 +98,6 @@ jobs:
- name: Build
run: yarn build:all

- name: Source env
run: source .env.sample.goerli

- name: Run tests
run: yarn hardhat --network hardhat test test/contract/*.spec.ts

Expand All @@ -100,12 +116,6 @@ jobs:
- name: Test function signatures
run: yarn run test:signatures

- name: Run unused Solidity errors checker
uses: OffchainLabs/actions/check-unused-errors@main
with:
directory: './src'
exceptions_file: './test/unused-errors/exceptions.txt'

- name: Run coverage
run: yarn hardhat coverage --testfiles "test/contract/*.spec.ts"

Expand All @@ -129,6 +139,14 @@ jobs:
with:
version: nightly

- name: Prepare Environment Variables
run: |
cp .env.sample.goerli .env
export $(grep -v '^#' .env | xargs) # Load variables
for var in $(grep -v '^#' .env | cut -d= -f1); do
echo "$var=${!var}" >> $GITHUB_ENV
done
- uses: OffchainLabs/actions/run-nitro-test-node@test-node-args
with:
nitro-testnode-ref: deneb-integration
Expand Down Expand Up @@ -158,12 +176,20 @@ jobs:
with:
submodules: recursive

- uses: OffchainLabs/actions/run-nitro-test-node@main
- uses: EspressoSystems/offchainlabs-actions/run-nitro-test-node@specify-checkout-repo
with:
l3-node: true
args: --espresso --latest-espresso-image
no-token-bridge: true
no-l3-token-bridge: true
nitro-contracts-branch: '${{ github.event.pull_request.head.sha || github.sha }}'
nitro-testnode-ref: integration
nitro-testnode-repo: EspressoSystems/nitro-testnode

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Setup node/yarn
uses: actions/setup-node@v3
Expand All @@ -172,15 +198,20 @@ jobs:
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Prepare Environment Variables
run: |
cp .env.sample.goerli .env
export $(grep -v '^#' .env | xargs) # Load variables
for var in $(grep -v '^#' .env | cut -d= -f1); do
echo "$var=${!var}" >> $GITHUB_ENV
done
- name: Install packages
run: yarn

- name: Compile contracts
run: yarn build

- name: Source env
run: source .env.sample.goerli

- name: Run e2e tests
run: yarn test:e2e
test-e2e-custom-fee-token:
Expand All @@ -191,13 +222,20 @@ jobs:
with:
submodules: recursive

- uses: OffchainLabs/actions/run-nitro-test-node@main
- uses: EspressoSystems/offchainlabs-actions/run-nitro-test-node@specify-checkout-repo
with:
l3-node: true
args: --l3-fee-token
args: --l3-fee-token --espresso --latest-espresso-image
no-token-bridge: true
no-l3-token-bridge: true
nitro-contracts-branch: '${{ github.event.pull_request.head.sha || github.sha }}'
nitro-testnode-ref: integration
nitro-testnode-repo: EspressoSystems/nitro-testnode

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Setup node/yarn
uses: actions/setup-node@v3
Expand All @@ -206,15 +244,20 @@ jobs:
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Prepare Environment Variables
run: |
cp .env.sample.goerli .env
export $(grep -v '^#' .env | xargs) # Load variables
for var in $(grep -v '^#' .env | cut -d= -f1); do
echo "$var=${!var}" >> $GITHUB_ENV
done
- name: Install packages
run: yarn

- name: Compile contracts
run: yarn build

- name: Source env
run: source .env.sample.goerli

- name: Run e2e tests
run: yarn test:e2e
test-e2e-fee-token-6-decimals:
Expand All @@ -225,13 +268,20 @@ jobs:
with:
submodules: recursive

- uses: OffchainLabs/actions/run-nitro-test-node@main
- uses: EspressoSystems/offchainlabs-actions/run-nitro-test-node@specify-checkout-repo
with:
l3-node: true
args: --l3-fee-token --l3-fee-token-decimals 6
args: --espresso --latest-espresso-image --l3-fee-token --l3-fee-token-decimals 6
no-token-bridge: true
no-l3-token-bridge: true
nitro-contracts-branch: '${{ github.event.pull_request.head.sha || github.sha }}'
nitro-testnode-ref: 'integration'
nitro-testnode-repo: EspressoSystems/nitro-testnode

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Setup node/yarn
uses: actions/setup-node@v3
Expand All @@ -240,14 +290,19 @@ jobs:
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Prepare Environment Variables
run: |
cp .env.sample.goerli .env
export $(grep -v '^#' .env | xargs) # Load variables
for var in $(grep -v '^#' .env | cut -d= -f1); do
echo "$var=${!var}" >> $GITHUB_ENV
done
- name: Install packages
run: yarn

- name: Compile contracts
run: yarn build

- name: Source env
run: source .env.sample.goerli

- name: Run e2e tests
run: yarn test:e2e
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dotenv.config()
const solidity = {
compilers: [
{
version: '0.8.19',
version: '0.8.20',
settings: {
optimizer: {
enabled: true,
Expand Down
23 changes: 21 additions & 2 deletions src/bridge/ISequencerInbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,15 @@ interface ISequencerInbox is IDelayedMessageProvider {
IGasRefunder gasRefunder
) external;

function addSequencerL2BatchFromOrigin(
uint256 sequenceNumber,
bytes calldata data,
uint256 afterDelayedMessagesRead,
IGasRefunder gasRefunder,
uint256 prevMessageCount,
uint256 newMessageCount
) external;

function addSequencerL2BatchFromOrigin(
uint256 sequenceNumber,
bytes calldata data,
Expand All @@ -169,6 +178,15 @@ interface ISequencerInbox is IDelayedMessageProvider {
bytes memory quote
) external;

function addSequencerL2Batch(
uint256 sequenceNumber,
bytes calldata data,
uint256 afterDelayedMessagesRead,
IGasRefunder gasRefunder,
uint256 prevMessageCount,
uint256 newMessageCount
) external;

function addSequencerL2Batch(
uint256 sequenceNumber,
bytes calldata data,
Expand All @@ -184,8 +202,7 @@ interface ISequencerInbox is IDelayedMessageProvider {
uint256 afterDelayedMessagesRead,
IGasRefunder gasRefunder,
uint256 prevMessageCount,
uint256 newMessageCount,
bytes memory quote
uint256 newMessageCount
) external;

// ---------- onlyRollupOrOwner functions ----------
Expand Down Expand Up @@ -234,6 +251,8 @@ interface ISequencerInbox is IDelayedMessageProvider {

// ---------- initializer ----------

function initialize(IBridge bridge_, MaxTimeVariation calldata maxTimeVariation_) external;

function initialize(
IBridge bridge_,
MaxTimeVariation calldata maxTimeVariation_,
Expand Down
33 changes: 30 additions & 3 deletions src/bridge/SequencerInbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
// True if the chain this SequencerInbox is deployed on uses custom fee token
bool public immutable isUsingFeeToken;

// TEE attestation contract
EspressoTEEVerifier espressoTEEVerifier;

constructor(uint256 _maxDataSize, IReader4844 reader4844_, bool _isUsingFeeToken) {
Expand Down Expand Up @@ -183,6 +182,13 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
__LEGACY_MAX_TIME_VARIATION.futureSeconds = 0;
}

function initialize(
IBridge bridge_,
ISequencerInbox.MaxTimeVariation calldata maxTimeVariation_
) external onlyDelegated {
revert Deprecated();
}

function initialize(
IBridge bridge_,
ISequencerInbox.MaxTimeVariation calldata maxTimeVariation_,
Expand Down Expand Up @@ -343,6 +349,17 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
revert Deprecated();
}

function addSequencerL2BatchFromOrigin(
uint256 sequenceNumber,
bytes calldata data,
uint256 afterDelayedMessagesRead,
IGasRefunder gasRefunder,
uint256 prevMessageCount,
uint256 newMessageCount
) external refundsGas(gasRefunder, IReader4844(address(0))) {
revert Deprecated();
}

function addSequencerL2BatchFromOrigin(
uint256 sequenceNumber,
bytes calldata data,
Expand Down Expand Up @@ -408,8 +425,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
uint256 afterDelayedMessagesRead,
IGasRefunder gasRefunder,
uint256 prevMessageCount,
uint256 newMessageCount,
bytes memory quote
uint256 newMessageCount
) external refundsGas(gasRefunder, reader4844) {
if (!isBatchPoster[msg.sender]) revert NotBatchPoster();
(
Expand Down Expand Up @@ -465,6 +481,17 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
}
}

function addSequencerL2Batch(
uint256 sequenceNumber,
bytes calldata data,
uint256 afterDelayedMessagesRead,
IGasRefunder gasRefunder,
uint256 prevMessageCount,
uint256 newMessageCount
) external override refundsGas(gasRefunder, IReader4844(address(0))) {
revert Deprecated();
}

function addSequencerL2Batch(
uint256 sequenceNumber,
bytes calldata data,
Expand Down
Loading

0 comments on commit efc4746

Please sign in to comment.