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

feat: fix coinbase #581

Merged
merged 3 commits into from
Nov 28, 2023
Merged

feat: fix coinbase #581

merged 3 commits into from
Nov 28, 2023

Conversation

Eikix
Copy link
Member

@Eikix Eikix commented Nov 27, 2023

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

The coinbase opcode doesn't give a Kakarot registered EVM address.

Resolves: #577

What is the new behavior?

  • The coinbase opcode gives a Kakarot registered EVM address.

Does this introduce a breaking change?

  • Yes
  • No

@bajpai244 bajpai244 force-pushed the feat/fix-coinbase branch 2 times, most recently from 1aebb1b to 0fbb0e4 Compare November 27, 2023 15:02
@bajpai244 bajpai244 changed the title draft commit feat: fix coinbase Nov 27, 2023
@bajpai244 bajpai244 marked this pull request as ready for review November 27, 2023 15:06
@bajpai244
Copy link
Collaborator

Created an issue to keep track of the TODO.

Copy link
Collaborator

@enitrat enitrat left a comment

Choose a reason for hiding this comment

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

missing test for exec_coinbase

@enitrat
Copy link
Collaborator

enitrat commented Nov 28, 2023

unless you can't test it yet?

@bajpai244
Copy link
Collaborator

unless you can't test it yet?

@enitrat , The current ability to deploy these sequencer accounts on deploy of Kakarot is in TODO, I can setup a test without this functionality as well, I don't think should be an issue, but I don't think that will be a long term solution.

Lemme know, if an interim test works, then I can set one up.

@enitrat
Copy link
Collaborator

enitrat commented Nov 28, 2023

I can setup a test without this functionality as well, I don't think should be an issue, but I don't think that will be a long term solution.

I think the unit test of exec_coinbase should be decorrelated from the fact that deploying KKT also deploys predefined EOAs. You can deploy a simple EOA, set the sequencer address in a mock to this EOA's SN Address, and then test that coinbase has the right behavior

@Eikix
Copy link
Member Author

Eikix commented Nov 28, 2023

I can setup a test without this functionality as well, I don't think should be an issue, but I don't think that will be a long term solution.

I think the unit test of exec_coinbase should be decorrelated from the fact that deploying KKT also deploys predefined EOAs. You can deploy a simple EOA, set the sequencer address in a mock to this EOA's SN Address, and then test that coinbase has the right behavior

Yes the starknet::testing function exists

// Set the sequencer address to the provided value.
pub fn set_sequencer_address(address: ContractAddress) {
    cheatcode::<'set_sequencer_address'>(array![address.into()].span());
}
  1. Deploy an EOA
  2. Set the sequencer address to the EOA's stakrnet address
  3. exec_coinbase
  4. Check that the returned address is the EOA's

@bajpai244
Copy link
Collaborator

@Eikix, @enitrat added the unit test + added some unwraps to this file where I could see we were missing, done via this commit.

@enitrat enitrat added this pull request to the merge queue Nov 28, 2023
Merged via the queue into kkrt-labs:main with commit 5080494 Nov 28, 2023
2 of 3 checks passed
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.

feat: fix coinbase implementation
3 participants