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

console, cli, api fixes #1840

Merged
merged 1 commit into from
Oct 22, 2015
Merged

console, cli, api fixes #1840

merged 1 commit into from
Oct 22, 2015

Conversation

zelig
Copy link
Contributor

@zelig zelig commented Sep 22, 2015

This PR addresses several minor bugs, regressions, inconsistencies relating to geth UI including console, cli, rpc api

@robotally
Copy link

Vote Count Reviewers
👍 1 @bas-vk
👎 0

Updated: Wed Oct 21 15:04:14 UTC 2015

@zelig zelig changed the title Console a console, cli, api fixes Sep 22, 2015
@zelig zelig added this to the 1.3.0 milestone Sep 23, 2015
@zelig zelig self-assigned this Sep 23, 2015
@zelig zelig modified the milestones: 1.2.0, 1.3.0 Sep 27, 2015
@obscuren obscuren modified the milestones: 1.3.0, 1.2.0 Sep 28, 2015
@bas-vk
Copy link
Member

bas-vk commented Sep 29, 2015

@zelig, review done.

return passwordRepl
} else {
return input
func postprocess(input string) (string, bool) {
Copy link
Member

Choose a reason for hiding this comment

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

This function doesn't do any real post processing and the returned string is not actually necessary. Consider changing it to something like func mustLogInHistory(input string) bool.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

how about forgetting this automation entirely, pass interactivity as a parameter to modules and simply enforce interactive use on the console(s).

Copy link
Member

Choose a reason for hiding this comment

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

I think @ethers (#1697) asked for this feature not to hide passwords but to prevent dangerous commands not to end up in the history from which they can accidentally be executed again when the users browses through history. That means that besides password interaction also transaction confirmation from the console should be enabled since transactions will have irreversible consequences.

@zelig
Copy link
Contributor Author

zelig commented Oct 1, 2015

@bas-vk I agree with all points, thanks for the thorough review

@codecov-io
Copy link

Current coverage is 48.20%

Merging #1840 into develop will decrease coverage by -0.11% as of 4fa4336

Powered by Codecov. Updated on successful CI builds.

@@ -399,6 +400,16 @@ func run(ctx *cli.Context) {

ethereum, err := eth.New(cfg)
if err != nil {
var ok bool
for _, no := range datadirInUseErrNos {
if uint(err.(syscall.Errno)) == no {
Copy link
Member

Choose a reason for hiding this comment

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

This still doesn't work.

ethdb.NewLDBDatabase will return a syscall.Errno error for which you can check. In backend.go these errors are converted to an *errors.errorString instance.

chainDb, err := newdb(filepath.Join(config.DataDir, "chaindata"))
if err != nil {
    return nil, fmt.Errorf("blockchain db err: %v", err)
}

The check in main.go for an errno wil then obviously fail.

Second problem is that the check is only added to the run subcommand. Users who will start the console (or any other subcommand) will still get the old error message when another instance already claimed the database datadir.

@bas-vk
Copy link
Member

bas-vk commented Oct 15, 2015

What did you end up doing for #1697?

@zelig zelig removed the in progress label Oct 21, 2015
@@ -281,6 +286,18 @@ func New(config *Config) (*Ethereum, error) {
// Open the chain database and perform any upgrades needed
chainDb, err := newdb(filepath.Join(config.DataDir, "chaindata"))
if err != nil {
var ok bool
errno := uint(err.(syscall.Errno))
fmt.Printf("encountered error %d: %v\n", errno, err)
Copy link
Member

Choose a reason for hiding this comment

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

This is probably a debug line and can be removed?

@bas-vk
Copy link
Member

bas-vk commented Oct 21, 2015

Apart from the minor issue I'm ok 👍

* lines with leading space are ommitted from history
* exit processed even with whitespace around
* all whitespace lines (not only empty ones) are ignored

add 7 missing commands to admin api autocomplete

registrar: methods now return proper error if reg addresses are not set. fixes #1457

rpc/console: fix personal.newAccount() regression. Now all comms accept interactive password

registrar: add registrar tests for errors

crypto: catch AES decryption error on presale wallet import + fix error msg format. fixes #1580

CLI: improve error message when starting a second instance of geth. fixes #1564

cli/accounts: unlock multiple accounts. fixes #1785
* make unlocking multiple accounts work with inline <() fd
* passwdfile now correctly read only once
* improve logs
* fix CLI help text for unlocking

fix regression with docRoot / admin API
* docRoot/jspath passed to rpc/api ParseApis, which passes onto adminApi
* docRoot field for JS console in order to pass when RPC is (re)started
* improve flag desc for jspath

common/docserver: catch http errors from response

fix rpc/api tests

common/natspec: fix end to end test (skipped because takes 8s)

registrar: fix major regression:
* deploy registrars on frontier
* register HashsReg and UrlHint in GlobalRegistrar.
* set all 3 contract addresses in code
* zero out addresses first in tests
obscuren added a commit that referenced this pull request Oct 22, 2015
@obscuren obscuren merged commit dce5037 into ethereum:develop Oct 22, 2015
@obscuren obscuren removed the review label Oct 22, 2015
@obscuren obscuren modified the milestones: 2.0.0, 1.3.0 Oct 28, 2015
@gbalint gbalint deleted the console branch May 25, 2018 14:46
maoueh pushed a commit to streamingfast/go-ethereum that referenced this pull request Nov 1, 2023
….12.2

Big merge from v1.10.16 to v1.12.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants